Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Fullscreen ahoy.

Fullscreen ahoy.

blewisjr
Ramblings of a partialy sane programmer · · 1 min read
792 0
I just added Fullscreen capability to the D3DApp class. This is done by Pressing the F key. The one issue I noticed with SlimDX is the fact it does not play nice with Alt + Enter D3D10 Default fullscreen switch. Probably due to .Net Forms. No biggie tho very easy to get your own fullscreen switch going. If anyone is interested in how here is the code.

		private void m_Window_KeyDown(object sender, KeyEventArgs e)		{			// When the V-Key is pressed we will force SwapChain to			// Present at the Vertical Refresh Rate of our monitor.			// Under most circumstances this will be 60 FPS.			if (e.KeyCode == Keys.V)			{				if (m_VSync == 0)				{					m_VSync = 1;				}				else				{					m_VSync = 0;				}			}			else if (e.KeyCode == Keys.F)			{				if (!fullscreen)				{					m_SwapChain.SetFullScreenState(true, null);					fullscreen = true;					OnResize();				}				else				{					m_SwapChain.SetFullScreenState(false, null);					fullscreen = false;					OnResize();				}			}		}

Discussion

Loading comments...