示例#1
0
文件: SDL_draw.c 项目: 2bt/tetrisVI
static
void Draw_Init(void)
{
  SDL_Surface *screen = SDL_GetVideoSurface();
  if (!screen) {
    fprintf(stderr,"SDL_draw: SDL_Draw_Init ERROR!!."
                  " Video Surface not found\n");
    exit(-2);
  }

  switch(screen->format->BytesPerPixel) {
    case 1:
      SDL_DRAW_FUNCTIONS_BPP(1);
    break;

    case 2:
      SDL_DRAW_FUNCTIONS_BPP(2);
    break;

    case 3:
      SDL_DRAW_FUNCTIONS_BPP(3);
    break;

    case 4:
      SDL_DRAW_FUNCTIONS_BPP(4);
    break;
  }/*switch*/

}/*Draw_Init*/
示例#2
0
static
void Draw_Init(void)
{
  //SDL_Surface *screen = SDL_GetVideoSurface();
  //if (!screen) {
  //  fprintf(stderr,"SDL_draw: SDL_Draw_Init ERROR!!."
  //                " Video Surface not found\n");
  //  exit(-2);
  //}
  //
  //switch(screen->format->BytesPerPixel) {
  //  case 1:
  //    SDL_DRAW_FUNCTIONS_BPP(1);
  //  break;
  //
  //  case 2:
  //    SDL_DRAW_FUNCTIONS_BPP(2);
  //  break;
  //
  //  case 3:
  //    SDL_DRAW_FUNCTIONS_BPP(3);
  //  break;
  //
  //  case 4:
      SDL_DRAW_FUNCTIONS_BPP(4);
  //  break;
  //}/*switch*/

}/*Draw_Init*/