I've recently done the jump from SDL to openGL. And I'm wondering if my old ways of doing things are not the simplest anymore.
What i want to do, is finding a way to implement:
*Zooming
*Ability to support splitscreen
The way i've solved this problem earlier, is by creating a Camera class with the following interface:
void setCenter(float centerx, float centery);
int getScreenX(float worldx);
int getScreenY(float worldy);
int scale(float v); //convert distance in world space to length on screen
void zoom(float delta);
and then passed a pointer to the camera along to the drawing functions, like this:
gameObject->draw(camera);
This works fine, but I was thinking that there might be a simpler solution involving some opengl functions.
Maybe glViewport or something (but wouldn't that move the gui too?).
How do you guys usually solve this problem?