40 lines
816 B
C++
40 lines
816 B
C++
#include "dv_config.h"
|
|
#include "shader/dvc_shader_interface.h"
|
|
|
|
#include "test_vertex_shader.h"
|
|
#include "test_pixel_shader.h"
|
|
|
|
class TestShaderInterface : public davinci::ShaderFileInterface
|
|
{
|
|
public:
|
|
virtual davinci::VertexShaderInterface* getVertexShader(const char* szName)
|
|
{
|
|
if (strcmp(szName, "test") == 0)
|
|
{
|
|
static TestVertexShader testVertexShader;
|
|
return &testVertexShader;
|
|
}
|
|
return nullptr;
|
|
}
|
|
virtual davinci::PixelShaderInterface* getPixelShader(const char* szName)
|
|
{
|
|
static TestPixelShader testPixelShader;
|
|
if (strcmp(szName, testPixelShader.getName()) == 0)
|
|
{
|
|
return &testPixelShader;
|
|
}
|
|
return nullptr;
|
|
}
|
|
};
|
|
|
|
extern "C"
|
|
{
|
|
|
|
__declspec(dllexport) davinci::ShaderFileInterface* ShaderFileInterface()
|
|
{
|
|
static TestShaderInterface theInterface;
|
|
return &theInterface;
|
|
}
|
|
|
|
}
|