Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to make resolution change in my game based on Playground SDK. Now it looks so:

TPlatform::GetInstance()->SetDisplay(width, height, fullScreen, letterbox);
TWindowManager::GetInstance()->GetScript()->RunScript("scripts/logic/updateresolution.lua");

where w, h, fullScreen and letterbox are passed from lua script. In updateresolution.lua only:

DebugOut("RESOLUTION!!!!")

for debugging to see when resolution is set in log.

The initialization of game window also based on this code and on init it works well but when I try to change resolution during game from 1366x768 to 1024x768 picture moves right. Yeah, it must be moved and blank black spaces are added on right and left borders of the screen, but it moves too far right. While debugging I've found next: in platform.cpp:385 there is a call:

mData->SetDisplay(w,h,fullscreen,letterbox, aaMode);

but I can't go inside and see what is there, becouse there are no sorces in SDK. What I've notieced: in debug-mode appeares theese lines in log:

Mon Mar 11 19:58:01 2013: DXUTPauseTime 1 (0)
Mon Mar 11 19:58:01 2013: DXUTPauseRendering 1 (0)
Mon Mar 11 19:58:04 2013: DXUTPauseTime 0 (1)
Mon Mar 11 19:58:04 2013: DXUTPauseRendering 0 (1)
Mon Mar 11 19:58:04 2013: Lua: RESOLUTION!!!!

on first-time resolution set (during init). And this:

Mon Mar 11 20:05:38 2013: Lua: 1024 x 768
Mon Mar 11 20:05:38 2013: DXUTPauseTime 1 (0)
Mon Mar 11 20:05:38 2013: DXUTPauseRendering 1 (0)
Mon Mar 11 20:05:38 2013: DXUTPauseTime 1 (1)
Mon Mar 11 20:05:38 2013: DXUTPauseRendering 1 (1)
Mon Mar 11 20:05:38 2013: TRACE:PG50::TRendererImpl::SetDeviceState c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, 1965
Mon Mar 11 20:05:38 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 118
Mon Mar 11 20:05:38 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 134
Mon Mar 11 20:05:38 2013: DXUTPauseTime 0 (2)
Mon Mar 11 20:05:38 2013: DXUTPauseRendering 0 (2)
Mon Mar 11 20:05:38 2013: DXUTPauseTime 0 (1)
Mon Mar 11 20:05:38 2013: DXUTPauseRendering 0 (1)
Mon Mar 11 20:05:38 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:05:38 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:05:38 2013: Lua: RESOLUTION!!!!

on second time resolution set. But nevertheless it has changed. Also everything goes well if I change resolution from 1024x768 to 1024x768 (it just fixes itself) or if I change resolution to higher. Log:

Mon Mar 11 20:05:48 2013: Lua: 1024 x 768
Mon Mar 11 20:05:48 2013: DXUTPauseTime 1 (0)
Mon Mar 11 20:05:48 2013: DXUTPauseRendering 1 (0)
Mon Mar 11 20:05:50 2013: DXUTPauseTime 1 (1)
Mon Mar 11 20:05:50 2013: DXUTPauseRendering 1 (1)
Mon Mar 11 20:05:50 2013: TRACE:PG50::TRendererImpl::SetDeviceState c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, 1965
Mon Mar 11 20:05:50 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 118
Mon Mar 11 20:05:50 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 134
Mon Mar 11 20:05:50 2013: DXUTPauseTime 0 (2)
Mon Mar 11 20:05:50 2013: DXUTPauseRendering 0 (2)
Mon Mar 11 20:05:51 2013: DXUTPauseTime 0 (1)
Mon Mar 11 20:05:51 2013: DXUTPauseRendering 0 (1)
Mon Mar 11 20:05:51 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:05:51 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:05:51 2013: Lua: RESOLUTION!!!!

It was second change. After this one everithing goes well. Also

Mon Mar 11 20:05:56 2013: Lua: 1366 x 768
Mon Mar 11 20:05:57 2013: DXUTPauseTime 1 (0)
Mon Mar 11 20:05:57 2013: DXUTPauseRendering 1 (0)
Mon Mar 11 20:05:59 2013: DXUTPauseTime 1 (1)
Mon Mar 11 20:05:59 2013: DXUTPauseRendering 1 (1)
Mon Mar 11 20:05:59 2013: TRACE:PG50::TRendererImpl::SetDeviceState c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, 1965
Mon Mar 11 20:05:59 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 118
Mon Mar 11 20:05:59 2013: TRACE:PG50::TLoader::DisableLoader c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\core\loader.h, 134
Mon Mar 11 20:05:59 2013: DXUTPauseTime 0 (2)
Mon Mar 11 20:05:59 2013: DXUTPauseRendering 0 (2)
Mon Mar 11 20:06:00 2013: DXUTPauseTime 0 (1)
Mon Mar 11 20:06:00 2013: DXUTPauseRendering 0 (1)
Mon Mar 11 20:06:00 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:06:00 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 62
Mon Mar 11 20:06:00 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 350
Mon Mar 11 20:06:00 2013: DX Error: D3DERR_INVALIDCALL: Invalid call (0x8876086c), File c:\playbuilder2\depot\releases\sdk\sdk-5.0\5.0.11\pflib\src\win\rendererimpl.cpp, Line 62
Mon Mar 11 20:06:00 2013: Lua: RESOLUTION!!!!

when I've changed from 1024x768 to 1366x768. On screen everithing is well.

I think that I must somehow delete old window to set new one with new resolution. Any ideas how to make it to change resolution without any lags?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.