Forum

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.

Moderator: InsideQC Admins

FrameDraw help...

Postby Rikku2000 » Tue May 01, 2012 5:48 pm

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...
User avatar
Rikku2000
 
Posts: 49
Joined: Wed Oct 20, 2010 6:33 pm
Location: Germany

Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest