|
From: Frank C <li...@si...> - 2004-08-07 04:03:22
|
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... Thanks, Frank. |