This topic is now archived and is closed to further replies.


rendering context and textures, newbie question

Recommended Posts

i modified tutorial 6 (texture mapping) to use 3 textures, that i set up in a global array as such: const int NumTex = 3; GLuint texture[NumTex]; char *TexName[NumTex] = {"image1.bmp", "image2.bmp", "image3.bmp"}; then i wrapped the TextureImage=LoadBMP(TexName[i]) section of code in a for loop, replacing all the hard-coded 0''s with i (the for loop variable), and did the same with the free(TextureImage[i] part right after that. it all works, but when i try to quit or change full-screen/windowed, i get an error trying to release the rendering context. how are textures and rendering contexts related? do i need to specifially unload them before killing a rendering context? is it sort of like directx, where you have to reload them when the screen size changes or if gdi gets in the way? i''m not sure why a hardcoded single texture works fine, but my 3 textures would cause this error. any suggestions would be appreciated. thanks!

Share this post

Link to post
Share on other sites