X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd2af428570c0a05177b8fb715660fa9e78fd720..eda34276d67de1578a3ed3d727b595b1858a8547:/src/cocoa/glcanvas.mm diff --git a/src/cocoa/glcanvas.mm b/src/cocoa/glcanvas.mm index ebb3a16cd6..8e12a3ca92 100644 --- a/src/cocoa/glcanvas.mm +++ b/src/cocoa/glcanvas.mm @@ -23,34 +23,31 @@ #import #import -IMPLEMENT_DYNAMIC_CLASS(wxGLCanvas, wxWindow) -BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow) -END_EVENT_TABLE() -// WX_IMPLEMENT_COCOA_OWNER(wxGLCanvas,NSOpenGLView,NSView,NSView) +wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext *other) +{ + // 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)) @@ -69,14 +66,9 @@ wxGLCanvas::~wxGLCanvas() { } -void wxGLCanvas::SetCurrent() -{ - [[(NSOpenGLView*)m_cocoaNSView openGLContext] makeCurrentContext]; -} - void wxGLCanvas::SwapBuffers() { - [[(NSOpenGLView*)m_cocoaNSView openGLContext] flushBuffer]; + [[GetNSOpenGLView() openGLContext] flushBuffer]; } #endif // wxUSE_GLCANVAS