Page 1 of 1

FrameDraw help...

Posted: Tue May 01, 2012 5:48 pm
by Rikku2000
Hey guys i will add an frameDraw to my quake here my code bit:

Code: Select all

void Draw_FramePic (int n, int x, int y, int w, int h, int posx, int posy) {
	float coordx = (float)posx, coordy = (float)posy;

	glBindTexture (GL_TEXTURE_2D, texture[n]);
	glBegin (GL_QUADS);
		glTexCoord2f (coordx, coordy);
		glVertex2f (x + posx, y + posy);
		glTexCoord2f (0.5, coordy);
		glVertex2f (x + w + posx, y + posy);
		glTexCoord2f (0.5, 0.5);
		glVertex2f (x + w + posx, y + h + posy);
		glTexCoord2f (coordx, 0.5);
		glVertex2f (x, y + h + posy);
	glEnd();
}
Image

Thats the image i will use as texture where to take each frame like:
# # #
# # #
# # #