Advertisement

opengl textures

Started by February 29, 2000 10:24 PM
0 comments, last by ECKILLER 24 years, 6 months ago
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
Did you remember to call 'glTexCoord' to define the texture coordinates of each vertex of the cube?


*Growl*

Edited by - Intangir on 2/29/00 11:01:47 PM
*Growl*

This topic is closed to new replies.

Advertisement