The following code (Nehe: lesson 06):
glTexImage2D(GL_TEXTURE_2D, 0, 3, sizeX, sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
is used to define a texture so we could later on display it on screen using OpenGL.
How can we make sure that the graphic card has enough memory to contain a texture ?. If it doesn’t have space for it, any OpenGL operations like zoom,rotate can take Host resources instead of Graphic card resources.
There’s a Texture Proxy mechanism which can tell you whether the texture will fit in memory or not at the time you ask it.
See glTexImage2D in the OpenGL Reference Manual AKA Blue Book for details.
Will you people ever stop to recommend that junk GLU rouitnes???It’s not so hard and it’s much faster to write your own texture scaler.And now for the generation.OpenGL will kindly inform you if there was a problem with the generation of a texture id.There usually won’t be any problems with that(BUT CHECK EVERY TIME!!!).The real problem might come from the uploading of the texture image 'cause this is what takes the actuall AGP mem.I suggest to check for errors but even if you don’t the programm won’t crash and the texture will be simply white.If you ever consider to use 3D textures keep in mind that a simple grayscale texture with sizes 256x256 will get almost all of the AGP memory and will most likely crash the program soon or later.
GLU is slow and its texture manipulation algorithms are very basic (as in, not high quality)
GLU is standard. It is more simple to use GLU at first time and switch to smth else later.