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 /////////////////////////////////////////////////////////////////////////////
18 #include "myglcanvas.h"
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
38 %pragma(python) code = "import wx"
40 //---------------------------------------------------------------------------
48 //---------------------------------------------------------------------------
50 class wxGLContext : public wxObject {
52 wxGLContext(bool isRGB, wxGLCanvas *win,
53 const wxPalette& palette = wxNullPalette);
57 void SetColour(const char *colour);
61 void SetupPixelFormat();
62 void SetupPalette(const wxPalette& palette);
63 wxPalette CreateDefaultPalette();
64 wxPalette* GetPalette();
67 wxWindow* GetWindow();
70 //---------------------------------------------------------------------------
72 %typemap(python, in) int *attribList (int *temp) {
74 if (PySequence_Check($source)) {
75 int size = PyObject_Length($source);
76 temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
77 for (i = 0; i < size; i++) {
78 temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
85 %typemap(python, freearg) int *attribList
92 class wxGLCanvas : public wxScrolledWindow {
94 wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
95 const wxPoint& pos = wxDefaultPosition,
96 const wxSize& size = wxDefaultSize, long style = 0,
97 const char* name = "GLCanvas",
98 int *attribList = NULL,
99 const wxPalette& palette = wxNullPalette);
101 %name(wxGLCanvasWithContext)
102 wxGLCanvas( wxWindow *parent,
103 const wxGLContext *shared = NULL,
105 const wxPoint& pos = wxDefaultPosition,
106 const wxSize& size = wxDefaultSize,
108 const char* name = "GLCanvas",
109 int *attribList = NULL,
110 const wxPalette& palette = wxNullPalette );
112 bool Create(wxWindow *parent, wxWindowID id,
113 const wxPoint& pos, const wxSize& size, long style, const wxString& name);
115 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
116 %pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
119 void SetColour(const char *colour);
122 wxGLContext* GetContext();
124 void SetupPixelFormat(int *attribList = NULL);
125 void SetupPalette(const wxPalette& palette);
126 wxPalette CreateDefaultPalette();
128 wxPalette* GetPalette();
132 //---------------------------------------------------------------------------
136 wxClassInfo::CleanUpClasses();
137 wxClassInfo::InitializeClasses();
141 //---------------------------------------------------------------------------
142 //---------------------------------------------------------------------------