show black before resolution switch so we don't see OpenGL's buffer garbage during switch; made the 'previous' width and height in user preferences valid again

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3418 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-04-23 23:34:41 +00:00
parent db978329ad
commit 94bbe12636
2 changed files with 11 additions and 0 deletions

View File

@ -99,6 +99,14 @@ void IrrDriver::initDevice()
void IrrDriver::changeResolution()
{
// show black before resolution switch so we don't see OpenGL's buffer garbage during switch
m_device->getVideoDriver()->beginScene(true, true, video::SColor(255,100,101,140));
m_device->getVideoDriver()->draw2DRectangle( SColor(255, 0, 0, 0),
core::rect<s32>(0, 0,
user_config->m_prev_width,
user_config->m_prev_height) );
m_device->getVideoDriver()->endScene();
// startScreen -> removeTextures();
attachment_manager -> removeTextures();
projectile_manager -> removeTextures();

View File

@ -387,6 +387,9 @@ namespace StateManager
}
else if(name == "apply_resolution")
{
user_config->m_prev_width = user_config->m_width;
user_config->m_prev_height = user_config->m_height;
user_config->m_width = 800;
user_config->m_height = 480;
irr_driver->changeResolution();