Page 1 of 1

annoying gl buffer...

Posted: Wed Jan 02, 2008 10:34 pm
by com1
i am new to opengl and decided to try creating some sort of triangle in a renderer. i succeeded with the renderer, but when i ran the program, i basically got a mixed up screenshot of my desktop. i assumed that this was an image buffer issue, so i added code to clear the color, stencil, etc. buffers. after i did this, i ran the program again and got the same thing. can anyone help me on this?

Posted: Thu Jan 03, 2008 8:27 pm
by crazygray1
I played With OpenGL for a while, made the same triangle. Can I see your code?

Posted: Fri Jan 04, 2008 2:45 am
by Telgin
Yeah, seeing some of your start up / rendering code would help.

It sounds like either the window isn't being created properly, or the screen clearing code isn't working right, despite your efforts. I can't recall exactly what code was used to clear the screen to black, but I'm sure you've got that right at least.

Are you clearing the screen immediately before drawing the triangle? Is this on a Windows platform? It's possible that you aren't flipping the buffers or something after drawing to them (if this isn't how it works, forgive me, it's been over a year since I've seen any GL code).

Lots of stuff could be the cause.

Also, are you just drawing the triangle with a call to glBegin(GL_TRIANGLE), vertex drawing functions, and an ending glEnd()? I'm not following what you mean by saying that you got the renderer to work right...