SDL2学习笔记-1
int main() 一定要写为 int main(int argc,char* argv[]) 的形式。
cSDL_window* window SDL_Surface* surface SDL_Init(SDL_INIT_VIDEO) //如果出错返回-1 SDL_GetError() window = SDL_CreateWindow("title",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN) surface = SDL_GetWindowSurface(window) SDL_Event e; //防止窗口关闭 bool quit = false; while (quit == false) { while (SDL_PollEvent(&e)) { if (e.type == SDL_QUIT) { quit = true; } } }