1 Introducción a SDL y PyGAME 6 7 8 9 10
# define ALTO
400
int main ( void ) { SDL_Surface * pantalla = NULL ; SDL_Surface * imagen = NULL ;
11
if ( SDL_Init ( SDL_INIT_VIDEO ) < 0) { printf ( " Error al iniciar SDL con el subsitemas de video : %s \ n " , SDL_GetError () ) ; exit (1) ; } atexit ( SDL_Quit ) ;
12 13 14 15 16 17
/* Modos disponibles : * SDL_SWSURFACE usa la memoria de sistema * SDL_HWSURFACE usa la memoria de video * SDL_DOUBLEBUF activa doble buffer en la memoria de video * SDL_FULLSCREEN * SDL_OPENGL * SDL_RESIZABLE * SDL_NOFRAME * */
18 19 20 21 22 23 24 25 26 27
// Ventana normal de tamaño fijo : pantalla = SDL_SetVideoMode ( ANCHO , ALTO , 0 ,
28 29 30
// Ventana normal de tamaño variable : // pantalla = SDL_SetVideoMode ( ANCHO , ALTO , 0 , SDL_RESIZABLE ) ;
31 32 33
SDL_SWSURFACE ) ; SDL_SWSURFACE |
// Ventana normal de tamaño fijo maximizada ( tamaño igual a pantalla completa ) // pantalla = SDL_SetVideoMode ( 0, 0 , 0 , SDL_SWSURFACE ) ;
34 35 36 37 38 39 40 41 42 43 44 45
// Ventana sin borde de tamaño fijo // pantalla = SDL_SetVideoMode ( ANCHO , ALTO , 0 , SDL_NOFRAME ) ;
SDL_SWSURFACE |
// Pantalla completa con resolución fija // pantalla = SDL_SetVideoMode ( ANCHO , ALTO , 0 , SDL_FULLSCREEN ) ;
SDL_SWSURFACE |
// Pantalla completa con resolución máxima // pantalla = SDL_SetVideoMode ( 0, 0, 0, SDL_FULLSCREEN ) ;
SDL_SWSURFACE |
if ( pantalla == NULL ) { printf ( " Error al inicializar el modo de video : ' %s '\ n " , SDL_GetError () ) ; exit (1) ;
46 47 48
30