Пример #1
0
void	Menu::cup_ia_(gdl::Image tmp)
{
  tmp.bind();
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glPushMatrix();
  glTranslatef(0,-700,0);
  glBegin(GL_QUADS);
  glTexCoord2d(0, 1); glVertex3f(-500, -500, 0);
  glTexCoord2d(0, 0); glVertex3f(-500, 500, 0);
  glTexCoord2d(1, 0); glVertex3f(500, 500, 0);
  glTexCoord2d(1, 1); glVertex3f(500, -500, 0);
  glEnd();
  glDisable(GL_BLEND);
  glPopMatrix();    
}
Пример #2
0
void	Bonus::draw(gdl::Image& texture)
{
  texture.bind();
  glPushMatrix();
  glTranslatef(this->position.x, this->position.y, 0.0f);
  glRotatef(turn, 0.0f, 0.0f, 1.0f);
  glBegin(GL_QUADS);
  turn += 0.2;
  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));

  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));

  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));

  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));

  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));

  glTexCoord2f(0.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(0.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 1.0f);
  glVertex3f(((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));
  glTexCoord2f(1.0f, 0.0f);
  glVertex3f(-((BLOCKSIZE - 5) / 3), ((BLOCKSIZE - 5) / 3), -((BLOCKSIZE - 5) / 3));

  glEnd();
  glPopMatrix();
}