lesson 6 - no picture shows on the box ?

Started by
2 comments, last by lc_overlord 18 years, 1 month ago
If someone could take a look at the source on the following url and could tell me why it doenst shows the picture (compiled with visual studio 2005) i appreciate it. The picture is in the map Data (which is in the same map as the compiled executable). source files:
http://www.tbns.net/paul100/glwindow.zip
Advertisement
You need to enable texturing before any calls to textured objects using glEnable(GL_TEXTURE_2D), if you then want to draw some untextured objects then call glDisable(GL_TEXTURE_2D) and draw them. Remember that OpenGL is a state machine and anything that you set will stay the same until you implicitly change it.

So in your main.cpp where you say
glBindTexture(GL_TEXTURE_2D, window.texture[0]);
you should be using
glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D, window.texture[0]);
instead.

Hope that helps.
--
Cheers,
Darren Clark
Thanks for your reply, that worked somehow someway. Also, what do you recommend learning first, OpenGL or DirectX ?
I would recomend learning openGL first.
Simply because when you know it, you will know the true nature of realtime 3d graphics.
I know way to may persons that works professionally on DX and doesn't know how realtime 3d graphics work (ever played "Traitors gate 2:cypher").
I beleve this is because DX encapsulates a lot of the things that openGL does not, thus sheilding the user from a valubale learning experience.

This topic is closed to new replies.

Advertisement