diff --git a/opengl-test-two/main.cpp b/opengl-test-two/main.cpp index eec9fb7..a0bdfd6 100644 --- a/opengl-test-two/main.cpp +++ b/opengl-test-two/main.cpp @@ -184,8 +184,11 @@ GLuint WriteTexture(int textw, int texth){ // Always check that our framebuffer is ok if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - return false; - + return false; + + // Render to our framebuffer + glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName); + glViewport(0, 0, textw, texth); } diff --git a/opengl-test-two/trimap.fragmentshader b/opengl-test-two/trimap.fragmentshader index eb87cfa..12d7b75 100644 --- a/opengl-test-two/trimap.fragmentshader +++ b/opengl-test-two/trimap.fragmentshader @@ -4,7 +4,8 @@ in vec2 UV; // Ouput data -out vec3 color; +//out vec3 color; +layout(location = 0) out vec3 color; // Values that stay constant for the whole mesh. uniform sampler2D myTextureSampler;