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


need help with textures

Recommended Posts

255    368
I''m trying to load textures from an array of GLuints in delphi. Loading the texture data: {Load from file to Data ... } glGenTextures(1, @TexName); glBindTexture(GL_TEXTURE_2D, TexName); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); //Is this needed? glTexImage2D( GL_TEXTURE_2D, MipMapLevel, //0 GL_RGBA, Width, Height, 0, GL_RGBA, GL_UNSIGNED_INT, Data ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); Where each element in the dynamic array Data is of type: TTexRGBA = packed record R, G, B, A: GLuint; end; The stuff that is enabled/disabled: glEnable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glEnable(GL_TEXTURE_2D); glEnable(GL_ALPHA_TEST); glEnable(GL_POLYGON_SMOOTH); glDisable(GL_LIGHTING); When I try to render it onto a quad it shows only white (which is the color of the quad) instead of the texture. The texture coordinates should be correct since I copied them from the nehe tutorial. glBindTexture is also called before rendering. What is wrong? Thanks

Share this post

Link to post
Share on other sites