X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4850cc8b2e1037cd394806db4ddcf73868588a4c..7735b2ea691f41d7a7f007befbe969386873b86e:/src/osx/cocoa/glcanvas.mm diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 4e6654452c..f07fc0f64a 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -61,6 +61,13 @@ WXGLContext WXGLGetCurrentContext() return [NSOpenGLContext currentContext]; } +bool WXGLSetCurrentContext(WXGLContext context) +{ + [context makeCurrentContext]; + + return true; +} + void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat ) { if ( pixelFormat ) @@ -229,39 +236,21 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const @interface wxNSCustomOpenGLView : NSView { - wxWidgetCocoaImpl* impl; NSOpenGLContext* context; } -- (id)initWithFrame:(NSRect)frame; -- (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation; -- (wxWidgetCocoaImpl*) implementation; -- (BOOL) isFlipped; - @end @implementation wxNSCustomOpenGLView -- (id)initWithFrame:(NSRect)frame -{ - [super initWithFrame:frame]; - impl = NULL; - return self; -} - -- (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation ++ (void)initialize { - impl = theImplementation; -} - -- (wxWidgetCocoaImpl*) implementation -{ - return impl; -} - -- (BOOL) isFlipped -{ - return YES; + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } } - (BOOL)isOpaque @@ -293,7 +282,6 @@ bool wxGLCanvas::Create(wxWindow *parent, NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; m_peer = new wxWidgetCocoaImpl( this, v ); - [v setImplementation:m_peer]; MacPostControlCreate(pos, size) ; */