Archived

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

siddim

loading bmp

Recommended Posts

hi, been working with the tutorial 6 of nehe(texture mapping), I change it a little so i can pass the texture name as a parameter. it work fine but only for one texture, when i load the second one nothing display, not even the first one anymore. did i miss something? i have been looking but i can''t find the problem. how do i use glGenTextures(1,texture[0]); ? does it have to be call only once in the constructor of my textureManager class like: glGenTextures(TableSize, texture[TableSize]); ? thanks. siddim.

Share this post


Link to post
Share on other sites
glGenTextures() takes in the number of textures to generate and an array of uint''s:


  
GLuint Textures[5];

glGenTextures(5, Textures);


If you want to generate one texture only, you need to reference it properly:


  
GLuint Textures[5];

glGenTextures(1, &Textures[0]);


Hope this helps,
Crispy

Share this post


Link to post
Share on other sites