]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/glcanvas.mm
Treat wxToolbook symmetrically with others in the notebook sample.
[wxWidgets.git] / src / cocoa / glcanvas.mm
index a41176c1c620c235c5b55496c1d47c3608f4a2f0..c8ff4e1c63d792f99872783e874af930e1491a99 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2004/09/29
 // RCS-ID:      $Id$
 // Copyright:   (c) 2004 David Elliott
 // Created:     2004/09/29
 // RCS-ID:      $Id$
 // Copyright:   (c) 2004 David Elliott
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 #import <AppKit/NSOpenGL.h>
 #import <AppKit/NSOpenGLView.h>
 
 #import <AppKit/NSOpenGL.h>
 #import <AppKit/NSOpenGLView.h>
 
-IMPLEMENT_DYNAMIC_CLASS(wxGLCanvas, wxWindow)
-BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
-END_EVENT_TABLE()
-// WX_IMPLEMENT_COCOA_OWNER(wxGLCanvas,NSOpenGLView,NSView,NSView)
-
-wxGLCanvas::wxGLCanvas(wxWindow *parent,
-            wxWindowID winid, const wxPoint& pos, const wxSize& size,
-            long style, const wxString& name,
-            int *attribList, const wxPalette& palette)
+wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext *other)
 {
 {
-    Create(parent,winid,pos,size,style,name);
+    // TODO
 }
 
 }
 
-wxGLCanvas::wxGLCanvas(wxWindow *parent,
-            const wxGLContext *shared,
-            wxWindowID winid, const wxPoint& pos, const wxSize& size,
-            long style, const wxString& name,
-            int *attribList, const wxPalette& palette)
+wxGLContext::~wxGLContext()
 {
 {
-    Create(parent,winid,pos,size,style,name);
 }
 
 }
 
-wxGLCanvas::wxGLCanvas(wxWindow *parent,
-            const wxGLCanvas *shared,
-            wxWindowID winid, const wxPoint& pos, const wxSize& size,
-            long style, const wxString& name,
-            int *attribList, const wxPalette& palette)
+void wxGLContext::SetCurrent(const wxGLCanvas& win) const
 {
 {
-    Create(parent,winid,pos,size,style,name);
+    [[win.GetNSOpenGLView() openGLContext] makeCurrentContext];
 }
 
 }
 
-bool wxGLCanvas::Create(wxWindow *parent, wxWindowID winid,
-           const wxPoint& pos,
-           const wxSize& size,
-           long style,
-           const wxString& name)
+IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
+// WX_IMPLEMENT_COCOA_OWNER(wxGLCanvas,NSOpenGLView,NSView,NSView)
+
+bool wxGLCanvas::Create(wxWindow *parent,
+                        wxWindowID winid,
+                        const wxPoint& pos,
+                        const wxSize& size,
+                        long style,
+                        const wxString& name,
+                        const int *attribList,
+                        const wxPalette& palette)
 {
     wxAutoNSAutoreleasePool pool;
     if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
 {
     wxAutoNSAutoreleasePool pool;
     if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
@@ -77,14 +66,9 @@ wxGLCanvas::~wxGLCanvas()
 {
 }
 
 {
 }
 
-void wxGLCanvas::SetCurrent()
-{
-    [[(NSOpenGLView*)m_cocoaNSView openGLContext] makeCurrentContext];
-}
-
 void wxGLCanvas::SwapBuffers()
 {
 void wxGLCanvas::SwapBuffers()
 {
-    [[(NSOpenGLView*)m_cocoaNSView openGLContext] flushBuffer];
+    [[GetNSOpenGLView() openGLContext] flushBuffer];
 }
 
 #endif // wxUSE_GLCANVAS
 }
 
 #endif // wxUSE_GLCANVAS