Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL Non-exclusive Fullscreen Mode (A.K.A. Fullscreen Borderless Window)

I'm trying to get support for a fullscreen borderless window working but none of the information I've found helps.

Regardless of whether or not the window is set as WS_EX_TOPMOST, the window will always be in exclusive fullscreen mode. I've checked the window styles in games using fullscreen borderless window mode with WinSpy++ and the styles I'm using are identical.

I know it's in exclusive fullscreen mode because WDM stops rendering the little aero preview thing for my window. I also get that desktop flicker from focusing and unfocusing the window.

The only way I've been able to get a behaviour similar to what I want is by tricking windows into thinking I don't want fullscreen mode. The way I do that is by adjusting the window position by 1px so that it doesn't match the position and size of the screen. This stops Windows from automatically turning on exclusive fullscreen mode.

I know in DirectX the solution to this is simply to create the device with the windowed flag set to true. However, I have never seen anything like that in OpenGL.

Edit as per first comment:

I'm not using any third party library for my windowing, just Win32 and OpenGL.

Edit:

I am using WS_POPUP as the window style. With this same window style in some DirectX tests I did, I can properly create a fullscreen borderless window or a fullscreen exclusive window by changing the 'windowed' property.

For hardware I'm using a GTX690 with the latest drivers on Win7 x64.

like image 337
Frongo Avatar asked Mar 07 '14 19:03

Frongo


People also ask

Which is better fullscreen or exclusive fullscreen?

If profiling reveals the game is approaching its limit for VRAM, then Exclusive Fullscreen mode may be better, allowing users to gain a slight performance improvement.

Is Exclusive fullscreen better than borderless?

Fullscreen offers a performance benefit, while Borderless Windowed makes it easy to alt-tab and not have your game go on the fritz.

What is exclusive mode fullscreen?

Exclusive Fullscreen Mode is a new feature available for the macOS Luna Secondary App 5.1 or newer and allows you to disable multi-tasking gestures and keyboard commands like command+tab, app switching with gestures, and more when using your secondary screen's keyboard and mouse/trackpad.


1 Answers

Use PFD_SUPPORT_COMPOSITION in the PIXELFORMATDESCRIPTOR of ChoosePixelFormat/SetPixelFormat.

See The OpenGL Pipeline Newsletter - Volume 003

like image 70
Macarter Avatar answered Sep 22 '22 13:09

Macarter