Using textures

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

dont double post, just bump the first one
bump = post a reply every so often, btw, i answered the first post

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.