Nifty Bug

Danno

13-03-2008 23:04:04

Hey guys,

I just found that if I resize my window, the I get a render bug. The QuickGUI::Window will not render the background and header graphics in the regions that were expanded. It will however render the border!

Any thoughts?

_Dan

kungfoomasta

13-03-2008 23:19:22

NooOoOoOo. Sounds like a clipping issue. I will try to make time to try this tonight, along with another issue that came up.

Can you post the code to create the window? I can create a default window and resize it tonight, but I want to see if I can repro your issue.

chunky

14-03-2008 00:53:03

I used to have the same problem, judicious use of mGUIManager->_notifyViewportDimensionsChanged(); fixed it for me.

Gary (-;

kungfoomasta

14-03-2008 04:34:45

That could be it too! Danno, are you resizing your Render Window? (Resizing viewport?)

Danno

14-03-2008 19:53:08

I am doing the default microsoft window resize. (click drag) So the ogre stuff changes.

I will give that call chunky noted a try. I was assuming that kind of thing would be automatic with the resize :) I find that I get to keep diggin deeper and deeper into the inner workings of things. hahah

Been scouring the Ogre docs for viewport stuff, makes one all bleary-eyed after a bit :shock:

kungfoomasta

14-03-2008 21:54:01

So basically whenever the window resizes, the viewport resizes with it. But QuickGUI doesn't know about it, so we have to manually notify it. Wouldn't it be great if there was some sort of "ViewportListener"? Then we would know whenever the viewport has changed size. In fact we do have something close to this, assuming your viewport is the full size of the window. Enter: WindowEventListener!

The WindowEventListener has a bunch of callbacks that are called when window events happen, such as the window being closed, losing focus, or being resized. What I do in my apps is just add in mGUIManager->_notifyViewportChanged(), and I never have to worry about synching QuickGUI with the viewport size. :)

Danno

16-03-2008 04:21:08

So basically whenever the window resizes, the viewport resizes with it. But QuickGUI doesn't know about it, so we have to manually notify it. Wouldn't it be great if there was some sort of "ViewportListener"? Then we would know whenever the viewport has changed size. In fact we do have something close to this, assuming your viewport is the full size of the window. Enter: WindowEventListener!

The WindowEventListener has a bunch of callbacks that are called when window events happen, such as the window being closed, losing focus, or being resized. What I do in my apps is just add in mGUIManager->_notifyViewportChanged(), and I never have to worry about synching QuickGUI with the viewport size. :)


Doh!

Now I feel like a jackass :oops:

kungfoomasta

16-03-2008 20:33:33

You shouldn't! When I first started using Ogre I didn't know about callbacks and listeners, really. Knowing what events you can tap into is a powerful tool!

Danno

19-03-2008 23:30:21

Hey again,

Well that worked perfectly. I was also able to hit up some of my other problems; tracking mouse changes going inside and outside the app, and repositioning the mouse as necessary.

Only thing that sucks is that i can't seem to get the OS mouse cursor disappear unless i do this fancy class solution.

Question: Has the QGUI mouse cursor been updated to where the position is from the top left corner? i've noticed with the overlapping OS cursor that the cursor graphic is offset from the click position.

The red is where the OS cursor would be, but screen cap didn't want to draw it


So it points to the middle of the GUI cursor.

_Dan