コード例 #1
0
ファイル: menu.c プロジェクト: d0nn13/MASHUG
static void	display_menu()
{
  SDL_Rect	rect;
  Uint8		i;

  rect = rect_factory(217, 142, 420, 119);
  renderer_clear(NULL);
  draw_sprite(get_sprite(get_spacesprites(), TITLE_SPR), &rect);
  for (i = 0; i < NB_MEN; ++i)
    draw_text(entries[i].text, &entries[i].orig, get_common_font(ATARI24_FNT),
	      item == i ? &entries[i].sel_color : &entries[i].uns_color);
  draw_sprite(get_sprite(get_spacesprites(), CABINET_SPR), NULL);
}
コード例 #2
0
ファイル: api_masks.c プロジェクト: CSRedRat/mesa-1
void vegaClear(VGint x, VGint y,
               VGint width, VGint height)
{
   struct vg_context *ctx = vg_current_context();
   struct st_framebuffer *stfb = ctx->draw_buffer;

   if (width <= 0 || height <= 0) {
      vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
      return;
   }

   vg_validate_state(ctx);
#if 0
   debug_printf("Clear [%d, %d, %d, %d] with [%f, %f, %f, %f]\n",
                x, y, width, height,
                ctx->state.vg.clear_color[0],
                ctx->state.vg.clear_color[1],
                ctx->state.vg.clear_color[2],
                ctx->state.vg.clear_color[3]);
#endif

   /* check for a whole surface clear */
   if (!ctx->state.vg.scissoring &&
       (x == 0 && y == 0 && width == stfb->width && height == stfb->height)) {
      union pipe_color_union clear_color;
      clear_color.f[0] = ctx->state.vg.clear_color[0];
      clear_color.f[1] = ctx->state.vg.clear_color[1];
      clear_color.f[2] = ctx->state.vg.clear_color[2];
      clear_color.f[3] = ctx->state.vg.clear_color[3];
      ctx->pipe->clear(ctx->pipe, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
                       &clear_color, 1., 0);
   } else if (renderer_clear_begin(ctx->renderer)) {
      /* XXX verify coord round-off */
      renderer_clear(ctx->renderer, x, y, width, height, ctx->state.vg.clear_color);
      renderer_clear_end(ctx->renderer);
   }
}