Sign in to follow this  
Auraomega

Strange problem...?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this