FrameDraw help...

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
Post Reply
Rikku2000
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany
Contact:

FrameDraw help...

Post 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:
# # #
# # #
# # #
I am sorry for my English...
Post Reply