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 wxGLContext(bool isRGB, wxGLCanvas *win,
58 const wxPalette& palette = wxNullPalette);
62 void SetColour(const char *colour);
66 void SetupPixelFormat();
67 void SetupPalette(const wxPalette& palette);
68 wxPalette CreateDefaultPalette();
69 wxPalette* GetPalette();
72 wxWindow* GetWindow();
75 //---------------------------------------------------------------------------
77 %typemap(python, in) int *attribList (int *temp) {
79 if (PySequence_Check($source)) {
80 int size = PyObject_Length($source);
81 temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
82 for (i = 0; i < size; i++) {
83 temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
90 %typemap(python, freearg) int *attribList
97 class wxGLCanvas : public wxScrolledWindow {
99 wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
100 const wxPoint& pos = wxDefaultPosition,
101 const wxSize& size = wxDefaultSize, long style = 0,
102 const char* name = "GLCanvas",
103 int *attribList = NULL,
104 const wxPalette& palette = wxNullPalette);
106 %name(wxGLCanvasWithContext)
107 wxGLCanvas( wxWindow *parent,
108 const wxGLContext *shared = NULL,
110 const wxPoint& pos = wxDefaultPosition,
111 const wxSize& size = wxDefaultSize,
113 const char* name = "GLCanvas",
114 int *attribList = NULL,
115 const wxPalette& palette = wxNullPalette );
117 // bool Create(wxWindow *parent, wxWindowID id,
118 // const wxPoint& pos, const wxSize& size, long style, const wxString& name);
120 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
121 %pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
124 void SetColour(const char *colour);
127 wxGLContext* GetContext();
130 void SetupPixelFormat(int *attribList = NULL);
131 void SetupPalette(const wxPalette& palette);
132 wxPalette CreateDefaultPalette();
133 wxPalette* GetPalette();
138 //---------------------------------------------------------------------------
142 wxClassInfo::CleanUpClasses();
143 wxClassInfo::InitializeClasses();
147 //---------------------------------------------------------------------------
148 //---------------------------------------------------------------------------