summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-03-16 16:44:45 +0100
committerFlorian Jung <flo@windfisch.org>2015-03-16 16:44:45 +0100
commit5e4632f1a543239ebf8835913f5ef05e5740c270 (patch)
tree9840ac220cc26d094bd12e152cddc66337c84918
parent4381d9619fdc17e3abe81eb2a1f469a104911938 (diff)
show canvas instead of eye
-rw-r--r--client2.cpp15
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();