mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-06-21 21:32:40 +02:00
32 lines
573 B
C++
32 lines
573 B
C++
/*
|
|
** Sample Framework for deko3d Applications
|
|
** CShader.h: Utility class for loading shaders from the filesystem
|
|
*/
|
|
#pragma once
|
|
#include "common.h"
|
|
#include "CMemPool.h"
|
|
|
|
class CShader
|
|
{
|
|
dk::Shader m_shader;
|
|
CMemPool::Handle m_codemem;
|
|
public:
|
|
CShader() : m_shader{}, m_codemem{} { }
|
|
~CShader()
|
|
{
|
|
m_codemem.destroy();
|
|
}
|
|
|
|
constexpr operator bool() const
|
|
{
|
|
return m_codemem;
|
|
}
|
|
|
|
constexpr operator dk::Shader const*() const
|
|
{
|
|
return &m_shader;
|
|
}
|
|
|
|
bool load(CMemPool& pool, const char* path);
|
|
};
|