diff options
Diffstat (limited to 'client2.cpp')
-rw-r--r-- | client2.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/client2.cpp b/client2.cpp index 6074a13..02042d5 100644 --- a/client2.cpp +++ b/client2.cpp @@ -97,6 +97,15 @@ const char* oculusFragmentSource = " float bval = texture(texVideo, loc_b).r;\n" " outColor = vec4(rval,gval,bval,1.0);\n" "}\n"; +const char* oculusDummyFragmentSource = + "#version 150\n" + "uniform sampler2D texVideo;\n" + "in vec2 Screencoord;\n" + "out vec4 outColor;\n" + "void main()\n" + "{\n" + " outColor = texture(texVideo, Screencoord/vec2(2,2)+vec2(0.5,0.5));\n" + "}\n"; const char* justDrawASpriteFragmentSourceGray = "#version 150\n" @@ -230,7 +239,7 @@ GLuint justDrawASpriteShaderProgram(GLuint vao, GLuint vbo, bool gray=false) GLuint newOculusShaderProgram(GLuint vao, GLuint vbo) { GLuint vertexShader, fragmentShader, shaderProgram; - compileShaderProgram(oculusVertexSource, oculusFragmentSource, vertexShader, fragmentShader, shaderProgram); + compileShaderProgram(oculusVertexSource, oculusDummyFragmentSource, vertexShader, fragmentShader, shaderProgram); glBindVertexArray(vao); @@ -571,11 +580,13 @@ int main(int argc, const char** argv) glBindVertexArray(vaoWholescreenQuad); glUseProgram(oculusShaderProgram); glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, eyeTex); + glBindTexture(GL_TEXTURE_2D, canvasTex/*eyeTex*/); glDrawArrays(GL_TRIANGLES, 0, 6); + + glfwSwapBuffers(window); glfwPollEvents(); |