On 09.12.2011 10:56, Fernando Olivero wrote:
the formatting of the "uml" is wrong!
On Fri, Dec 9, 2011 at 10:46 AM, fernando.olivero@usi.ch <fernando.olivero@usi.ch> wrote:
Hi Igor, i have a question regarding the design of NBOpenGL.
Why does the following offscreen method, deals with windows?
NBOffscreenDisplay>>createOpenGLContext ctx := NBHostWindowContext createSpecificForPlatform. ctx createWindow: extent. ctx createContext: ctx defaultPixelFormat.
I'm trying to include in the framework, support for MacOSX, starting with offscreen drawables support using CGL, therefore i would like to modify it to:
NBOffscreenDisplay>>createOpenGLContext ctx := NBDisplayContext createSpecificForPlatform. ctx createContext: ctx defaultPixelFormat.
NBGLDisplay
NBDisplayContext NBOffscreenDisplay NBWindowedDisplay NBWinContext NBUnixContext NBMacOSXContext
What do you think? Fernando
WGL (Windows api for creating contexts) does not allow recreating contexts for exisiting windows, so you have to make a new window (and destroy it after if you don't intend to use it), just to get a new context with different capabilities. That's not specific to offscreen rendering contexts though, (nor pixelformats, another windows artifact) but creating contexts on windows, so it probably could/should/must be refactored when moving to multi-platform.
TLDR; You'd break it on windows just removing that line. Cheers, Henry