不废话,就WinMain主体:
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Event e;
bool q = 0;
int sdl = SDL_Init(SDL_INIT_EVERYTHING);
if(0 <= sdl){
window = SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN);
if(0 != window){
renderer = SDL_CreateRenderer(window, -1, 0);
}
SDL_SetRenderDrawColor(renderer, 0, 255, 255, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
while(0 == q){
while (0 != SDL_PollEvent(&e)){
if(e.type == SDL_QUIT){
q = TRUE;
}
}
}
}
SDL_Quit();