X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b9048c56f0aa04b2adbb7813f9698abdda15184..bbc3761ee897d2cdae209c60d415ba00fe825554:/wxPython/contrib/glcanvas/glcanvas.i diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index 6f6f3708fa..1cdf228276 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -11,7 +11,11 @@ ///////////////////////////////////////////////////////////////////////////// -%module glcanvas +%define DOCSTRING +"`GLCanvas` provides an OpenGL Context on a `wx.Window`." +%enddef + +%module(package="wx", docstring=DOCSTRING) glcanvas %{ #include "wx/wxPython/wxPython.h" @@ -24,27 +28,25 @@ //--------------------------------------------------------------------------- %import core.i -%pythoncode { wx = core } +%pythoncode { wx = _core } +%pythoncode { __docfilter__ = wx.__DocFilter(globals()) } MAKE_CONST_WXSTRING2(GLCanvasNameStr, wxT("GLCanvas")); MAKE_CONST_WXSTRING_NOSWIG(EmptyString); - -%include _glcanvas_rename.i - //--------------------------------------------------------------------------- class wxPalette; //--------------------------------------------------------------------------- +MustHaveApp(wxGLContext); + class wxGLContext : public wxObject { public: #ifndef __WXMAC__ - wxGLContext(bool isRGB, wxGLCanvas *win, - const wxPalette& palette = wxNullPalette, - const wxGLContext* other = NULL); + wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL); #else %extend { wxGLContext(bool isRGB, wxGLCanvas *win, @@ -58,18 +60,9 @@ public: #endif ~wxGLContext(); - void SetCurrent(); - void SetColour(const wxString& colour); - void SwapBuffers(); - -#ifdef __WXGTK__ - void SetupPixelFormat(); - void SetupPalette(const wxPalette& palette); - wxPalette CreateDefaultPalette(); - wxPalette* GetPalette(); +#ifndef __WXMAC__ + void SetCurrent(const wxGLCanvas& win); #endif - - wxWindow* GetWindow(); }; //--------------------------------------------------------------------------- @@ -114,6 +107,8 @@ enum { +MustHaveApp(wxGLCanvas); + class wxGLCanvas : public wxWindow { public: %pythonAppend wxGLCanvas "self._setOORInfo(self)" @@ -125,7 +120,7 @@ public: const wxPalette& palette = wxNullPalette); %pythonAppend wxGLCanvas "val._setOORInfo(val)" - %name(GLCanvasWithContext) + %RenameCtor(GLCanvasWithContext, wxGLCanvas( wxWindow *parent, const wxGLContext *shared = NULL, wxWindowID id = -1, @@ -134,10 +129,13 @@ public: long style = 0, const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, - const wxPalette& palette = wxNullPalette ); - + const wxPalette& palette = wxNullPalette )); +#ifdef __WXMAC__ void SetCurrent(); +#else + void SetCurrent(const wxGLContext& RC); +#endif void SetColour(const wxString& colour); void SwapBuffers(); @@ -149,6 +147,8 @@ public: wxPalette CreateDefaultPalette(); wxPalette* GetPalette(); #endif + + %property(Context, GetContext, doc="See `GetContext`"); };