Jump to content
  • Advertisement
Sign in to follow this  
AndyEsser

OpenGL Problem With Basic OpenGL Setup

This topic is 4044 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been using OpenGL for a few years now, slowly but surely moving in the right direction. However, I've never really known the 'Dark Art' of OpenGL. That is, how it actually does it's stuff. So I decided that rather than copying and pasting the code examples from NeHe I rewrote all the code myself. At this point I'd just like to point out I'm using Visual Basic. Anyway, everything was going really well. Wasn't getting any error messages, then I finish writing all the basic initialise code and run the project. The window appears, the framerate counts properly, and no messages appear. However, the screen is filled with garbage. http://www.essersoft.com/images/oglProblem.JPG This is an idea of what happens. The strange thing is if I maximise the window, content is shown within the window that is from another older OpenGL program that I ran earlier. Obviously the data being displayed in the window is data still residing on the Graphics Card. Has anyone had a similar problem before? Could anyone point me in the right direction of where the problem might be eminating? Cheers, and thanks very much [Edit: Shortly after posting this I had a play around with the Pixel Format, thinking that's where the problem is most likely to be, anyway. The window now displays as black as it should, when windowed, however if I maximise the window it all goes wrong as it was doing so before.]

Share this post


Link to post
Share on other sites
Advertisement
Have you try set glClearColor and glClear to clear the color buffer. I don't use visual basic so function name might be different.

Share this post


Link to post
Share on other sites
lol, thanks that did it.

I had previously had this:

glClear GL_COLOR_BUFFER_BIT and GL_DEPTH_BUFFER_BIT

Which didn't through up any errors, but a simple change to:

glClear GL_COLOR_BUFFER_BIT
glClear GL_DEPTH_BUFFER_BIT

has sorted it.

Cheers, thanks very much for your help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!