[SOLVED]Window resize failed

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

wilsonwing
Just popping in
Just popping in
Posts: 15
Joined: Sat Nov 20, 2010 05:13

[SOLVED]Window resize failed

Postby wilsonwing » Tue Jan 17, 2012 02:14

Hi, I am using 0.7.5 and still has the bug described in this post http://www.cegui.org.uk/phpBB2/viewtopic.php?f=5&t=4007&start=60#p20010.
Window resize failed.(Please see the video bellow)

On my PC, screen resolution 1024x768:
Program started at window size 800x600, no CEGUI problem, then press the maximize button on the top-right corner of the window.
The window size is now 1024x768, CEGUI still working good.
But when I press the button again, window size is now back to 800x600, the GUIs are distorted. (as descirbed by CABAListic)

Vedio
http://www.youtube.com/watch?v=8lNNxIW8YGw&feature=youtu.be

CABAListic wrote:Yes, I guess screenshots are in order. The following two screenshots show part of my menus in the initial screen resolution (800x600):
http://www.sectormania.de/cegui_menu1.jpg
http://www.sectormania.de/cegui_menu2.jpg

Then I resize the renderwindow to 1024x768, and this is what I get:
http://www.sectormania.de/cegui_menu3.jpg
http://www.sectormania.de/cegui_menu4.jpg

As you can see, the rendering area is not resized at all
...



On my Notebook, screen resolution 1280x800:
Program started at window size 800x600, no CEGUI problem, then press the maximize button on the top-right corner of the window.
The window size is now 1280x800, CEGUI layout is now out of the window, can only see parts of GUIs.
And resize back to 800x600, nothing shows up.
start up 800x600 :
http://imageshack.us/f/535/73230366.jpg/
after maximized to 1280 x 800 :
http://imageshack.us/f/41/24050507.jpg/
resize back to 800 x 600 :
http://imageshack.us/f/259/79727465.jpg/


My code :
ps. I have logged what iWidth and iHeight value are.
For window start up it is 796 and 596 (800-4, 600-4)
Maximize window it is 1024 and 768.
Back to 796 and 596 after resize again.

Code: Select all

void GUIManager::windowResized(unsigned int iWidth, unsigned int iHeight)
{
   CEGUI::Size size;
   size.d_width = static_cast<float>(iWidth);
   size.d_height = static_cast<float>(iHeight);
   CEGUI::System::getSingleton().notifyDisplaySizeChanged(size);
}


log:

Code: Select all

20/12/2011 15:49:00 (Std)    ********************************************************************************
20/12/2011 15:49:00 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
20/12/2011 15:49:00 (Std)    ********************************************************************************
20/12/2011 15:49:00 (Std)    ---- Version 0.7.5 (Build: Nov 19 2010 Microsoft Windows MSVC++ 9.0 32 bit) ----
20/12/2011 15:49:00 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
20/12/2011 15:49:00 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
20/12/2011 15:49:00 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
20/12/2011 15:49:00 (Std)    ---- Scripting module is: None ----
20/12/2011 15:49:00 (Std)    ********************************************************************************
20/12/2011 15:49:00 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
20/12/2011 15:49:00 (Std)    ********************************************************************************


Please tell me if I don't explain it well, or any other info to help on this bug. :)

ps. This post is duplicate to http://www.cegui.org.uk/phpBB2/viewtopic.php?f=5&t=4007&start=75#p28095, but got no answer at the other post, so I post it here as a bug report. :)
Last edited by wilsonwing on Tue Jan 24, 2012 01:50, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Window resize failed

Postby CrazyEddie » Thu Jan 19, 2012 07:47

Do the resize notifications appear in the CEGUI log? If so, I wonder what the people who get this issue are doing differently to those that do not get the issue :?

One thing to check is that you're notifying with the size of the Ogre rendering viewport and not the size of the host window (I think the size given by default is the size of the window). This being said, the effect of that particular error is usually a bit more subtle, but it's certainly worth checking.

If you let us know about the above two points, I'll raise it as an issue and try and check into it (currently I dread that it could be one of those "only happens on MS Windows" issues :lol: ).

CE.

wilsonwing
Just popping in
Just popping in
Posts: 15
Joined: Sat Nov 20, 2010 05:13

Re: Window resize failed

Postby wilsonwing » Sat Jan 21, 2012 03:53

