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, const wxPalette& palette = wxNullPalette);
61 void SetColour(const char *colour);
65 void SetupPixelFormat();
66 void SetupPalette(const wxPalette& palette);
67 wxPalette CreateDefaultPalette();
68 wxPalette* GetPalette();
71 wxWindow* GetWindow();
74 //---------------------------------------------------------------------------
76 %typemap(python, in) int *attribList (int *temp) {
78 if (PySequence_Check($source)) {
79 int size = PyObject_Length($source);
80 temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
81 for (i = 0; i < size; i++) {
82 temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
89 %typemap(python, freearg) int *attribList
96 class wxGLCanvas : public wxScrolledWindow {
98 wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
99 const wxPoint& pos = wxDefaultPosition,
100 const wxSize& size = wxDefaultSize, long style = 0,
101 const char* name = "GLCanvas",
102 int *attribList = NULL,
103 const wxPalette& palette = wxNullPalette);
105 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
108 void SetColour(const char *colour);
111 wxGLContext* GetContext();
115 //---------------------------------------------------------------------------
119 wxClassInfo::CleanUpClasses();
120 wxClassInfo::InitializeClasses();
124 //---------------------------------------------------------------------------
125 //---------------------------------------------------------------------------