So basically my question is im making a 2D game with openGL and SDL.
So what im trying to do is resize the game and have the openGL quad scale to the size my window becomes.
void CApp::OnResize(int w, int h){
textureWidth = (float)w;
textureHeight = (float)h;
SDLWindow::SetGLWindow(w, h, Surf_Display);
}
bool SDLWindow::SetGLWindow(int width, int height, SDL_Surface * Surf_Display)
{
if((Surf_Display = SDL_SetVideoMode(width, height, 32, SDL_HWSURFACE | SDL_OPENGL | SDL_RESIZABLE)) == NULL) {
return false;
}
glClearColor(0, 0, 0, 0);
glClearDepth(1.0f);
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, height, 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_TEXTURE_2D);
glLoadIdentity();
return true;
}
So this works just fine. However while resizing the window, the image isnt scaling. It only scales after i release the mouse button. I am curious if i can scale the image at the same time?