import SDL, SDL_image;
ubyte[][] pictures;
void main()
{
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
throw new Error("Couldn't initialize SDL.");
}
SDL_Surface* screen = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE);
if(screen == null) {
throw new Error("Couldn't set 640x480 video mode");
}
pictures ~= cast(ubyte[])import("m59cl.png");
SDL_Surface* image = IMG_Load_RW(SDL_RWFromMem(pictures[0].ptr, pictures[0].length * ubyte.sizeof), 1);
SDL_BlitSurface(image, cast(SDL_Rect*)0, screen, cast(SDL_Rect*)0);
bool done = false;
SDL_Event e;
while(!done) {
while(SDL_PollEvent(&e)) {
done = (e.type == SDL_QUIT);
}
SDL_Delay(1000/30);
}
}まだ試していない仮のコードです。実行できるかわかりません。
0 件のコメント:
コメントを投稿