SDL-第一课“hello world”

来源:互联网 发布:c 数组的长度 编辑:程序博客网 时间:2024/06/09 19:52

参照一个著名的教程,写着玩玩吧,希望整几个游戏出来

http://www.lazyfoo.net/SDL_tutorials/lesson01/index2.php


#include "SDL.h" int main( int argc, char* args[] ) {  SDL_Surface* hello = NULL;  SDL_Surface* screen = NULL;//Start SDL SDL_Init( SDL_INIT_EVERYTHING ); screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );hello = SDL_LoadBMP( "hello.bmp" );//Apply image to screen SDL_BlitSurface( hello, NULL, screen, NULL ); //Update Screen SDL_Flip( screen ); //Pause SDL_Delay( 2000 );//Free the loaded image SDL_FreeSurface( hello );//Quit SDL SDL_Quit(); return 0; }



原创粉丝点击