you don't need the glShadeModel call, it does nothing.
you probably don't want the glClearColor call, the default is more useful than what you're setting it to
you don't need the glClearDepth call, it does nothing
you don't need the glHint(GL_PERSPECTIVE_CORRECTION_HINT, ...) call, it does nothing

glEnable(GL_DEPTH_TEST) turns on depth testing, so you can draw 3d objects in any order and they will obscure each other correctly based on distance from the camera
glDepthTest(GL_LEQUAL) says that pixels closer to the camera (Less) or an equal distance to the camera should be in front of existing pixels.

Its pretty much just telling OpenGL that you are enabling textures and you will be using 2d textures, not 3d textures. 2d textures is what you will want to use most the time especially when first learning OpenGL.

OneSadCookie Wrote:you don't need the glShadeModel call, it does nothing.

To be pedantic, "it does nothing" isn't accurate. It sets the shading model to SMOOTH, just like it says. It so happens that SMOOTH is the default value, so the first time you do this, there is no effect.

But, maybe your app later changes the shading model to FLAT. Then if you call initGL again to re-initialize the state, this does something.

Coin Wrote:and this enables texture stuff?
glEnable( GL_TEXTURE_2D );

This enables application of the currently bound 2D texture during rasterization. There is a good deal of other state that affects this, so you really need to read the manual to understand what's going on.

For using the Blue Book, there are a couple of things that work well in addition to having a paper copy or pdf. Simply googling for the function, i.e. "glShadeModel" will turn up some reference pages. Alternatively, you could go into the Terminal application and type "man glShadeModel". Or, you could choose the menu item "Open man page..." from the Help menu of Xcode, and type in glShadeModel.

Thats a good reference but you really need to read something about fitting it all together. Try NeHe's guides if you cant afford the redbook, but if you have the money i REALLY recommend reading the redbook, its a great source of knowledge.