Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sean Doherty

Full Screen / Direct Input?

This topic is 5403 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

I thought I was in FULL SCREEN mode; yet when I click the top of the screen my game actually behaves as though it is in windowed mode? For example, I can drag the full screen window around the screen. The following is the partial full screen initialization code:
ZeroMemory(&m_PresentParameters, 
			   sizeof(D3DPRESENT_PARAMETERS));
m_PresentParameters.Windowed = FALSE;
m_PresentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_PresentParameters.BackBufferWidth = pMode->Width;
m_PresentParameters.BackBufferHeight = pMode->Height;
m_PresentParameters.BackBufferFormat = pMode->Format;
m_PresentParameters.FullScreen_RefreshRateInHz = pMode->RefreshRate;
m_PresentParameters.EnableAutoDepthStencil = TRUE;
m_PresentParameters.AutoDepthStencilFormat = D3DFMT_D24S8;

m_CreationParameters.AdapterOrdinal = D3DADAPTER_DEFAULT;
m_CreationParameters.DeviceType     = DeviceType;
m_CreationParameters.BehaviorFlags  = Behavior;
m_CreationParameters.hFocusWindow   = m_hWnd;
And the windows structure:
WNDCLASSEX WindowClass = {sizeof(WNDCLASSEX), 
							  CS_CLASSDC,
							  EntryMessageHandler,
							  0,
							  0, 
							  GetModuleHandle(NULL),
							  NULL,
							  LoadCursor(NULL, IDC_ARROW),
							  NULL,
							  NULL,
							  "Host Application",
							  NULL};

	RegisterClassEx(&WindowClass);

    m_hWnd = CreateWindow("Host Application",
							"Freelance Defender", 
							WS_OVERLAPPEDWINDOW,
							0,
							0,
							m_WindowWidth,
							m_WindowHeight,
							GetDesktopWindow(),
							NULL,
							WindowClass.hInstance,
							NULL);

Thanks for the help. PS: I am using DirectX 9... _______________________________________ Understanding is a three edged sword... Independent Games compete Head to Head ... www.FreelanceGames.com

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Well, when you change from windowed to fullscreen you need to change the "WS_OVERLAPPEDWINDOW" to "WS_POPUP".
That will take care of your problem

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Let me clarify that...

Two things.

In the WNDCLASEX, you should set the following two options to
WndStyle = WS_POPUP;
WndExStyle = WS_EX_TOPMOST;

That should take care of it for you. And when you go back to windowed mode, just switch the two back to whatever you have

Share this post


Link to post
Share on other sites
Another thing you might want to do is use CreateWindowEx() and have the first parameter be WS_EX_TOPMOST it keeps ur window on top :-D
-Dan

Share this post


Link to post
Share on other sites
Thanks Guys,

For some reason I thought the problem was worse. I am using Jim Adams Direct Input Code and it forces me to specify that I am using a window; even when I am in full screen?





_______________________________________
Understanding is a three edged sword...

Independent Games compete Head to Head ...
www.FreelanceGames.com

Share this post


Link to post
Share on other sites
Ademan555,

Is that because the way I have it coded; has it always been this way; is this new to DirectX 9?

Jim Adams code was for DirectX 8 and he seems to have code for pure fullscreen and windowed mode?

Thanks

_______________________________________
Understanding is a three edged sword...

Independent Games compete Head to Head ...
www.FreelanceGames.com

Share this post


Link to post
Share on other sites
Its not new, basically when you render (your Present() function, you give it the hWnd of the window you want to draw to (or just NULL to specify you want the window that it was set up to use) and it draws to that window, if its in fullscreen mode, it just assumes the window covers the whole screen, and draws to the whole screen, all this is because its running on top of windows, which is a control freak
is it just me or was i rambling?
-Dan

Share this post


Link to post
Share on other sites

  • 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!