Пример #1
0
void rysujTulow(GLuint textureGora, GLuint textureDol, int frame_no)
{
	
	// renderuj gore plaszczki
	glPushMatrix();
	glEnable(GL_CULL_FACE);
	glFrontFace(GL_CCW);
	glCullFace(GL_FRONT);
	glScalef(1, 0.3, 1);
	glRotatef(-90, 1, 0, 0);
	drawHalf(radius, 10,100, textureGora, frame_no);
	glPopMatrix();

	
	// renderuj dol plaszczki
	glPushMatrix();
	glEnable(GL_CULL_FACE);
	glFrontFace(GL_CCW);
	glCullFace(GL_BACK);
	glScalef(1, 0.3, 1);
	glRotatef(-90, 1, 0, 0);
	drawHalf(radius, 10, 100, textureDol, frame_no);
	glPopMatrix();
	glDisable(GL_CULL_FACE);

}
Пример #2
0
void initializeGame(ball *aBall, paddle *p1, paddle *p2){
  uint32_t blue = 0x000099; //black = 0x0;
  uint32_t gold = 0xffff00; //white = 0xffffff;
  
  aBall->x = START_BALL_X;
  aBall->y = START_BALL_Y;
  aBall->vX = -VEL_X;
  aBall->vY = 0;

  p1->x = START_PAD_1_X;
  p1->y = START_PAD_1_Y;
  p1->direction = IDLE;

  p2->x = START_PAD_2_X;
  p2->y = START_PAD_2_Y;
  p2->direction = IDLE;

  if ( (p1->score == 4) || (p2->score == 4) ){
    p1->score = 0;
    p2->score = 0;
  }

  fill(blue);
  drawHalf(gold);
  drawScoreboard(p1,p2);
  drawPaddle(gold,START_PAD_1_Y,START_PAD_1_X);
  drawPaddle(gold,START_PAD_2_Y,START_PAD_2_X);
  drawBall(gold,aBall);
  startGP();
}
Пример #3
0
void updateFrame(uint32_t pY1, uint32_t pY2, uint32_t ballX, uint32_t ballY, ball *aBall, paddle *p1, paddle *p2){
  uint32_t gold = 0xffff00; //white = 0xffffff;
  uint32_t blue = 0x000099; //black = 0x0;
  
  drawHalf(gold);
  drawScoreboard(p1,p2);
  drawPaddle(gold,pY1,START_PAD_1_X);
  drawPaddle(gold,pY2,START_PAD_2_X);
  drawBall(gold,aBall);
  startGP();
}