From 5e4632f1a543239ebf8835913f5ef05e5740c270 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 16 Mar 2015 16:44:45 +0100 Subject: show canvas instead of eye --- client2.cpp | 15 +++++++++++++-- 1 file 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(); -- cgit v1.2.3