diff options
Diffstat (limited to 'src/shaders/shader.cpp')
-rw-r--r-- | src/shaders/shader.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/shaders/shader.cpp b/src/shaders/shader.cpp new file mode 100644 index 0000000000..36afd488a3 --- /dev/null +++ b/src/shaders/shader.cpp @@ -0,0 +1,31 @@ +#include "shaders/shader.h" + +#include "util/assert.h" + +using namespace mixxx; + +#ifdef MIXXX_USE_QOPENGL +using GLShader = QOpenGLShader; +#else +using GLShader = QGLShader; +#endif + +Shader::Shader() = default; + +Shader::~Shader() = default; + +void Shader::load(const QString& vertexShaderCode, const QString& fragmentShaderCode) { + VERIFY_OR_DEBUG_ASSERT(addShaderFromSourceCode( + GLShader::Vertex, vertexShaderCode)) { + return; + } + + VERIFY_OR_DEBUG_ASSERT(addShaderFromSourceCode( + GLShader::Fragment, fragmentShaderCode)) { + return; + } + + VERIFY_OR_DEBUG_ASSERT(link()) { + return; + } +} |