View Full Version : Toggle fullscreen mode
Hi guys, i'm a newby italian programmer :blink: . Excuse me for my english.
I've downloaded your TBDXW but i've don't find a funtion to switch fullscreen/windowed mode at runtime...i can set initial mode but not at runtime.
How can i do this? ;)
thanks!!! :rolleyes:
bladder
02-28-2004, 09:48 AM
I've downloaded your TBDXW but i've don't find a funtion to switch fullscreen/windowed mode at runtime
That's cause a runtime window/fullscreen switch function hasnt been implimented yet :P
Dont worry though, all the functionality is there, the GfxDevice object already has a Reset() function implimented that can do this, I just have to impliment this in the Core. I'll try and get it into the next release.
Thanks bladder...I'll wait...
bladder
02-28-2004, 03:36 PM
Here, just coded this thing up quick. It should work just fine. Just add it to the Core class and call it after you change some settings with the "settable functions"
bool Core::ApplySettingChanges()
{
this->KillUnmanaged();
this->PreReset();
if( mbWindowed )
{
mWidth = GetSystemMetrics( SM_CXSCREEN ) / 2;
mHeight = GetSystemMetrics( SM_CYSCREEN ) / 2;
}
else
{
mWidth = GetSystemMetrics( SM_CXSCREEN );
mHeight = GetSystemMetrics( SM_CYSCREEN );
}
if( !mGraphics.Reset( mbWindowed, mWidth, mHeight, mBits,
mZBufferBits, mStencilBits, mbVSync,
mbFullscreenCursor ) )
{
G.LogError( "Failed to reset device [ApplySettingChanges]" );
mbAlive = false;
return false;
}
else
{
if( !this->CreateUnmanaged() )
{
G.LogError( "Failed to re-create unmanaged resources [ApplySettingChanges]" );
mbAlive = false;
return false;
}
else
{
if( !this->PostReset() )
{
G.LogError( "PostReset failed [ApplySettingChanges]" );
mbAlive = false;
return false;
}
}
}
return true;
}
Ill get this same function into teh 1.4 release. Let me know if you are having any problems with it.
vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.