WindowProperties change

Hi,

We are running at the head of CVS and noticed that our last sync changed some API behaviour that we were relying on. Specifically, WindowProperties objects returned by base.win.getProperties() are now const. Therefore, as one might expect, any changes we try to make to the WindowProperties object fail.

I can work around this by using the WindowProperties copy constructor to build a new object out of the one returned by getProperties, and then operate on that. I am wondering if this is the correct solution and if there is any other background regarding this change that we should be aware of.

Also, possibly/probably related is the fact that, upon our first call to requestProperties using a WindowProperties object copied in such a manner, we are noticing that the aspect ratio of our Panda window appears to change. I haven’t yet been able to isolate if this is a consequence of the copy operation, or some other change that happened since our last sync. I’m presently recompiling with the change to the const behaviour backed out, so that I can isolate if it is the copy that is causing it, but any thoughts on this would be appreciated.

Thanks!
-lem

I made that change intentionally to trap incorrect uses of getProperties(). People had a tendency to write code like this:

props = base.win.getProperties()
props.setMyNewProperties(...)
base.win.requestProperties(props)

This is incorrect because requestProperties() is supposed to receive a delta of the new properties request, not a complete new properties specification. Instead, you should write code like this:

props = WindowProperties()
props.setMyNewProperties(...)
base.win.requestProperties(props)

I don’t know why your aspect ratio might be changing, but note that the ShowBase code has logic to listen for the window-event message and automatically recompute the aspect window when the user resizes the window.

David

Thanks David.

I think we are indeed doing things the “wrong way” so we’ll have to sit down and rework our WindowProperties code. Shouldn’t be too bad…

As for the aspect ratio thing, the more I look at it, the more I’m convinced it’s something we’re doing in our code that just happened to occur at the same time. I know Mark’s been working on something with changing our field-of-view, it’s probably related to that…

Anyways, thanks again!

  • lem