I'm writing a game that has to take into account fullscreen and windowed modes. I'm basically using a fullscreen borderless window for the fullscreen mode. What I want to do for fullscreen mode is to get the user's desktop resolution, and create a viewport that has the same horizontal resolution as the user's desktop, and still maintain the aspect ratio. And to do this, I'm thinking of adding black borders to both sides of the screen which aren't filled. What I know is I need to use glViewport to set a viewport and glScissor to clip the outside of the viewport. But how to I set this up so that the viewport is centered on the screen? And if I do this, do I have to specify the coordinates in my game according to the offset created by the black bars on the sides? Or will OpenGL automatically map my coordinates inside the viewport's rectangle?
Help is very much appreciated.
Thank you very much.






