Jump to content
  • Advertisement
Sign in to follow this  
Defend

Alt-Enter into fullscreen works. Alt-Tabbing out doesn't.

This topic is 3149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So this isn't the usual lost device issue. I was googling for an explanation but I've run out of internet. C++, VS2008, Vista, coding in D3D9, not using DXUT. My aim is to Alt-Enter from windowed mode to fullscreen and keep things functioning correctly. This works for the most part; the resolution is adjusted and the visuals appear fullscreen. But then Alt-Tab doesn't work as I believe it should. Flickering, the visuals stay on screen, other applications poke through, the alt-tab menu doesn't appear, applications switch focus, the resolution and fullscreen mode remains intact. Basically it looks like DirectX isn't losing the device, while my app is losing focus yet staying on top. The problem completely disappears if I build the D3Ddevice in fullscreen mode first, but that's not what I want to do. EDIT - Actually, if anyone could just link me to something that used D3D9, without DXUT, starts in windowed mode and allows mode switching, that's all I need for now. [Edited by - Defend on April 14, 2010 6:37:45 PM]

Share this post


Link to post
Share on other sites
Advertisement
It really has been this long since I've been able to look at the code. Where were we...

I did write a lot more about this before, but chopped it out for brevity. Now, here is the code that handles the Alt+Enter in my callback function.


	case WM_SYSCOMMAND:
if (lParam == VK_RETURN)
{
cout << "Alt+Enter recognised." << endl;
SetWindowLong(g_parentWindow, GWL_style, WS_EX_TOPMOST | WS_POPUP);
SetWindowPos(g_parentWindow, NULL, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
g_pGame->SetCanvasFormat(false, 800, 600);
ShowWindow(hWnd, SW_SHOW);
}
else
{
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;



------------------------------------------------------------

And here is the code that changes the backbuffer.

		m_stPresParams.BackBufferWidth  = bbwidth;
m_stPresParams.BackBufferHeight = bbheight;
m_stPresParams.Windowed = windowed;

if (windowed)
{
m_stPresParams.hDeviceWindow = m_kidHandle;
}
else
{
m_stPresParams.hDeviceWindow = m_parentHandle;
}

ReleaseVideoResources();
m_pD3DDevice->Reset(&m_stPresParams);



I don't know if there's any obvious mistake in that. If there is I'm not aware of it. I imagine I need to really give a more solid example of how all my code works, but that will need a bit of time so I'm just sticking this reply here for now.

Just to clarify, the problem is that Alt+Tab doesn't work once the program is in fullscreen, but if the programs starts in fullscreen mode, all Alt+Tabbing and Alt+Entering works fine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!