I am new to openGL and wondering how to redimension a window in opengl without resizing objects in it (for example a quad drawn in opengl). I currently have a simple C++ function such as :
void ProjectionOrtho::redimensionWindow(int width, int height)
{
glViewport(0, 0, width, height);
}
Here is a simple image to illustrate the problem:
Note : I have tried glViewPort(0,0, 665, 365) which are the initial height and weight of myBlueQuad, but that is not what i want since i want to be able to see the rest of the 3d universe to the right (for instance if i translate the quad to the right, i want to be able to see it)
Based on this thread: the difference between glOrtho and glViewPort in openGL I am pretty sure I need to use glOrtho but not sure how.. ive tried the following as @tkausl suggested:
glViewport(0, 0, width, height);
glOrtho(0, width, height, 0, -1.0, 1.0); //width and height of window panel
But unfortunately, i get the same result as before. It seems that glOrtho is never applied, i've also tried calling glLoadIdentity() before my glOrtho call, it has no effect on the end result.