diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-06-08 13:02:14 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-06-08 13:02:14 -0600 |
commit | 5e9cff0b97b1301c2b13dbfe2570ddb4551f814f (patch) | |
tree | deac4147178dd708f7309e90bb72fd8b73efc65d /progs/tests | |
parent | 009ddb4e509f7dd39a17408332c6b0eff47a16fe (diff) |
disable shader program before glDrawPixels
Diffstat (limited to 'progs/tests')
-rw-r--r-- | progs/tests/drawbuffers.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/progs/tests/drawbuffers.c b/progs/tests/drawbuffers.c index 8583bac0dd..d2e826fadf 100644 --- a/progs/tests/drawbuffers.c +++ b/progs/tests/drawbuffers.c @@ -19,6 +19,7 @@ static int Win; static int Width = 400, Height = 400; static GLuint FBobject, RBobjects[3]; static GLfloat Xrot = 0.0, Yrot = 0.0; +static GLuint Program; static void @@ -40,6 +41,8 @@ Display(void) GL_COLOR_ATTACHMENT1_EXT }; + glUseProgram_func(Program); + /* draw to user framebuffer */ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBobject); @@ -75,6 +78,7 @@ Display(void) buffer + Width * Height / 2 * 4); /* draw to window */ + glUseProgram_func(0); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glWindowPos2iARB(0, 0); glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); @@ -243,15 +247,15 @@ SetupShaders(void) " gl_FragData[1] = vec4(1.0) - gl_Color; \n" "}\n"; - GLuint fragShader, program; + GLuint fragShader; fragShader = LoadAndCompileShader(GL_FRAGMENT_SHADER, fragShaderText); - program = glCreateProgram_func(); + Program = glCreateProgram_func(); - glAttachShader_func(program, fragShader); - glLinkProgram_func(program); - CheckLink(program); - glUseProgram_func(program); + glAttachShader_func(Program, fragShader); + glLinkProgram_func(Program); + CheckLink(Program); + glUseProgram_func(Program); } |