Jump to content
  • Advertisement

Archived

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

255

need help with textures

This topic is 5739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!