1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the OpenGL wxWindows classes
7 // Created: 15-Mar-1999
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
19 #include "myglcanvas.h"
21 #include <wx/glcanvas.h>
26 //---------------------------------------------------------------------------
29 %include my_typemaps.i
43 %pragma(python) code = "import wx"
45 //---------------------------------------------------------------------------
53 //---------------------------------------------------------------------------
55 class wxGLContext : public wxObject {
57 #ifndef __WXMAC__ // fix this?
58 wxGLContext(bool isRGB, wxGLCanvas *win,
59 const wxPalette& palette = wxNullPalette);
64 void SetColour(const char *colour);
68 void SetupPixelFormat();
69 void SetupPalette(const wxPalette& palette);
70 wxPalette CreateDefaultPalette();
71 wxPalette* GetPalette();
74 wxWindow* GetWindow();
77 //---------------------------------------------------------------------------
79 %typemap(python, in) int *attribList (int *temp) {
81 if (PySequence_Check($source)) {
82 int size = PyObject_Length($source);
83 temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
84 for (i = 0; i < size; i++) {
85 temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
92 %typemap(python, freearg) int *attribList
99 class wxGLCanvas : public wxWindow {
101 wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
102 const wxPoint& pos = wxDefaultPosition,
103 const wxSize& size = wxDefaultSize, long style = 0,
104 const char* name = "GLCanvas",
105 int *attribList = NULL,
106 const wxPalette& palette = wxNullPalette);
108 %name(wxGLCanvasWithContext)
109 wxGLCanvas( wxWindow *parent,
110 const wxGLContext *shared = NULL,
112 const wxPoint& pos = wxDefaultPosition,
113 const wxSize& size = wxDefaultSize,
115 const char* name = "GLCanvas",
116 int *attribList = NULL,
117 const wxPalette& palette = wxNullPalette );
119 // bool Create(wxWindow *parent, wxWindowID id,
120 // const wxPoint& pos, const wxSize& size, long style, const wxString& name);
122 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
123 %pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
126 void SetColour(const char *colour);
129 wxGLContext* GetContext();
132 void SetupPixelFormat(int *attribList = NULL);
133 void SetupPalette(const wxPalette& palette);
134 wxPalette CreateDefaultPalette();
135 wxPalette* GetPalette();
140 //---------------------------------------------------------------------------
144 wxClassInfo::CleanUpClasses();
145 wxClassInfo::InitializeClasses();
149 //---------------------------------------------------------------------------
150 //---------------------------------------------------------------------------