Reputation: 423
I'm writing a game based on SDL 2.0 with OpenGL render. I need custom handling of fullscreen mode, but alt+enter on Windows 8 lead to forced fullscreen mode.
How can I turn off automatic turning on fullscreen mode via alt+enter on Windows 8?
How can I avoid toggling fullscreen mode via alt+enter on Windows 8 in general, not only using SDL 2.0?
Upvotes: 1
Views: 636
Reputation: 423
I have realised that via Direct3D I can do what I need:
IDXGIDevice * pDXGIDevice;
g_d3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&pDXGIDevice);
IDXGIAdapter * pDXGIAdapter;
pDXGIDevice->GetParent(__uuidof(IDXGIAdapter), (void **)&pDXGIAdapter);
IDXGIFactory * pIDXGIFactory;
pDXGIAdapter->GetParent(__uuidof(IDXGIFactory), (void **)&pIDXGIFactory);
pIDXGIFactory->MakeWindowAssociation(g_hWnd, DXGI_MWA_NO_ALT_ENTER);
Now I want to figure out how to get IDXGIFactory* in OpenGL code.
I tried to create new factory, enumerate adapters, but all adapters give me newly created factory which can't change any windowAssociations...
Upvotes: 2