|
楼主 |
发表于 2005-10-26 15:54:49
|
显示全部楼层
来段短的,问题就在SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);函数上
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL/SDL.h"
int main(void)
{
SDL_Surface *screen;
/* Initialize the SDL library */
if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr,
"Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}
/* Clean up on exit */
atexit(SDL_Quit);
screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
if ( screen == NULL ) {
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
SDL_GetError());
exit(1);
}
} |
|