Hello, CE.
Thanks for ypur reply first, and also thanks to your good CEGUI, I really like it. :D


CrazyEddie wrote:Do the resize notifications appear in the CEGUI log?

Yes, as in the log, I resize the window from originally 792x566to 1024x708, than resize again back to 792x566.
(The window is 800x600 and 1024x768...I think the 792x566 and 1024x708 is the viewport size)

Code: Select all

21/01/2012 11:22:58 (Std)    Attempting to create Imageset 'ChineseFont_auto_glyph_images_ ' with texture only.
...
21/01/2012 11:22:58 (Std)    Attempting to create Imageset 'ChineseFont_auto_glyph_images_稀' with texture only.
21/01/2012 11:22:58 (Std)    Display resize: w=1024 h=708
21/01/2012 11:22:59 (Std)    Attempting to create Imageset 'ChineseFont_auto_glyph_images_退' with texture only.
...21/01/2012 11:23:01 (Std)    Display resize: w=792 h=566
21/01/2012 11:23:01 (Std)    Attempting to create Imageset 'ChineseFont_auto_glyph_images_退' with texture only.
...


One thing to check is that you're notifying with the size of the Ogre rendering viewport and not the size of the host window

I don't understand very well on this question, but I will try to explain, please see the code:

Code: Select all

//I have a wndProc , notify when the window is resized.
LRESULT CALLBACK WindowProcedure::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
...
case WM_SIZE:
   _windowSize(wParam, lParam);
...
}

//In _windowSize(wParam, lParam)
void WindowProcedure::_windowSize(WPARAM wParam, LPARAM lParam)
{
   int iWidth = LOWORD(lParam);
   int iHeight = HIWORD(lParam);

   //I logged the iWidth and iHeight here, it is 792 x 566 and 1024 x 708

   m_pOgreSystem->windowResized(iWidth, iHeight);
   m_pGUIManager->windowResized(iWidth, iHeight);
}


void OgreSystem::windowResized(unsigned int iWidth, unsigned int iHeight)
{
   const OIS::MouseState &ms = m_pMouse->getMouseState();
   ms.width = iWidth;
   ms.height = iHeight;
}

void GUIManager::windowResized(const UINT& iWidth, const UINT& iHeight)
{
   CEGUI::Size size;
   size.d_width = static_cast<float>(iWidth);
   size.d_height = static_cast<float>(iHeight);

   CEGUI::System::getSingleton().invalidateAllCachedRendering();
   CEGUI::System::getSingleton().notifyDisplaySizeChanged(size);
}

I don't do anything with the viewport.

ps.
Would you help me on my other post,
http://www.cegui.org.uk/phpBB2/viewtopic.php?f=10&t=5973&p=28297#p28297.
I am trying to render CEGUI window onto a Ogre Billboard, but no luck. Please give me a little help here, thank you :wink:

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Window resize failed

Postby CrazyEddie » Mon Jan 23, 2012 07:23

It appears that you are doing everything right, so I will need to dig into this a bit deeper and try and reproduce the issue. I don't suppose you'd be able to get a really minimal example together that reproduces this issue? (by minimal, I mainly mean something that just uses CEGUI with stock data files and Ogre).

I have made a mantis ticket here: http://www.cegui.org.uk/mantis/view.php?id=707 If you are able to come up with a minimal example, please attach the source to that there, and feel free to add any other diagnostic information too. I will try and look at it within the next week.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Sat Jan 28, 2012 08:21

You've marked the topic as [SOLVED], and now I'm confused as to whether I'm supposed to be checking this out or not :? Please confirm one way or the other so I do not waste time hunting for issues that may not exist, thanks ;)

CE.

wilsonwing
Just popping in
Just popping in
Posts: 15
Joined: Sat Nov 20, 2010 05:13

Re: [SOLVED]Window resize failed

Postby wilsonwing » Sat Jan 28, 2012 11:46

CrazyEddie wrote:You've marked the topic as [SOLVED], and now I'm confused as to whether I'm supposed to be checking this out or not :? Please confirm one way or the other so I do not waste time hunting for issues that may not exist, thanks ;)

CE.


Hi, CE.
It is not solved.
Just want to end this topic.
Sorry if I made it confusing.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Fri Feb 03, 2012 09:40

