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 <wx/glcanvas.h>
21 //---------------------------------------------------------------------------
24 %include my_typemaps.i
39 #if defined(__WXMSW__)
40 static wxString wxPyEmptyStr("");
41 static wxPoint wxPyDefaultPosition(-1, -1);
42 static wxSize wxPyDefaultSize(-1, -1);
46 %pragma(python) code = "import wx"
48 //---------------------------------------------------------------------------
56 //---------------------------------------------------------------------------
60 wxGLContext(bool isRGB, wxGLCanvas *win, 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 wxScrolledWindow {
101 wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
102 const wxPoint& pos = wxPyDefaultPosition,
103 const wxSize& size = wxPyDefaultSize, long style = 0,
104 const char* name = "GLCanvas",
105 int *attribList = NULL,
106 const wxPalette& palette = wxNullPalette);
108 %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
111 void SetColour(const char *colour);
114 wxGLContext* GetContext();
118 //---------------------------------------------------------------------------
122 wxClassInfo::CleanUpClasses();
123 wxClassInfo::InitializeClasses();
127 //---------------------------------------------------------------------------
128 //---------------------------------------------------------------------------