opengl textures
ok i got a cube which shows the triangle edges, but thats ok if i texture it. Anyway i want to texture litte patterns on it. But right now i''m just getting a blend of them(my bitmap has 3 colors and when i texture the cube the colors blend together and texture the cube in one solid color)
Heres the pieces of code you may need to help:
// globals
BITMAPINFO *TexInfo; /* Texture bitmap information */
GLubyte *TexBits; /* Texture bitmap pixel bits */
// in the main
glutDisplayFunc(Draw_Scene);
Init();
TexBits = LoadDIBitmap("texT.bmp", &TexInfo);
glutMainLoop();
// in the window resize()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TexInfo->bmiHeader.biWidth,
TexInfo->bmiHeader.biHeight, 0, GL_BGR_EXT,
GL_UNSIGNED_BYTE, TexBits);
glEnable(GL_TEXTURE_2D);
Please help thanks
ECKILLER
ECKILLER
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement