50 lines
1.1 KiB
C++
50 lines
1.1 KiB
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, "standard") == 0)
|
|
{
|
|
static StandardVertexShader standardVertexShader;
|
|
return &standardVertexShader;
|
|
}
|
|
else if (strcmp(szName, "test") == 0)
|
|
{
|
|
static TestVertexShader testVertexShader;
|
|
return &testVertexShader;
|
|
}
|
|
return nullptr;
|
|
}
|
|
virtual davinci::PixelShaderInterface* getPixelShader(const char* szName)
|
|
{
|
|
static SolidColorPixelShader solidColorPixelShader;
|
|
static TestPixelShader testPixelShader;
|
|
if(strcmp(szName, solidColorPixelShader.getName()) == 0)
|
|
{
|
|
return &solidColorPixelShader;
|
|
}
|
|
else if (strcmp(szName, testPixelShader.getName()) == 0)
|
|
{
|
|
return &testPixelShader;
|
|
}
|
|
return nullptr;
|
|
}
|
|
};
|
|
|
|
extern "C"
|
|
{
|
|
|
|
__declspec(dllexport) davinci::ShaderFileInterface* ShaderFileInterface()
|
|
{
|
|
static TestShaderInterface theInterface;
|
|
return &theInterface;
|
|
}
|
|
|
|
}
|