简体   繁体   English

OpenGL非独占全屏模式(AKA全屏无边框窗口)

[英]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. 无论窗口是否设置为WS_EX_TOPMOST,窗口将始终处于独占全屏模式。 I've checked the window styles in games using fullscreen borderless window mode with WinSpy++ and the styles I'm using are identical. 我已经使用WinSpy ++使用全屏无边框窗口模式检查了游戏中的窗口样式,我使用的样式是相同的。

I know it's in exclusive fullscreen mode because WDM stops rendering the little aero preview thing for my window. 我知道它处于独占全屏模式,因为WDM停止渲染我的窗口的小空气预览。 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. 我这样做的方法是将窗口位置调整1px,使其与屏幕的位置和大小不匹配。 This stops Windows from automatically turning on exclusive fullscreen mode. 这会阻止Windows自动打开独占全屏模式。

I know in DirectX the solution to this is simply to create the device with the windowed flag set to true. 我知道在DirectX中解决这个问题的方法就是创建窗口标志设置为true的设备。 However, I have never seen anything like that in OpenGL. 但是,我在OpenGL中从未见过这样的东西。

Edit as per first comment: 根据第一条评论进行编辑:

I'm not using any third party library for my windowing, just Win32 and OpenGL. 我没有使用任何第三方库作为我的窗口,只有Win32和OpenGL。

Edit: 编辑:

I am using WS_POPUP as the window style. 我使用WS_POPUP作为窗口样式。 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. 在我做过的一些DirectX测试中使用相同的窗口样式,我可以通过更改'windowed'属性来正确创建全屏无边框窗口或全屏独占窗口。

For hardware I'm using a GTX690 with the latest drivers on Win7 x64. 对于硬件,我在Win7 x64上使用带有最新驱动程序的GTX690。

Use PFD_SUPPORT_COMPOSITION in the PIXELFORMATDESCRIPTOR of ChoosePixelFormat/SetPixelFormat. 在ChoosePixelFormat / SetPixelFormat的PIXELFORMATDESCRIPTOR中使用PFD_SUPPORT_COMPOSITION。

See The OpenGL Pipeline Newsletter - Volume 003 请参阅OpenGL管道通讯 - 第003卷

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM