Question : opengl sdl resize window
Answered by : glamorous-goosander-3q3pz92h3pk0
void ResizeWindow()
{ screen_width = event.resize.w; screen_height = event.resize.h; SDL_SetVideoMode(screen_width, screen_height, bpp, SDL_OPENGL | SDL_RESIZABLE | SDL_DOUBLEBUF); glViewport(0, 0, screen_width, screen_height); glMatrixMode(GL_PROJECTION); glOrtho(0, screen_width, 0, screen_height, -1, 1); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity();
}
Source : https://stackoverflow.com/questions/9138559/handling-window-resizing-using-opengl-and-sdl/9139380 | Last Update : Tue, 10 Aug 21