Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have made a simple application that creates a window with an OpenGL 4.2 context and takes user input.

I have implemented making the window go fullscreen with XRandR and can change the display resolution.

I would like to change this so that I don't have to set the displays resolution and only the window/contexts so that it renders at a lower resolution but the display stays at its default.

How could I implement this? Which extensions provide this or can I do this with XRandR and just manipulating the window rather than the root window(dektop)?


share|improve this question
You're probably going to have to poll X11 for the monitor resolution and make a borderless window at that resolution. To scale without changing the internal resolution you're going to have to draw the application itself to an offscreen FBO. Then display what you rendered to a texture on a fullscreen quad. Just make sure that you normalize your window coordinates on your input or use a scaling factor. – PeterT Jul 26 '13 at 18:57
Consider just using SDL. X11 is not long for the world anyway if the Wayland/Mir guys get their way. – Sean Middleditch Jul 26 '13 at 20:54
I'm using my own toolkit, I'll update it to mir when it becomes a viable option. There will always be backward compatibility anyway; what do you think SDL uses for its back-end? Using SDL doesn't fix my issue anyway. – CoffeeandCode Jul 26 '13 at 21:01
@PeterT I'm using atoms to send a fullscreen event to the window manager. A borderless window set to screen size is not a nice hack. – CoffeeandCode Jul 26 '13 at 21:07
@CoffeeandCode well you can use regular full screen as well, doesn't change the full screen quad FBO technique whatsoever. I just find borderless full screen the most pleasant to the user if the app is not too demanding. As regular full screen applications have differing behavior from regular windows for no reason discernable to the user. – PeterT Jul 26 '13 at 21:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.