X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4850cc8b2e1037cd394806db4ddcf73868588a4c..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/cocoa/glcanvas.mm?ds=sidebyside diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 4e6654452c..83c99ce833 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -229,39 +229,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 -{ - impl = theImplementation; -} - -- (wxWidgetCocoaImpl*) implementation ++ (void)initialize { - return impl; -} - -- (BOOL) isFlipped -{ - return YES; + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } } - (BOOL)isOpaque @@ -293,7 +275,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) ; */