Thanks for confirming ;) This is just a note to say that I will be looking into this tomorrow - hopefully I can reproduce it.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Sat Feb 04, 2012 17:04

I tested this by playing around with things in the CEGUI samples framework, but was not able to reproduce the issue - everything resized correctly whenever the size of the host window was changed.

From the code snippets you posted, I see you are using a custom window procedure, which is something the sample framework does not do when using the Ogre renderer. I'm willing to retest with that set up, but I need someone else to supply the code (as I do not, generally, do development on Windows). I'm willing to compile the test case myself, but I need some example source that clearly reproduces the issue.

Thanks,

CE.

wilsonwing
Just popping in
Just popping in
Posts: 15
Joined: Sat Nov 20, 2010 05:13

Re: Window resize failed

Postby wilsonwing » Thu Mar 22, 2012 14:25

CrazyEddie wrote:I have made a mantis ticket here: http://www.cegui.org.uk/mantis/view.php?id=707 If you are able to come up with a minimal example, please attach the source to that there, and feel free to add any other diagnostic information too.
CE.


hi, CE.
Sorry for the very late code. ( it has been more than a month :oops: )
I just have some time and make clean code to reproduce the bug.
And put it onto mantis .

Hope this helps. Thanks :D

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Tue Mar 27, 2012 11:13

Thanks for providing some test code for this issue. I will check it out soon.

CE.

ReGeX
Just popping in
Just popping in
Posts: 9
Joined: Sat May 02, 2009 02:54

Re: [SOLVED]Window resize failed

Postby ReGeX » Sun Apr 29, 2012 13:27

I'd also like to state that this is an issue with my project, using 0.8.x's latest revisions.

Some added bit of information: the fonts appear to resize correctly for me; it's solely the windows which become distorted. There's no rush on my end for it to be fixed; however, I do appreciate that you will eventually look into the issue before the grand release.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Mon Apr 30, 2012 08:40

Thanks.

I've not looked at it yet (real life getting in the way), but it will be looked at prior to the 1.0 (next) release. No ETA on that, other than to say the plan is still "this year" :?

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Sat May 19, 2012 12:46

To update on this.

@wilsonwing:
I have gotten around to examining the test case provided. I could reproduce an issue just fine, though on closer inspection it appears to be an usage error rather than a bug in CEGUI. While you are correctly injecting the notification to CEGUI, you're not informing Ogre that the window size has changed (which you must do when using a window that you created yourself). So, from the test case, in the function OgreSystem::windowResized adding the line:

Code: Select all

m_pWindow->windowMovedOrResized();

to notify Ogre seems to correct the issue.

I also noticed some other anomalies (these are not related to the issue reported, though I'm mentioning them since I noticed them), these appear to be related to your looknfeel needing some updates to be 100% compatible with 0.7.x. From a casual look, this mostly seems to be adding:

Code: Select all

<Property name="NonClient" value="True" />

for the __auto_titlebar__ and __auto_closebutton__ child definitions for the FrameWindow. You'll likely have to tweak positions of other layout content to compensate.

@ReGeX:
If your scenario is different to that of wilsonwing (meaning that you're using a different renderer, or if you are using ogre but you're not using a manually created host window) please open a ticket for your specific issue, providing as much information as possible about the configuration you're using, and provide a basic test case that reproduces the issue like wilsonwing did - because without these I am unable to reproduce these issues (which in turn means the issue is >95% likely not a CEGUI issue ;) ).

Cheers,

CE.

wilsonwing
Just popping in
Just popping in
Posts: 15
Joined: Sat Nov 20, 2010 05:13

Re: [SOLVED]Window resize failed

Postby wilsonwing » Mon May 21, 2012 03:07

Hi, CE.
I am sorry to provide a wrong bug report.
And find out to be my fault not using Ogre and CEGUI correctly.
:oops:

Anyway, Thank you.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [SOLVED]Window resize failed

Postby CrazyEddie » Mon May 21, 2012 07:37

wilsonwing wrote:I am sorry to provide a wrong bug report.

Don't worry about it. While it can be a little frustrating for us, it's probably better to have a few false reports than get into a situation where people are afraid to report things and we end up missing a genuine bug :)

@ReGeX:
Following up again, since you said you were using a recent unstable version, I think yesterday I fixed the particular issue you were seeing.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 8 guests