# Fullscreen window position / display selection

**URL:** <https://discourse.libsdl.org/t/fullscreen-window-position-display-selection/20846>\
**Category:** SDL Development\
**Created:** [July 18, 2014, 3:50pm UTC](https://discourse.libsdl.org/t/fullscreen-window-position-display-selection/20846 "2014-07-18T15:50:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TUUG86](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@TUUG86](https://discourse.libsdl.org/u/TUUG86)\
**Post date:** [July 18, 2014, 3:50pm UTC](https://discourse.libsdl.org/t/fullscreen-window-position-display-selection/20846/1 "2014-07-18T15:50:57Z")

</div>

I am using SDL\_WINDOW\_FULLSCREEN\_DESKTOP to fullscreen my application and maintain the desktop resolution. The problem is, the window is stuck at the left-lower corner of the screen, no matter what position/enum I set in SDL\_CreateWindow. I guess SDL has literally given my program the full screen to draw over, so everything I draw at (0,0) get drawn at the display (0,0) coords. I’m using OpenGL calls directly, so this is quite bad.

Second, I found no direct method to set the display in the API, although it is straightforward to get information about each display and their modes. Unless I missed something, the only working method I found is to place the window at the absolute coordinates of the other displays, but this is unfeasible in a general situation and even worse in fullscreen.

---

<div class="post-metadata">

**Author:** ![slime](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/slime/32/3845_2.png) [@slime](https://discourse.libsdl.org/u/slime)\
**Post date:** [August 14, 2014, 7:28am UTC](https://discourse.libsdl.org/t/fullscreen-window-position-display-selection/20846/2 "2014-08-14T07:28:01Z")

</div>

Have you tried using SDL\_WINDOWPOS\_CENTERED\_DISPLAY(displayindex) for the x and y arguments to SDL\_CreateWindow?On Jul 18, 2014, at 12:50 PM, TUUG86 wrote:

> I am using SDL\_WINDOW\_FULLSCREEN\_DESKTOP to fullscreen my application and maintain the desktop resolution. The problem is, the window is stuck at the left-lower corner of the screen, no matter what position/enum I set in SDL\_CreateWindow. I guess SDL has literally given my program the full screen to draw over, so everything I draw at (0,0) get drawn at the display (0,0) coords. I’m using OpenGL calls directly, so this is quite bad.
> 
> Second, I found no direct method to set the display in the API, although it is straightforward to get information about each display and their modes. Unless I missed something, the only working method I found is to place the window at the absolute coordinates of the other displays, but this is unfeasible in a general situation and even worse in fullscreen.
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
