PDA

View Full Version : Using textures



JoshWilczek
11-16-2005, 07:29 AM
I am using the following code to use a texture on a quad.

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);

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glBegin(GL_QUADS);
//glColor3f(1.0,1.0,1.0);

glTexCoord2f(0.0,0.0);
glVertex2f(0.0,0.0);

glTexCoord2f(0.0,1.0);
glVertex2f(0.0, 1.0);

glTexCoord2f(1.0,1.0);
glVertex2f(1.0, 1.0);

glTexCoord2f(1.0,0.0);
glVertex2f(1.0, 0.0);

glEnd();
SwapBuffers(hdc);

Gizmo of Dewitt
11-17-2005, 02:42 AM
dont double post, just bump the first one
bump = post a reply every so often, btw, i answered the first post

JoshWilczek
11-17-2005, 05:43 AM
Yeah, sorry about that, it was an accident. I was going to indent so I used 'tab' which moved me to the "Add Post" button. When I hit "enter" it started to add the reply, I wasn't able to stop it.