Update Windows64_Minecraft.cpp

Fixes ALT+Enter not being persistent like F11
This commit is contained in:
Andrew P. Harper 2026-03-04 21:37:47 -05:00
parent f1d477c1ec
commit 59a62aaaf0

View file

@ -823,6 +823,23 @@ HRESULT InitDevice()
}
if( FAILED( hr ) )
return hr;
IDXGIDevice* dxgiDevice = NULL;
if (SUCCEEDED(g_pd3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&dxgiDevice)) && dxgiDevice)
{
IDXGIAdapter* dxgiAdapter = NULL;
if (SUCCEEDED(dxgiDevice->GetParent(__uuidof(IDXGIAdapter), (void**)&dxgiAdapter)) && dxgiAdapter)
{
IDXGIFactory* dxgiFactory = NULL;
if (SUCCEEDED(dxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&dxgiFactory)) && dxgiFactory)
{
dxgiFactory->MakeWindowAssociation(g_hWnd, DXGI_MWA_NO_ALT_ENTER);
dxgiFactory->Release();
}
dxgiAdapter->Release();
}
dxgiDevice->Release();
}
// Create a render target view
ID3D11Texture2D* pBackBuffer = NULL;
@ -1597,6 +1614,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
ToggleFullscreen();
}
// Alt+Enter Toggle fullscreen
if (g_KBMInput.IsKeyPressed(VK_RETURN) &&
(g_KBMInput.IsKeyDown(VK_LMENU) || g_KBMInput.IsKeyDown(VK_RMENU)))
{
ToggleFullscreen();
}
// TAB opens game info menu. - Vvis :3 - Updated by detectiveren
if (g_KBMInput.IsKeyPressed(VK_TAB) && !ui.GetMenuDisplayed(0))
{