MAKE_CONST_WXSTRING2(GLCanvasNameStr, wxT("GLCanvas"));
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
-
-%include _glcanvas_rename.i
-
//---------------------------------------------------------------------------
class wxPalette;
class wxGLContext : public wxObject {
public:
-#ifndef __WXMAC__
- wxGLContext(bool isRGB, wxGLCanvas *win,
- const wxPalette& palette = wxNullPalette,
- const wxGLContext* other = NULL);
-#else
- %extend {
- wxGLContext(bool isRGB, wxGLCanvas *win,
- const wxPalette& palette = wxNullPalette,
- const wxGLContext* other = NULL) {
- AGLPixelFormat fmt; // TODO: How should this be initialized?
- return new wxGLContext(fmt, win, palette, other);
- }
- }
-
-#endif
+ wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
~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();
};
//---------------------------------------------------------------------------
};
-%typemap(in) int *attribList (int *temp) {
+%typemap(in) const int *attribList (int *temp) {
int i;
if (PySequence_Check($input)) {
int size = PyObject_Length($input);
class wxGLCanvas : public wxWindow {
public:
%pythonAppend wxGLCanvas "self._setOORInfo(self)"
- wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
+ wxGLCanvas(wxWindow *parent,
+ wxWindowID id = -1,
+ const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
const wxString& name = wxPyGLCanvasNameStr,
- int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
+ bool Create(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxGLCanvasName,
+ const int *attribList = NULL,
+ const wxPalette& palette = wxNullPalette);
+
%pythonAppend wxGLCanvas "val._setOORInfo(val)"
%RenameCtor(GLCanvasWithContext,
wxGLCanvas( wxWindow *parent,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxPyGLCanvasNameStr,
- int *attribList = NULL,
+ const int *attribList = NULL,
const wxPalette& palette = wxNullPalette ));
-
- void SetCurrent();
+ %nokwargs SetCurrent;
+ void SetCurrent(const wxGLContext& context);
void SetColour(const wxString& colour);
void SwapBuffers();
+ // deprecated...
wxGLContext* GetContext();
+ void SetCurrent();
+
#ifdef __WXMSW__
- void SetupPixelFormat(int *attribList = NULL);
+// void SetupPixelFormat(int *attribList = NULL);
void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette();
wxPalette* GetPalette();
#endif
+
+ %property(Context, GetContext, doc="See `GetContext`");
};