]> git.tdb.fi Git - libs/gl.git/blobdiff - source/postprocessor.cpp
Move filter heuristic for mipmap levels to Texture::Loader
[libs/gl.git] / source / postprocessor.cpp
index 3c6fbebe89b5704b64a6fd1428a6259fc76f34bb..f67bf4cf701407feb086ddb45669394d51c7ff4b 100644 (file)
@@ -3,27 +3,12 @@
 #include "postprocessor.h"
 #include "shader.h"
 
-namespace {
-
-const char fullscreen_vs_source[] =
-       "attribute vec4 vertex;\n"
-       "varying vec2 texcoord;\n"
-       "void main()\n"
-       "{\n"
-       "       gl_Position = vertex;\n"
-       "       texcoord = vertex.xy*0.5+0.5;\n"
-       "}\n";
-
-}
-
-
 namespace Msp {
 namespace GL {
 
-Shader &PostProcessor::get_fullscreen_vertex_shader()
+void PostProcessor::render(Renderer &, const Texture2D &color, const Texture2D &depth)
 {
-       static VertexShader shader(fullscreen_vs_source);
-       return shader;
+       render(color, depth);
 }
 
 const Mesh &PostProcessor::get_fullscreen_quad()
@@ -34,7 +19,7 @@ const Mesh &PostProcessor::get_fullscreen_quad()
 
 const Mesh &PostProcessor::create_fullscreen_quad()
 {
-       static Mesh mesh(GL::VERTEX2);
+       static Mesh mesh(VERTEX2);
        MeshBuilder builder(mesh);
        builder.begin(TRIANGLE_STRIP);
        builder.vertex(-1, 1);
@@ -45,5 +30,17 @@ const Mesh &PostProcessor::create_fullscreen_quad()
        return mesh;
 }
 
+
+PostProcessor::Template::Template():
+       size_divisor(1)
+{ }
+
+
+PostProcessor::Template::Loader::Loader(Template &t):
+       DataFile::ObjectLoader<Template>(t)
+{
+       add("size_divisor", &Template::size_divisor);
+}
+
 } // namespace GL
 } // namespace Msp