//TEST_WINDOW source code.c
#include "stdio.h"
#include "stdlib.h"
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
int main(void)
{
Uint16 *link;
SDL_Surface *screen;
SDL_Surface *image;
/*初始化 SDL*/
if(SDL_Init(SDL_INIT_VIDEO)!=0)
return 0;
atexit(SDL_Quit);
/*400*320 可改 */
screen=SDL_SetVideoMode(400, 320, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
if(screen == NULL)
return 0;
/*WINDOW_NAME*/
SDL_WM_SetCaption ("TEST_WINDOW", NULL);
SDL_UpdateRect(screen, 0, 0, 0, 0);
/*5秒後 close*/
SDL_Delay(5000);
}
這些 code 是從 "Programming Linux Games" 這本看來的
有些是去 google的~
看看吧~
沒有留言:
張貼留言