]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/glcanvas.mm
wxSplitterWindow mouse capture improvements and cleanup.
[wxWidgets.git] / src / osx / cocoa / glcanvas.mm
index e088ede061fa7e95f27632a927dfcf52364b93d6..f07fc0f64a39235d27f62fd8d4dacfdd8f08516b 100644 (file)
@@ -61,6 +61,13 @@ WXGLContext WXGLGetCurrentContext()
     return [NSOpenGLContext currentContext];
 }
 
+bool WXGLSetCurrentContext(WXGLContext context)
+{
+    [context makeCurrentContext];
+
+    return true;
+}
+
 void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
 {
     if ( pixelFormat )
@@ -229,27 +236,23 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
 
 @interface wxNSCustomOpenGLView : NSView
 {
-    WXCOCOAIMPL_COMMON_MEMBERS
     NSOpenGLContext* context;
 }
 
-- (id)initWithFrame:(NSRect)frame;
-
-WXCOCOAIMPL_COMMON_INTERFACE
-
 @end
 
 @implementation wxNSCustomOpenGLView
 
-- (id)initWithFrame:(NSRect)frame
++ (void)initialize
 {
-    [super initWithFrame:frame];
-    impl = NULL;
-    return self;
+    static BOOL initialized = NO;
+    if (!initialized) 
+    {
+        initialized = YES;
+        wxOSXCocoaClassAddWXMethods( self );
+    }
 }
 
-WXCOCOAIMPL_COMMON_IMPLEMENTATION
-
 - (BOOL)isOpaque
 {
     return YES;
@@ -279,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) ;
 */