After making a few changes in my application, my textures are no longer showing. So far I've checked the following:
Any usual suspects?
in display() function : GLuint texture; texture = LoadTexture("bubble. png"); glBindTexture(GL_TEXTURE_2D, texture);
A texture is an OpenGL Object that contains one or more images that all have the same image format. A texture can be used in two ways: it can be the source of a texture access from a Shader, or it can be used as a render target.
1.0 Introduction. Texture mapping is a process of stretching a texture onto a 3D object; the applied texture will follow the 3D object as it transforms. Texture mapping is fun and beneficial but it can be challenging for beginners. Texture can also be distorted for a visual effect.
Texture coordinates specify the point in the texture image that will correspond to the vertex you are specifying them for. Think of a rectangular rubber sheet with your texture image printed on it, where the length of each side is normalized to the range 0-1.
You may want to check the following:
glEnable(GL_TEXTURE_2D);
presence
glBindTexture(GL_TEXTURE_2D,
texture[i]);
and
glBindTexture(GL_TEXTURE_2D, 0);
when you don't need texture anymore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With