1 #ifdef __cplusplus 2 #include <cstdlib> 3 #else 4 #include <stdlib.h> 5 #endif 6 7 #include <SDL/SDL.h> 8 9 int main( int argc, char* args[] ) 10 { 11 SDL_Surface* hello=NULL; 12 SDL_Surface* screen=NULL; 13 14 SDL_Init(SDL_INIT_EVERYTHING); 15 16 screen= SDL_SetVideoMode(640,480,32,SDL_SWSURFACE); 17 18 hello=SDL_LoadBMP("hello.bmp"); 19 20 SDL_BlitSurface(hello,NULL,screen,NULL); 21 22 SDL_Flip(screen); 23 24 SDL_Delay(9000); 25 26 SDL_FreeSurface(hello); 27 28 SDL_Quit(); 29 30 return 0; 31 }
其中有个hello.bmp图片,我上传不了-大于10M,大家可以自己画一个640*480大小的图片。