PDA

View Full Version : Various window resizing problems with the windows GLversion of winRTSimpleApp...



ChristophB
07-13-2011, 03:25 PM
1) Any kind of window resizing results in a window that is stretched vertically by a large amount. The problem seems to be in the WM_SIZING code in main.cpp which forces aspect ratio restricted resizing.

2) Resizing generates a GL_STACK_UNDERFLOW error after the first glPopMatrix() in the PrepareForGL() function in GLESUtils.cpp. This is caused by destroying and re-initializing the renderer in the handler for OSMEssage::MESSAGE_SET_VIDEO_MODE in WinMain in main.cpp. If you just set the ortho mode again, it works fine.

3) Not related directly to resizing, but the scenes render beyond the right side of the window even without altering the window size. If you load the particles example, you'll see that the purple particles are almost off the screen entirely and the wood background isn't fully displayed. I haven't really looked into the cause for this one yet.


I'm using Windows 7, a Radeon HD 4870, Visual Studio 2010 Express, and the latest code from SVN.


Edit:

I forgot to mention... With issue 1, if you hold shift there's no abnormal window stretching (but issues 2 and 3 are still there).

Seth
07-14-2011, 03:55 AM
1) Any kind of window resizing results in a window that is stretched vertically by a large amount. The problem seems to be in the WM_SIZING code in main.cpp which forces aspect ratio restricted resizing.

I made aspect restricted the default for some reason. Here is a hack to disable that, at the top of your App.cpp do:


extern bool g_forceAspectRatioWhenChangingWindowSize;

then, in your init, do:


g_forceAspectRatioWhenChangingWindowSize = false;


Resizing generates a GL_STACK_UNDERFLOW error after the first glPopMatrix() in the PrepareForGL() function in GLESUtils.cpp. This is caused by destroying and re-initializing the renderer in the handler for OSMEssage::MESSAGE_SET_VIDEO_MODE in WinMain in main.cpp. If you just set the ortho mode again, it works fine.

Hmm, I think someone else reported this too, I guess my video driver just doesn't show it. Ok, I've added a SetOrtho call. It doesn't break anything on my and hopefully it fixes it on yours. :sweatdrop:

ChristophB
07-14-2011, 04:22 AM
Just tried it out. Everything is working fine now. :)

Thanks.