Sign in to follow this  

Strange problem...?

This topic is 3342 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 [CODE] tags here?

Share this post


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