コード例 #1
0
ファイル: Goban2D.cpp プロジェクト: asuz/Gobaum
void Goban2D::draw_board()
{   
    glDisable(GL_LIGHTING);
    glBindTexture(GL_TEXTURE_2D, textures.board_tex);
    glPolygonMode(GL_FRONT, GL_FILL);

    glColor3ub(200, 160, 100);

    glBegin(GL_QUADS);
        glVertex2f(0.0f, 0.0f);
        glVertex2f(dim.BOARD_WIDTH, 0.0f);
        glVertex2f(dim.BOARD_WIDTH, dim.BOARD_LENGTH);
        glVertex2f(0.0f, dim.BOARD_LENGTH);
    glEnd();

    textures.enable_textures();
    
    glColor3f(1.0f, 1.0f, 1.0f);
    //glColor3f(0.0f, 0.0f, 0.0f);
    glBegin(GL_QUADS);
        glTexCoord2d(0, 0); glVertex3f(0.0f, 0.0f, -10.0f);
        glTexCoord2d(1, 0); glVertex3f(dim.BOARD_WIDTH, 0.0f, -10.0f);
        glTexCoord2d(1, 1); glVertex3f(dim.BOARD_WIDTH, dim.BOARD_LENGTH, -10.0f);
        glTexCoord2d(0, 1); glVertex3f(0.0f, dim.BOARD_LENGTH, -10.0f);
    glEnd();

    textures.disable_textures();

    draw_stones();
}
コード例 #2
0
ファイル: refresh.c プロジェクト: Nwazette/Zappy
void		refresh_screen(t_visu *v)
{
  int		x;
  int		y;

  draw_map(v);
  foreach_arg_list(v->player, draw_player, v);
  x = 0;
  while (x < v->width)
    {
      y = 0;
      while (y < v->height)
	{
	  draw_stones(v, x, y);
	  y++;
	}
      x++;
    }
}