|
From: Frank C <li...@si...> - 2004-08-07 21:24:29
|
On 7-Aug-04, at 12:03 AM, Frank C wrote: > On 6-Aug-04, at 10:41 PM, James W. Walker wrote: > >> On Aug 6, 2004, at 4:17 PM, Frank C wrote: >> >>> It appears Quesa rebuilds the GL context whenever it's resized, >>> which can take a good _long_ while if you have a lot of textures >>> loaded (pretty much rules out using live-resize windows on OS X). >>> Would it be reasonable to have a GLDrawContext_UpdateSize function >>> to avoid rebuilding textures for a resize event? I'm fairly certain >>> all you have to do is update the viewport and clipping rect - >>> trashing the context isn't needed or desirable. >>> >>> Comments? >> >> On the Mac, you would also need to call aglUpdateContext, i think. > > That would be part of updating the clipping rect. On Mac OS, you would > have to grab the context port dimensions, update AGL_BUFFER_RECT, > update glViewport, and finally call aglUpdateContext. The first two > steps can be ignored for offscreen contexts. > >> I do not see any analogous wgl call for Windows. I don't know if >> that means that the wgl layer does not need to be informed of a >> window resize, or if it means that you must recreate the context. > > Ya, it looks like GLDrawContext_UpdateWindowClip does nothing on > platforms other than Mac OS so perhaps updates are automatic, but I > can't offer any more insight. glViewport would certainly need to be > updated in all cases however. > > I hacked in support for the Mac at this point and it's a whole lot > nicer when using freely resizable windows, but I ran into a bit of > roadblock in IRRenderer_StartFrame. It seems the context flags get > trashed before getting there when a resize is pending (forcing a > rebuild), but I can't see where that happens. I traced one such case > to e3drawcontext_mac_update but it still occurs after modifying that > function. I'll look at it some more over the weekend... Scratch that e3drawcontext_mac_update remark - it's Qut's fault. I've submitted a bug with more details: <http://sourceforge.net/tracker/index.php? func=detail&aid=1005268&group_id=45158&atid=442052> I can offer up some code that seems to work on Mac OS X, but I suspect someone with more intimate knowledge of Quesa should tackle this, as I'm not sure how best to handle offscreen contexts or other platforms. One thing I noticed is that AGL_BUFFER_RECT is always enabled from the get-go, but really doesn't need to be for full-window contexts. I doubt there's any sort of performance penalty, but it would make resizing easier for contexts attached to window ports if AGL_BUFFER_RECT simply wasn't enabled. Frank. |