演示程序
时间:2006-05-26 来源:whtonline
int init_x (int X, int Y,
int W, int H, int bpp,
const char *Name) {
int i;
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf ( stderr , "Erreur :\n" );
fprintf ( stderr , " Impossible de se connecter au Display\n");
exit (1);
}
screen = SDL_SetVideoMode(W, H, bpp, SDL_SWSURFACE|SDL_HWPALETTE);
if ( screen == NULL )
{
fprintf ( stderr , "Erreur :\n" );
fprintf ( stderr , " Impossible de se connecter au Display\n");
exit (1);
}
SDL_WM_SetCaption ( Name, Name );
for ( i=SDL_NOEVENT; iformat->BitsPerPixel;
width = screen->w;
height = screen->h;
buffer = (unsigned char *)screen->pixels;
return (depth);
}
int W, int H, int bpp,
const char *Name) {
int i;
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf ( stderr , "Erreur :\n" );
fprintf ( stderr , " Impossible de se connecter au Display\n");
exit (1);
}
screen = SDL_SetVideoMode(W, H, bpp, SDL_SWSURFACE|SDL_HWPALETTE);
if ( screen == NULL )
{
fprintf ( stderr , "Erreur :\n" );
fprintf ( stderr , " Impossible de se connecter au Display\n");
exit (1);
}
SDL_WM_SetCaption ( Name, Name );
for ( i=SDL_NOEVENT; iformat->BitsPerPixel;
width = screen->w;
height = screen->h;
buffer = (unsigned char *)screen->pixels;
return (depth);
}
相关阅读 更多 +