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();
}
Thats the image i will use as texture where to take each frame like:
# # #
# # #
# # #