Jump to content
  • Advertisement
Sign in to follow this  
Auraomega

Strange problem...?

This topic is 3621 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 have a rather strange problem that I've spent the past 3 odd hours trying to work out, its probably something simple but I can't think of how to search for the error... anyway... I'm trying to get an image on the screen, currently its a 2d square although once I get this working it'll transform into a cube for further work. When I draw the image, I have to use glTranslatef(0, 0, -2.0f); to get the image to show, if the translate is set to anything other than -2 on the Z axis the image will not show at all, and I only get the blank black screen. I havn't done any work in OGL for a while but I'm guessing my error is in initialising OGL, so my function is here: int initGL() { glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glShadeModel(GL_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); if(glGetError() != GL_NO_ERROR) { return false; } return true; } I'm also using this as part of the SDL library and not on its own, incase that makes any significant difference? Thanks for any help. -Aura P.S. is there any tags here?

Share this post


Link to post
Share on other sites
Advertisement
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!