]> git.sesse.net Git - movit/blobdiff - sandbox_effect.cpp
Add a “sandbox effect” that does nothing but is a useful playground for development...
[movit] / sandbox_effect.cpp
diff --git a/sandbox_effect.cpp b/sandbox_effect.cpp
new file mode 100644 (file)
index 0000000..85fa900
--- /dev/null
@@ -0,0 +1,27 @@
+#define GL_GLEXT_PROTOTYPES 1
+
+#include <math.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <assert.h>
+
+#include "sandbox_effect.h"
+#include "util.h"
+
+SandboxEffect::SandboxEffect()
+       : parm(0.0f)
+{
+       register_float("parm", &parm);
+}
+
+std::string SandboxEffect::output_fragment_shader()
+{
+       return read_file("sandbox_effect.frag");
+}
+
+void SandboxEffect::set_uniforms(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num)
+{
+       Effect::set_uniforms(glsl_program_num, prefix, sampler_num);
+
+       // Any OpenGL state you might want to set, goes here.
+}