X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpostprocessor.cpp;h=f67bf4cf701407feb086ddb45669394d51c7ff4b;hb=d42c443d24a8e428c43f849b218c9e1a1dca4189;hp=3c6fbebe89b5704b64a6fd1428a6259fc76f34bb;hpb=34446c94b58602c0c6e610b889691f0c1645555f;p=libs%2Fgl.git diff --git a/source/postprocessor.cpp b/source/postprocessor.cpp index 3c6fbebe..f67bf4cf 100644 --- a/source/postprocessor.cpp +++ b/source/postprocessor.cpp @@ -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