X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpostprocessor.cpp;h=28ae71b0945b2ca28e04cf3de34d60e222a36646;hp=add8b1ed1055daf5527cc34ed32331ba15be84e4;hb=bf1f59c4dca6b651e39c126c63a0780b65a34927;hpb=afd943c2bf1dd289565be557fa778248fee54247 diff --git a/source/postprocessor.cpp b/source/postprocessor.cpp index add8b1ed..28ae71b0 100644 --- a/source/postprocessor.cpp +++ b/source/postprocessor.cpp @@ -6,11 +6,12 @@ namespace { const char fullscreen_vs_source[] = + "attribute vec4 vertex;\n" "varying vec2 texcoord;\n" "void main()\n" "{\n" - " gl_Position = gl_Vertex;\n" - " texcoord = gl_Vertex.xy*0.5+0.5;\n" + " gl_Position = vertex;\n" + " texcoord = vertex.xy*0.5+0.5;\n" "}\n"; } @@ -19,9 +20,14 @@ const char fullscreen_vs_source[] = namespace Msp { namespace GL { +void PostProcessor::render(Renderer &, const Texture2D &color, const Texture2D &depth) +{ + render(color, depth); +} + Shader &PostProcessor::get_fullscreen_vertex_shader() { - static Shader shader(VERTEX_SHADER, fullscreen_vs_source); + static VertexShader shader(fullscreen_vs_source); return shader; } @@ -33,7 +39,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); @@ -44,5 +50,17 @@ const Mesh &PostProcessor::create_fullscreen_quad() return mesh; } + +PostProcessor::Template::Template(): + size_divisor(1) +{ } + + +PostProcessor::Template::Loader::Loader(Template &t): + DataFile::ObjectLoader