Merged the wxPy_newswig branch into the HEAD branch (main trunk)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
10
wxPython/contrib/glcanvas/_glcanvas_rename.i
Normal file
10
wxPython/contrib/glcanvas/_glcanvas_rename.i
Normal file
@@ -0,0 +1,10 @@
|
||||
// A bunch of %rename directives generated by ./distrib/build_renamers.py
|
||||
// in order to remove the wx prefix from all global scope names.
|
||||
|
||||
#ifndef SWIGXML
|
||||
|
||||
%rename(GLContext) wxGLContext;
|
||||
%rename(GLCanvasWithContext) wxGLCanvasWithContext;
|
||||
%rename(GLCanvas) wxGLCanvas;
|
||||
|
||||
#endif
|
@@ -14,58 +14,44 @@
|
||||
%module glcanvas
|
||||
|
||||
%{
|
||||
#include "wxPython.h"
|
||||
#include "wx/wxPython/wxPython.h"
|
||||
#include "wx/wxPython/pyclasses.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
#include <wx/glcanvas.h>
|
||||
#endif
|
||||
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%include typemaps.i
|
||||
%include my_typemaps.i
|
||||
|
||||
%extern wx.i
|
||||
%extern windows.i
|
||||
%extern windows2.i
|
||||
%extern windows3.i
|
||||
%extern frames.i
|
||||
%extern _defs.i
|
||||
%extern misc.i
|
||||
%extern gdi.i
|
||||
%extern controls.i
|
||||
%extern events.i
|
||||
|
||||
|
||||
%pragma(python) code = "import wx"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%import core.i
|
||||
%pythoncode { wx = core }
|
||||
|
||||
%include _glcanvas_rename.i
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxPalette;
|
||||
class wxWindow;
|
||||
class wxSize;
|
||||
class wxPoint;
|
||||
class wxGLCanvas;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxGLContext : public wxObject {
|
||||
public:
|
||||
#ifndef __WXMAC__ // fix this?
|
||||
#ifndef __WXMAC__
|
||||
wxGLContext(bool isRGB, wxGLCanvas *win,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
const wxPalette& palette = wxNullPalette,
|
||||
const wxGLContext* other = NULL);
|
||||
#else
|
||||
%extend {
|
||||
wxGLContext(bool isRGB, wxGLCanvas *win,
|
||||
const wxPalette& palette = wxNullPalette,
|
||||
const wxGLContext* other = NULL) {
|
||||
AGLPixelFormat fmt; // TODO: How should this be initialized?
|
||||
return new wxGLContext(fmt, win, palette, other);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
~wxGLContext();
|
||||
|
||||
@@ -105,28 +91,29 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
%typemap(python, in) int *attribList (int *temp) {
|
||||
%typemap(in) int *attribList (int *temp) {
|
||||
int i;
|
||||
if (PySequence_Check($source)) {
|
||||
int size = PyObject_Length($source);
|
||||
if (PySequence_Check($input)) {
|
||||
int size = PyObject_Length($input);
|
||||
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp[i] = PyInt_AsLong(PySequence_GetItem($source, i));
|
||||
temp[i] = PyInt_AsLong(PySequence_GetItem($input, i));
|
||||
}
|
||||
temp[size] = 0;
|
||||
$target = temp;
|
||||
$1 = temp;
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(python, freearg) int *attribList
|
||||
%typemap(freearg) int *attribList
|
||||
{
|
||||
delete [] $source;
|
||||
delete [] $1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class wxGLCanvas : public wxWindow {
|
||||
public:
|
||||
%addtofunc wxGLCanvas "self._setOORInfo(self)"
|
||||
wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
@@ -134,6 +121,7 @@ public:
|
||||
int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette);
|
||||
|
||||
%addtofunc wxGLCanvas "val._setOORInfo(val)"
|
||||
%name(wxGLCanvasWithContext)
|
||||
wxGLCanvas( wxWindow *parent,
|
||||
const wxGLContext *shared = NULL,
|
||||
@@ -145,11 +133,6 @@ public:
|
||||
int *attribList = NULL,
|
||||
const wxPalette& palette = wxNullPalette );
|
||||
|
||||
// bool Create(wxWindow *parent, wxWindowID id,
|
||||
// const wxPoint& pos, const wxSize& size, long style, const wxString& name);
|
||||
|
||||
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
|
||||
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
|
||||
|
||||
void SetCurrent();
|
||||
void SetColour(const wxString& colour);
|
||||
|
@@ -1,948 +0,0 @@
|
||||
/*
|
||||
* FILE : contrib/glcanvas/gtk/glcanvas.cpp
|
||||
*
|
||||
* This file was automatically generated by :
|
||||
* Simplified Wrapper and Interface Generator (SWIG)
|
||||
* Version 1.1 (Build 883)
|
||||
*
|
||||
* Portions Copyright (c) 1995-1998
|
||||
* The University of Utah and The Regents of the University of California.
|
||||
* Permission is granted to distribute this file in any manner provided
|
||||
* this notice remains intact.
|
||||
*
|
||||
* Do not make changes to this file--changes will be lost!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define SWIGCODE
|
||||
/* Implementation : PYTHON */
|
||||
|
||||
#define SWIGPYTHON
|
||||
#include "Python.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
/* Definitions for Windows/Unix exporting */
|
||||
#if defined(__WIN32__)
|
||||
# if defined(_MSC_VER)
|
||||
# define SWIGEXPORT(a) __declspec(dllexport) a
|
||||
# else
|
||||
# if defined(__BORLANDC__)
|
||||
# define SWIGEXPORT(a) a _export
|
||||
# else
|
||||
# define SWIGEXPORT(a) a
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SWIGEXPORT(a) a
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void SWIG_MakePtr(char *, void *, char *);
|
||||
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
|
||||
extern char *SWIG_GetPtr(char *, void **, char *);
|
||||
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
|
||||
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||
extern PyObject *SWIG_newvarlink(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define SWIG_init initglcanvasc
|
||||
|
||||
#define SWIG_name "glcanvasc"
|
||||
|
||||
#include "wxPython.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
#include <wx/glcanvas.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
PyObject* o2;
|
||||
PyObject* o3;
|
||||
|
||||
if (!target) {
|
||||
target = o;
|
||||
} else if (target == Py_None) {
|
||||
Py_DECREF(Py_None);
|
||||
target = o;
|
||||
} else {
|
||||
if (!PyTuple_Check(target)) {
|
||||
o2 = target;
|
||||
target = PyTuple_New(1);
|
||||
PyTuple_SetItem(target, 0, o2);
|
||||
}
|
||||
o3 = PyTuple_New(1);
|
||||
PyTuple_SetItem(o3, 0, o);
|
||||
|
||||
o2 = target;
|
||||
target = PySequence_Concat(o2, o3);
|
||||
Py_DECREF(o2);
|
||||
Py_DECREF(o3);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
static void *SwigwxGLContextTowxObject(void *ptr) {
|
||||
wxGLContext *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLContext *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxGLContext(_swigarg0,_swigarg1,_swigarg2) (new wxGLContext(_swigarg0,_swigarg1,_swigarg2))
|
||||
static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _result;
|
||||
bool _arg0;
|
||||
wxGLCanvas * _arg1;
|
||||
wxPalette * _arg2 = (wxPalette *) &wxNullPalette;
|
||||
int tempbool0;
|
||||
PyObject * _argo1 = 0;
|
||||
PyObject * _argo2 = 0;
|
||||
char *_kwnames[] = { "isRGB","win","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxGLContext",_kwnames,&tempbool0,&_argo1,&_argo2))
|
||||
return NULL;
|
||||
_arg0 = (bool ) tempbool0;
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLContext. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo2) {
|
||||
if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define delete_wxGLContext(_swigobj) (delete _swigobj)
|
||||
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
delete_wxGLContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetupPixelFormat(_swigobj) (_swigobj->SetupPixelFormat())
|
||||
static PyObject *_wrap_wxGLContext_SetupPixelFormat(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetupPixelFormat",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetupPixelFormat. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetupPixelFormat(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetupPalette(_swigobj,_swigarg0) (_swigobj->SetupPalette(_swigarg0))
|
||||
static PyObject *_wrap_wxGLContext_SetupPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
wxPalette * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
char *_kwnames[] = { "self","palette", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetupPalette",_kwnames,&_argo0,&_argo1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetupPalette. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLContext_SetupPalette. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetupPalette(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_CreateDefaultPalette(_swigobj) (_swigobj->CreateDefaultPalette())
|
||||
static PyObject *_wrap_wxGLContext_CreateDefaultPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxPalette * _result;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_CreateDefaultPalette",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_CreateDefaultPalette. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = new wxPalette (wxGLContext_CreateDefaultPalette(_arg0));
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_GetPalette(_swigobj) (_swigobj->GetPalette())
|
||||
static PyObject *_wrap_wxGLContext_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxPalette * _result;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetPalette",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetPalette. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxPalette *)wxGLContext_GetPalette(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
|
||||
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxWindow * _result;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
}{ _resultobj = wxPyMake_wxObject(_result); }
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxWindow *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxWindow *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxEvtHandler *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxEvtHandler *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxObject(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
|
||||
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxWindowID _arg1 = (wxWindowID ) -1;
|
||||
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
|
||||
long _arg4 = (long ) 0;
|
||||
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg6 = (int *) NULL;
|
||||
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj2 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj3 = 0;
|
||||
PyObject * _obj5 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj6 = 0;
|
||||
PyObject * _argo7 = 0;
|
||||
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj2)
|
||||
{
|
||||
_arg2 = &temp;
|
||||
if (! wxPoint_helper(_obj2, &_arg2))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp0;
|
||||
if (! wxSize_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj5)
|
||||
{
|
||||
_arg5 = wxString_in_helper(_obj5);
|
||||
if (_arg5 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj6)) {
|
||||
int size = PyObject_Length(_obj6);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg6 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo7) {
|
||||
if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj5)
|
||||
delete _arg5;
|
||||
}
|
||||
{
|
||||
delete [] _arg6;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
|
||||
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxGLContext * _arg1 = (wxGLContext *) NULL;
|
||||
wxWindowID _arg2 = (wxWindowID ) -1;
|
||||
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
|
||||
long _arg5 = (long ) 0;
|
||||
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg7 = (int *) NULL;
|
||||
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj3 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj4 = 0;
|
||||
PyObject * _obj6 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj7 = 0;
|
||||
PyObject * _argo8 = 0;
|
||||
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp;
|
||||
if (! wxPoint_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj4)
|
||||
{
|
||||
_arg4 = &temp0;
|
||||
if (! wxSize_helper(_obj4, &_arg4))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
_arg6 = wxString_in_helper(_obj6);
|
||||
if (_arg6 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj7)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj7)) {
|
||||
int size = PyObject_Length(_obj7);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg7 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo8) {
|
||||
if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj6)
|
||||
delete _arg6;
|
||||
}
|
||||
{
|
||||
delete [] _arg7;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
|
||||
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _result;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef glcanvascMethods[] = {
|
||||
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_GetPalette", (PyCFunction) _wrap_wxGLContext_GetPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_CreateDefaultPalette", (PyCFunction) _wrap_wxGLContext_CreateDefaultPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetupPalette", (PyCFunction) _wrap_wxGLContext_SetupPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetupPixelFormat", (PyCFunction) _wrap_wxGLContext_SetupPixelFormat, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLContext", (PyCFunction) _wrap_new_wxGLContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* This table is used by the pointer type-checker
|
||||
*/
|
||||
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_signed_long","_long",0},
|
||||
{ "_wxPrintQuality","_wxCoord",0},
|
||||
{ "_wxPrintQuality","_int",0},
|
||||
{ "_wxPrintQuality","_signed_int",0},
|
||||
{ "_wxPrintQuality","_unsigned_int",0},
|
||||
{ "_wxPrintQuality","_wxWindowID",0},
|
||||
{ "_wxPrintQuality","_uint",0},
|
||||
{ "_wxPrintQuality","_EBool",0},
|
||||
{ "_wxPrintQuality","_size_t",0},
|
||||
{ "_wxPrintQuality","_time_t",0},
|
||||
{ "_byte","_unsigned_char",0},
|
||||
{ "_long","_unsigned_long",0},
|
||||
{ "_long","_signed_long",0},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
{ "_size_t","_time_t",0},
|
||||
{ "_size_t","_unsigned_int",0},
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
{ "_uint","_time_t",0},
|
||||
{ "_uint","_size_t",0},
|
||||
{ "_uint","_unsigned_int",0},
|
||||
{ "_uint","_int",0},
|
||||
{ "_uint","_wxWindowID",0},
|
||||
{ "_wxChar","_char",0},
|
||||
{ "_char","_wxChar",0},
|
||||
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
|
||||
{ "_EBool","_wxCoord",0},
|
||||
{ "_EBool","_wxPrintQuality",0},
|
||||
{ "_EBool","_signed_int",0},
|
||||
{ "_EBool","_int",0},
|
||||
{ "_EBool","_wxWindowID",0},
|
||||
{ "_unsigned_long","_long",0},
|
||||
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
|
||||
{ "_signed_int","_wxCoord",0},
|
||||
{ "_signed_int","_wxPrintQuality",0},
|
||||
{ "_signed_int","_EBool",0},
|
||||
{ "_signed_int","_wxWindowID",0},
|
||||
{ "_signed_int","_int",0},
|
||||
{ "_WXTYPE","_wxDateTime_t",0},
|
||||
{ "_WXTYPE","_short",0},
|
||||
{ "_WXTYPE","_signed_short",0},
|
||||
{ "_WXTYPE","_unsigned_short",0},
|
||||
{ "_unsigned_short","_wxDateTime_t",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
|
||||
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
{ "_unsigned_int","_time_t",0},
|
||||
{ "_unsigned_int","_size_t",0},
|
||||
{ "_unsigned_int","_uint",0},
|
||||
{ "_unsigned_int","_wxWindowID",0},
|
||||
{ "_unsigned_int","_int",0},
|
||||
{ "_short","_wxDateTime_t",0},
|
||||
{ "_short","_WXTYPE",0},
|
||||
{ "_short","_unsigned_short",0},
|
||||
{ "_short","_signed_short",0},
|
||||
{ "_wxWindowID","_wxCoord",0},
|
||||
{ "_wxWindowID","_wxPrintQuality",0},
|
||||
{ "_wxWindowID","_time_t",0},
|
||||
{ "_wxWindowID","_size_t",0},
|
||||
{ "_wxWindowID","_EBool",0},
|
||||
{ "_wxWindowID","_uint",0},
|
||||
{ "_wxWindowID","_int",0},
|
||||
{ "_wxWindowID","_signed_int",0},
|
||||
{ "_wxWindowID","_unsigned_int",0},
|
||||
{ "_int","_wxCoord",0},
|
||||
{ "_int","_wxPrintQuality",0},
|
||||
{ "_int","_time_t",0},
|
||||
{ "_int","_size_t",0},
|
||||
{ "_int","_EBool",0},
|
||||
{ "_int","_uint",0},
|
||||
{ "_int","_wxWindowID",0},
|
||||
{ "_int","_unsigned_int",0},
|
||||
{ "_int","_signed_int",0},
|
||||
{ "_wxDateTime_t","_unsigned_short",0},
|
||||
{ "_wxDateTime_t","_short",0},
|
||||
{ "_wxDateTime_t","_WXTYPE",0},
|
||||
{ "_time_t","_wxCoord",0},
|
||||
{ "_time_t","_wxPrintQuality",0},
|
||||
{ "_time_t","_unsigned_int",0},
|
||||
{ "_time_t","_int",0},
|
||||
{ "_time_t","_wxWindowID",0},
|
||||
{ "_time_t","_uint",0},
|
||||
{ "_time_t","_size_t",0},
|
||||
{ "_wxCoord","_int",0},
|
||||
{ "_wxCoord","_signed_int",0},
|
||||
{ "_wxCoord","_unsigned_int",0},
|
||||
{ "_wxCoord","_wxWindowID",0},
|
||||
{ "_wxCoord","_uint",0},
|
||||
{ "_wxCoord","_EBool",0},
|
||||
{ "_wxCoord","_size_t",0},
|
||||
{ "_wxCoord","_time_t",0},
|
||||
{ "_wxCoord","_wxPrintQuality",0},
|
||||
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
|
||||
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
|
||||
{0,0,0}};
|
||||
|
||||
static PyObject *SWIG_globals;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT(void) initglcanvasc() {
|
||||
PyObject *m, *d;
|
||||
SWIG_globals = SWIG_newvarlink();
|
||||
m = Py_InitModule("glcanvasc", glcanvascMethods);
|
||||
d = PyModule_GetDict(m);
|
||||
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
|
||||
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
|
||||
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
|
||||
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
|
||||
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
|
||||
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
|
||||
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = 0; _swig_mapping[i].n1; i++)
|
||||
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
|
||||
}
|
||||
}
|
@@ -1,149 +1,79 @@
|
||||
# This file was created automatically by SWIG.
|
||||
import glcanvasc
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
from misc import *
|
||||
import _glcanvas
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi import *
|
||||
|
||||
from fonts import *
|
||||
|
||||
from clip_dnd import *
|
||||
|
||||
from events import *
|
||||
|
||||
from streams import *
|
||||
|
||||
from utils import *
|
||||
|
||||
from mdi import *
|
||||
|
||||
from frames import *
|
||||
|
||||
from stattool import *
|
||||
|
||||
from controls import *
|
||||
|
||||
from controls2 import *
|
||||
|
||||
from windows2 import *
|
||||
|
||||
from cmndlgs import *
|
||||
|
||||
from windows3 import *
|
||||
|
||||
from image import *
|
||||
|
||||
from printfw import *
|
||||
|
||||
from sizers import *
|
||||
|
||||
from filesys import *
|
||||
import wx
|
||||
class wxGLContextPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self, delfunc=glcanvasc.delete_wxGLContext):
|
||||
if self.thisown == 1:
|
||||
try:
|
||||
delfunc(self)
|
||||
except:
|
||||
pass
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetupPixelFormat(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetupPixelFormat(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetupPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetupPalette(self, *_args, **_kwargs)
|
||||
return val
|
||||
def CreateDefaultPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_CreateDefaultPalette(self, *_args, **_kwargs)
|
||||
if val: val = wxPalettePtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def GetPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_GetPalette(self, *_args, **_kwargs)
|
||||
if val: val = wxPalettePtr(val)
|
||||
return val
|
||||
def GetWindow(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_GetWindow(self, *_args, **_kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLContext(wxGLContextPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = glcanvasc.new_wxGLContext(*_args,**_kwargs)
|
||||
import core
|
||||
wx = core
|
||||
class GLContext(core.Object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLContext(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
|
||||
class wxGLCanvasPtr(wxWindowPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetContext(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_GetContext(self, *_args, **_kwargs)
|
||||
if val: val = wxGLContextPtr(val)
|
||||
return val
|
||||
del newobj.thisown
|
||||
def __del__(self, destroy=_glcanvas.delete_GLContext):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLContext_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
|
||||
def SetupPixelFormat(*args, **kwargs): return _glcanvas.GLContext_SetupPixelFormat(*args, **kwargs)
|
||||
def SetupPalette(*args, **kwargs): return _glcanvas.GLContext_SetupPalette(*args, **kwargs)
|
||||
def CreateDefaultPalette(*args, **kwargs): return _glcanvas.GLContext_CreateDefaultPalette(*args, **kwargs)
|
||||
def GetPalette(*args, **kwargs): return _glcanvas.GLContext_GetPalette(*args, **kwargs)
|
||||
def GetWindow(*args, **kwargs): return _glcanvas.GLContext_GetWindow(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLCanvas(wxGLCanvasPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = glcanvasc.new_wxGLCanvas(*_args,**_kwargs)
|
||||
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLContextPtr(GLContext):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLContext
|
||||
_glcanvas.GLContext_swigregister(GLContextPtr)
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(core.Window):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._setOORInfo(self)
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
def GetContext(*args, **kwargs): return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLCanvasPtr(GLCanvas):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLCanvas
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
|
||||
|
||||
|
||||
def wxGLCanvasWithContext(*_args,**_kwargs):
|
||||
val = wxGLCanvasPtr(glcanvasc.new_wxGLCanvasWithContext(*_args,**_kwargs))
|
||||
def wxGLCanvasWithContext(*args, **kwargs):
|
||||
val = _glcanvas.new_wxGLCanvasWithContext(*args, **kwargs)
|
||||
val.thisown = 1
|
||||
val._setOORInfo(self)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
||||
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA
|
||||
|
1230
wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp
Normal file
1230
wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,768 +0,0 @@
|
||||
/*
|
||||
* FILE : contrib/glcanvas/mac/glcanvas.cpp
|
||||
*
|
||||
* This file was automatically generated by :
|
||||
* Simplified Wrapper and Interface Generator (SWIG)
|
||||
* Version 1.1 (Build 883)
|
||||
*
|
||||
* Portions Copyright (c) 1995-1998
|
||||
* The University of Utah and The Regents of the University of California.
|
||||
* Permission is granted to distribute this file in any manner provided
|
||||
* this notice remains intact.
|
||||
*
|
||||
* Do not make changes to this file--changes will be lost!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define SWIGCODE
|
||||
/* Implementation : PYTHON */
|
||||
|
||||
#define SWIGPYTHON
|
||||
#include "Python.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
/* Definitions for Windows/Unix exporting */
|
||||
#if defined(__WIN32__)
|
||||
# if defined(_MSC_VER)
|
||||
# define SWIGEXPORT(a) __declspec(dllexport) a
|
||||
# else
|
||||
# if defined(__BORLANDC__)
|
||||
# define SWIGEXPORT(a) a _export
|
||||
# else
|
||||
# define SWIGEXPORT(a) a
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SWIGEXPORT(a) a
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void SWIG_MakePtr(char *, void *, char *);
|
||||
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
|
||||
extern char *SWIG_GetPtr(char *, void **, char *);
|
||||
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
|
||||
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||
extern PyObject *SWIG_newvarlink(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define SWIG_init initglcanvasc
|
||||
|
||||
#define SWIG_name "glcanvasc"
|
||||
|
||||
#include "wxPython.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
#include <wx/glcanvas.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
PyObject* o2;
|
||||
PyObject* o3;
|
||||
|
||||
if (!target) {
|
||||
target = o;
|
||||
} else if (target == Py_None) {
|
||||
Py_DECREF(Py_None);
|
||||
target = o;
|
||||
} else {
|
||||
if (!PyTuple_Check(target)) {
|
||||
o2 = target;
|
||||
target = PyTuple_New(1);
|
||||
PyTuple_SetItem(target, 0, o2);
|
||||
}
|
||||
o3 = PyTuple_New(1);
|
||||
PyTuple_SetItem(o3, 0, o);
|
||||
|
||||
o2 = target;
|
||||
target = PySequence_Concat(o2, o3);
|
||||
Py_DECREF(o2);
|
||||
Py_DECREF(o3);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
static void *SwigwxGLContextTowxObject(void *ptr) {
|
||||
wxGLContext *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLContext *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define delete_wxGLContext(_swigobj) (delete _swigobj)
|
||||
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
delete_wxGLContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
|
||||
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxWindow * _result;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
}{ _resultobj = wxPyMake_wxObject(_result); }
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxWindow *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxWindow *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxEvtHandler *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxEvtHandler *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxObject(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
|
||||
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxWindowID _arg1 = (wxWindowID ) -1;
|
||||
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
|
||||
long _arg4 = (long ) 0;
|
||||
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg6 = (int *) NULL;
|
||||
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj2 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj3 = 0;
|
||||
PyObject * _obj5 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj6 = 0;
|
||||
PyObject * _argo7 = 0;
|
||||
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj2)
|
||||
{
|
||||
_arg2 = &temp;
|
||||
if (! wxPoint_helper(_obj2, &_arg2))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp0;
|
||||
if (! wxSize_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj5)
|
||||
{
|
||||
_arg5 = wxString_in_helper(_obj5);
|
||||
if (_arg5 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj6)) {
|
||||
int size = PyObject_Length(_obj6);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg6 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo7) {
|
||||
if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj5)
|
||||
delete _arg5;
|
||||
}
|
||||
{
|
||||
delete [] _arg6;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
|
||||
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxGLContext * _arg1 = (wxGLContext *) NULL;
|
||||
wxWindowID _arg2 = (wxWindowID ) -1;
|
||||
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
|
||||
long _arg5 = (long ) 0;
|
||||
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg7 = (int *) NULL;
|
||||
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj3 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj4 = 0;
|
||||
PyObject * _obj6 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj7 = 0;
|
||||
PyObject * _argo8 = 0;
|
||||
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp;
|
||||
if (! wxPoint_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj4)
|
||||
{
|
||||
_arg4 = &temp0;
|
||||
if (! wxSize_helper(_obj4, &_arg4))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
_arg6 = wxString_in_helper(_obj6);
|
||||
if (_arg6 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj7)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj7)) {
|
||||
int size = PyObject_Length(_obj7);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg7 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo8) {
|
||||
if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj6)
|
||||
delete _arg6;
|
||||
}
|
||||
{
|
||||
delete [] _arg7;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
|
||||
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _result;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef glcanvascMethods[] = {
|
||||
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* This table is used by the pointer type-checker
|
||||
*/
|
||||
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_signed_long","_long",0},
|
||||
{ "_wxPrintQuality","_wxCoord",0},
|
||||
{ "_wxPrintQuality","_int",0},
|
||||
{ "_wxPrintQuality","_signed_int",0},
|
||||
{ "_wxPrintQuality","_unsigned_int",0},
|
||||
{ "_wxPrintQuality","_wxWindowID",0},
|
||||
{ "_wxPrintQuality","_uint",0},
|
||||
{ "_wxPrintQuality","_EBool",0},
|
||||
{ "_wxPrintQuality","_size_t",0},
|
||||
{ "_wxPrintQuality","_time_t",0},
|
||||
{ "_byte","_unsigned_char",0},
|
||||
{ "_long","_unsigned_long",0},
|
||||
{ "_long","_signed_long",0},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
{ "_size_t","_time_t",0},
|
||||
{ "_size_t","_unsigned_int",0},
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
{ "_uint","_time_t",0},
|
||||
{ "_uint","_size_t",0},
|
||||
{ "_uint","_unsigned_int",0},
|
||||
{ "_uint","_int",0},
|
||||
{ "_uint","_wxWindowID",0},
|
||||
{ "_wxChar","_char",0},
|
||||
{ "_char","_wxChar",0},
|
||||
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
|
||||
{ "_EBool","_wxCoord",0},
|
||||
{ "_EBool","_wxPrintQuality",0},
|
||||
{ "_EBool","_signed_int",0},
|
||||
{ "_EBool","_int",0},
|
||||
{ "_EBool","_wxWindowID",0},
|
||||
{ "_unsigned_long","_long",0},
|
||||
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
|
||||
{ "_signed_int","_wxCoord",0},
|
||||
{ "_signed_int","_wxPrintQuality",0},
|
||||
{ "_signed_int","_EBool",0},
|
||||
{ "_signed_int","_wxWindowID",0},
|
||||
{ "_signed_int","_int",0},
|
||||
{ "_WXTYPE","_wxDateTime_t",0},
|
||||
{ "_WXTYPE","_short",0},
|
||||
{ "_WXTYPE","_signed_short",0},
|
||||
{ "_WXTYPE","_unsigned_short",0},
|
||||
{ "_unsigned_short","_wxDateTime_t",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
|
||||
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
{ "_unsigned_int","_time_t",0},
|
||||
{ "_unsigned_int","_size_t",0},
|
||||
{ "_unsigned_int","_uint",0},
|
||||
{ "_unsigned_int","_wxWindowID",0},
|
||||
{ "_unsigned_int","_int",0},
|
||||
{ "_short","_wxDateTime_t",0},
|
||||
{ "_short","_WXTYPE",0},
|
||||
{ "_short","_unsigned_short",0},
|
||||
{ "_short","_signed_short",0},
|
||||
{ "_wxWindowID","_wxCoord",0},
|
||||
{ "_wxWindowID","_wxPrintQuality",0},
|
||||
{ "_wxWindowID","_time_t",0},
|
||||
{ "_wxWindowID","_size_t",0},
|
||||
{ "_wxWindowID","_EBool",0},
|
||||
{ "_wxWindowID","_uint",0},
|
||||
{ "_wxWindowID","_int",0},
|
||||
{ "_wxWindowID","_signed_int",0},
|
||||
{ "_wxWindowID","_unsigned_int",0},
|
||||
{ "_int","_wxCoord",0},
|
||||
{ "_int","_wxPrintQuality",0},
|
||||
{ "_int","_time_t",0},
|
||||
{ "_int","_size_t",0},
|
||||
{ "_int","_EBool",0},
|
||||
{ "_int","_uint",0},
|
||||
{ "_int","_wxWindowID",0},
|
||||
{ "_int","_unsigned_int",0},
|
||||
{ "_int","_signed_int",0},
|
||||
{ "_wxDateTime_t","_unsigned_short",0},
|
||||
{ "_wxDateTime_t","_short",0},
|
||||
{ "_wxDateTime_t","_WXTYPE",0},
|
||||
{ "_time_t","_wxCoord",0},
|
||||
{ "_time_t","_wxPrintQuality",0},
|
||||
{ "_time_t","_unsigned_int",0},
|
||||
{ "_time_t","_int",0},
|
||||
{ "_time_t","_wxWindowID",0},
|
||||
{ "_time_t","_uint",0},
|
||||
{ "_time_t","_size_t",0},
|
||||
{ "_wxCoord","_int",0},
|
||||
{ "_wxCoord","_signed_int",0},
|
||||
{ "_wxCoord","_unsigned_int",0},
|
||||
{ "_wxCoord","_wxWindowID",0},
|
||||
{ "_wxCoord","_uint",0},
|
||||
{ "_wxCoord","_EBool",0},
|
||||
{ "_wxCoord","_size_t",0},
|
||||
{ "_wxCoord","_time_t",0},
|
||||
{ "_wxCoord","_wxPrintQuality",0},
|
||||
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
|
||||
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
|
||||
{0,0,0}};
|
||||
|
||||
static PyObject *SWIG_globals;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT(void) initglcanvasc() {
|
||||
PyObject *m, *d;
|
||||
SWIG_globals = SWIG_newvarlink();
|
||||
m = Py_InitModule("glcanvasc", glcanvascMethods);
|
||||
d = PyModule_GetDict(m);
|
||||
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
|
||||
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
|
||||
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
|
||||
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
|
||||
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
|
||||
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
|
||||
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = 0; _swig_mapping[i].n1; i++)
|
||||
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
|
||||
}
|
||||
}
|
@@ -1,134 +1,75 @@
|
||||
# This file was created automatically by SWIG.
|
||||
import glcanvasc
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
from misc import *
|
||||
import _glcanvas
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi import *
|
||||
|
||||
from fonts import *
|
||||
|
||||
from clip_dnd import *
|
||||
|
||||
from events import *
|
||||
|
||||
from streams import *
|
||||
|
||||
from utils import *
|
||||
|
||||
from mdi import *
|
||||
|
||||
from frames import *
|
||||
|
||||
from stattool import *
|
||||
|
||||
from controls import *
|
||||
|
||||
from controls2 import *
|
||||
|
||||
from windows2 import *
|
||||
|
||||
from cmndlgs import *
|
||||
|
||||
from windows3 import *
|
||||
|
||||
from image import *
|
||||
|
||||
from printfw import *
|
||||
|
||||
from sizers import *
|
||||
|
||||
from filesys import *
|
||||
import wx
|
||||
class wxGLContextPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self, delfunc=glcanvasc.delete_wxGLContext):
|
||||
if self.thisown == 1:
|
||||
try:
|
||||
delfunc(self)
|
||||
except:
|
||||
pass
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetWindow(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_GetWindow(self, *_args, **_kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLContext(wxGLContextPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
|
||||
|
||||
|
||||
|
||||
class wxGLCanvasPtr(wxWindowPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetContext(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_GetContext(self, *_args, **_kwargs)
|
||||
if val: val = wxGLContextPtr(val)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLCanvas(wxGLCanvasPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = glcanvasc.new_wxGLCanvas(*_args,**_kwargs)
|
||||
import core
|
||||
wx = core
|
||||
class GLContext(core.Object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLContext(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
def __del__(self, destroy=_glcanvas.delete_GLContext):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLContext_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
|
||||
def GetWindow(*args, **kwargs): return _glcanvas.GLContext_GetWindow(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLContextPtr(GLContext):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLContext
|
||||
_glcanvas.GLContext_swigregister(GLContextPtr)
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(core.Window):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._setOORInfo(self)
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
def GetContext(*args, **kwargs): return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLCanvasPtr(GLCanvas):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLCanvas
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
|
||||
|
||||
|
||||
def wxGLCanvasWithContext(*_args,**_kwargs):
|
||||
val = wxGLCanvasPtr(glcanvasc.new_wxGLCanvasWithContext(*_args,**_kwargs))
|
||||
def wxGLCanvasWithContext(*args, **kwargs):
|
||||
val = _glcanvas.new_wxGLCanvasWithContext(*args, **kwargs)
|
||||
val.thisown = 1
|
||||
val._setOORInfo(self)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
||||
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA
|
||||
|
1122
wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp
Normal file
1122
wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,967 +0,0 @@
|
||||
/*
|
||||
* FILE : contrib/glcanvas/msw/glcanvas.cpp
|
||||
*
|
||||
* This file was automatically generated by :
|
||||
* Simplified Wrapper and Interface Generator (SWIG)
|
||||
* Version 1.1 (Build 883)
|
||||
*
|
||||
* Portions Copyright (c) 1995-1998
|
||||
* The University of Utah and The Regents of the University of California.
|
||||
* Permission is granted to distribute this file in any manner provided
|
||||
* this notice remains intact.
|
||||
*
|
||||
* Do not make changes to this file--changes will be lost!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define SWIGCODE
|
||||
/* Implementation : PYTHON */
|
||||
|
||||
#define SWIGPYTHON
|
||||
#include "Python.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
/* Definitions for Windows/Unix exporting */
|
||||
#if defined(__WIN32__)
|
||||
# if defined(_MSC_VER)
|
||||
# define SWIGEXPORT(a) __declspec(dllexport) a
|
||||
# else
|
||||
# if defined(__BORLANDC__)
|
||||
# define SWIGEXPORT(a) a _export
|
||||
# else
|
||||
# define SWIGEXPORT(a) a
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SWIGEXPORT(a) a
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void SWIG_MakePtr(char *, void *, char *);
|
||||
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
|
||||
extern char *SWIG_GetPtr(char *, void **, char *);
|
||||
extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
|
||||
extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||
extern PyObject *SWIG_newvarlink(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define SWIG_init initglcanvasc
|
||||
|
||||
#define SWIG_name "glcanvasc"
|
||||
|
||||
#include "wxPython.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
#include <wx/glcanvas.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
PyObject* o2;
|
||||
PyObject* o3;
|
||||
|
||||
if (!target) {
|
||||
target = o;
|
||||
} else if (target == Py_None) {
|
||||
Py_DECREF(Py_None);
|
||||
target = o;
|
||||
} else {
|
||||
if (!PyTuple_Check(target)) {
|
||||
o2 = target;
|
||||
target = PyTuple_New(1);
|
||||
PyTuple_SetItem(target, 0, o2);
|
||||
}
|
||||
o3 = PyTuple_New(1);
|
||||
PyTuple_SetItem(o3, 0, o);
|
||||
|
||||
o2 = target;
|
||||
target = PySequence_Concat(o2, o3);
|
||||
Py_DECREF(o2);
|
||||
Py_DECREF(o3);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// Put some wx default wxChar* values into wxStrings.
|
||||
static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
|
||||
static const wxString wxPyEmptyString(wxT(""));
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
static void *SwigwxGLContextTowxObject(void *ptr) {
|
||||
wxGLContext *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLContext *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxGLContext(_swigarg0,_swigarg1,_swigarg2) (new wxGLContext(_swigarg0,_swigarg1,_swigarg2))
|
||||
static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _result;
|
||||
bool _arg0;
|
||||
wxGLCanvas * _arg1;
|
||||
wxPalette * _arg2 = (wxPalette *) &wxNullPalette;
|
||||
int tempbool0;
|
||||
PyObject * _argo1 = 0;
|
||||
PyObject * _argo2 = 0;
|
||||
char *_kwnames[] = { "isRGB","win","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxGLContext",_kwnames,&tempbool0,&_argo1,&_argo2))
|
||||
return NULL;
|
||||
_arg0 = (bool ) tempbool0;
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLContext. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo2) {
|
||||
if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define delete_wxGLContext(_swigobj) (delete _swigobj)
|
||||
static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
delete_wxGLContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLContext_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
|
||||
static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxWindow * _result;
|
||||
wxGLContext * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxWindow *)wxGLContext_GetWindow(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
}{ _resultobj = wxPyMake_wxObject(_result); }
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxWindow *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxWindow *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxEvtHandler *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxEvtHandler *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxObject(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxObject *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
|
||||
static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxWindowID _arg1 = (wxWindowID ) -1;
|
||||
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
|
||||
long _arg4 = (long ) 0;
|
||||
wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg6 = (int *) NULL;
|
||||
wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj2 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj3 = 0;
|
||||
PyObject * _obj5 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj6 = 0;
|
||||
PyObject * _argo7 = 0;
|
||||
char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj2)
|
||||
{
|
||||
_arg2 = &temp;
|
||||
if (! wxPoint_helper(_obj2, &_arg2))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp0;
|
||||
if (! wxSize_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj5)
|
||||
{
|
||||
_arg5 = wxString_in_helper(_obj5);
|
||||
if (_arg5 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj6)) {
|
||||
int size = PyObject_Length(_obj6);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg6 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo7) {
|
||||
if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj5)
|
||||
delete _arg5;
|
||||
}
|
||||
{
|
||||
delete [] _arg6;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
|
||||
static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _result;
|
||||
wxWindow * _arg0;
|
||||
wxGLContext * _arg1 = (wxGLContext *) NULL;
|
||||
wxWindowID _arg2 = (wxWindowID ) -1;
|
||||
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
|
||||
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
|
||||
long _arg5 = (long ) 0;
|
||||
wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
|
||||
int * _arg7 = (int *) NULL;
|
||||
wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
wxPoint temp;
|
||||
PyObject * _obj3 = 0;
|
||||
wxSize temp0;
|
||||
PyObject * _obj4 = 0;
|
||||
PyObject * _obj6 = 0;
|
||||
int * temp1;
|
||||
PyObject * _obj7 = 0;
|
||||
PyObject * _argo8 = 0;
|
||||
char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj3)
|
||||
{
|
||||
_arg3 = &temp;
|
||||
if (! wxPoint_helper(_obj3, &_arg3))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj4)
|
||||
{
|
||||
_arg4 = &temp0;
|
||||
if (! wxSize_helper(_obj4, &_arg4))
|
||||
return NULL;
|
||||
}
|
||||
if (_obj6)
|
||||
{
|
||||
_arg6 = wxString_in_helper(_obj6);
|
||||
if (_arg6 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
if (_obj7)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj7)) {
|
||||
int size = PyObject_Length(_obj7);
|
||||
temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
|
||||
}
|
||||
temp1[size] = 0;
|
||||
_arg7 = temp1;
|
||||
}
|
||||
}
|
||||
if (_argo8) {
|
||||
if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj6)
|
||||
delete _arg6;
|
||||
}
|
||||
{
|
||||
delete [] _arg7;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
|
||||
static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetCurrent(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
wxString * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","colour", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = wxString_in_helper(_obj1);
|
||||
if (_arg1 == NULL)
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetColour(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
if (_obj1)
|
||||
delete _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
|
||||
static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SwapBuffers(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
|
||||
static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLContext * _result;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetupPixelFormat(_swigobj,_swigarg0) (_swigobj->SetupPixelFormat(_swigarg0))
|
||||
static PyObject *_wrap_wxGLCanvas_SetupPixelFormat(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
int * _arg1 = (int *) NULL;
|
||||
PyObject * _argo0 = 0;
|
||||
int * temp;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","attribList", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxGLCanvas_SetupPixelFormat",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPixelFormat. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_obj1)
|
||||
{
|
||||
int i;
|
||||
if (PySequence_Check(_obj1)) {
|
||||
int size = PyObject_Length(_obj1);
|
||||
temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
|
||||
for (i = 0; i < size; i++) {
|
||||
temp[i] = PyInt_AsLong(PySequence_GetItem(_obj1, i));
|
||||
}
|
||||
temp[size] = 0;
|
||||
_arg1 = temp;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetupPixelFormat(_arg0,_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
{
|
||||
delete [] _arg1;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_SetupPalette(_swigobj,_swigarg0) (_swigobj->SetupPalette(_swigarg0))
|
||||
static PyObject *_wrap_wxGLCanvas_SetupPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGLCanvas * _arg0;
|
||||
wxPalette * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
char *_kwnames[] = { "self","palette", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetupPalette",_kwnames,&_argo0,&_argo1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPalette. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLCanvas_SetupPalette. Expected _wxPalette_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
wxGLCanvas_SetupPalette(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_CreateDefaultPalette(_swigobj) (_swigobj->CreateDefaultPalette())
|
||||
static PyObject *_wrap_wxGLCanvas_CreateDefaultPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxPalette * _result;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_CreateDefaultPalette",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_CreateDefaultPalette. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = new wxPalette (wxGLCanvas_CreateDefaultPalette(_arg0));
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGLCanvas_GetPalette(_swigobj) (_swigobj->GetPalette())
|
||||
static PyObject *_wrap_wxGLCanvas_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxPalette * _result;
|
||||
wxGLCanvas * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetPalette",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetPalette. Expected _wxGLCanvas_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxPalette *)wxGLCanvas_GetPalette(_arg0);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef glcanvascMethods[] = {
|
||||
{ "wxGLCanvas_GetPalette", (PyCFunction) _wrap_wxGLCanvas_GetPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_CreateDefaultPalette", (PyCFunction) _wrap_wxGLCanvas_CreateDefaultPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetupPalette", (PyCFunction) _wrap_wxGLCanvas_SetupPalette, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetupPixelFormat", (PyCFunction) _wrap_wxGLCanvas_SetupPixelFormat, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxGLContext", (PyCFunction) _wrap_new_wxGLContext, METH_VARARGS | METH_KEYWORDS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* This table is used by the pointer type-checker
|
||||
*/
|
||||
static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_signed_long","_long",0},
|
||||
{ "_wxPrintQuality","_wxCoord",0},
|
||||
{ "_wxPrintQuality","_int",0},
|
||||
{ "_wxPrintQuality","_signed_int",0},
|
||||
{ "_wxPrintQuality","_unsigned_int",0},
|
||||
{ "_wxPrintQuality","_wxWindowID",0},
|
||||
{ "_wxPrintQuality","_uint",0},
|
||||
{ "_wxPrintQuality","_EBool",0},
|
||||
{ "_wxPrintQuality","_size_t",0},
|
||||
{ "_wxPrintQuality","_time_t",0},
|
||||
{ "_byte","_unsigned_char",0},
|
||||
{ "_long","_unsigned_long",0},
|
||||
{ "_long","_signed_long",0},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
{ "_size_t","_time_t",0},
|
||||
{ "_size_t","_unsigned_int",0},
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
{ "_uint","_time_t",0},
|
||||
{ "_uint","_size_t",0},
|
||||
{ "_uint","_unsigned_int",0},
|
||||
{ "_uint","_int",0},
|
||||
{ "_uint","_wxWindowID",0},
|
||||
{ "_wxChar","_char",0},
|
||||
{ "_char","_wxChar",0},
|
||||
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
|
||||
{ "_EBool","_wxCoord",0},
|
||||
{ "_EBool","_wxPrintQuality",0},
|
||||
{ "_EBool","_signed_int",0},
|
||||
{ "_EBool","_int",0},
|
||||
{ "_EBool","_wxWindowID",0},
|
||||
{ "_unsigned_long","_long",0},
|
||||
{ "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
|
||||
{ "_signed_int","_wxCoord",0},
|
||||
{ "_signed_int","_wxPrintQuality",0},
|
||||
{ "_signed_int","_EBool",0},
|
||||
{ "_signed_int","_wxWindowID",0},
|
||||
{ "_signed_int","_int",0},
|
||||
{ "_WXTYPE","_wxDateTime_t",0},
|
||||
{ "_WXTYPE","_short",0},
|
||||
{ "_WXTYPE","_signed_short",0},
|
||||
{ "_WXTYPE","_unsigned_short",0},
|
||||
{ "_unsigned_short","_wxDateTime_t",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
|
||||
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
{ "_unsigned_int","_time_t",0},
|
||||
{ "_unsigned_int","_size_t",0},
|
||||
{ "_unsigned_int","_uint",0},
|
||||
{ "_unsigned_int","_wxWindowID",0},
|
||||
{ "_unsigned_int","_int",0},
|
||||
{ "_short","_wxDateTime_t",0},
|
||||
{ "_short","_WXTYPE",0},
|
||||
{ "_short","_unsigned_short",0},
|
||||
{ "_short","_signed_short",0},
|
||||
{ "_wxWindowID","_wxCoord",0},
|
||||
{ "_wxWindowID","_wxPrintQuality",0},
|
||||
{ "_wxWindowID","_time_t",0},
|
||||
{ "_wxWindowID","_size_t",0},
|
||||
{ "_wxWindowID","_EBool",0},
|
||||
{ "_wxWindowID","_uint",0},
|
||||
{ "_wxWindowID","_int",0},
|
||||
{ "_wxWindowID","_signed_int",0},
|
||||
{ "_wxWindowID","_unsigned_int",0},
|
||||
{ "_int","_wxCoord",0},
|
||||
{ "_int","_wxPrintQuality",0},
|
||||
{ "_int","_time_t",0},
|
||||
{ "_int","_size_t",0},
|
||||
{ "_int","_EBool",0},
|
||||
{ "_int","_uint",0},
|
||||
{ "_int","_wxWindowID",0},
|
||||
{ "_int","_unsigned_int",0},
|
||||
{ "_int","_signed_int",0},
|
||||
{ "_wxDateTime_t","_unsigned_short",0},
|
||||
{ "_wxDateTime_t","_short",0},
|
||||
{ "_wxDateTime_t","_WXTYPE",0},
|
||||
{ "_time_t","_wxCoord",0},
|
||||
{ "_time_t","_wxPrintQuality",0},
|
||||
{ "_time_t","_unsigned_int",0},
|
||||
{ "_time_t","_int",0},
|
||||
{ "_time_t","_wxWindowID",0},
|
||||
{ "_time_t","_uint",0},
|
||||
{ "_time_t","_size_t",0},
|
||||
{ "_wxCoord","_int",0},
|
||||
{ "_wxCoord","_signed_int",0},
|
||||
{ "_wxCoord","_unsigned_int",0},
|
||||
{ "_wxCoord","_wxWindowID",0},
|
||||
{ "_wxCoord","_uint",0},
|
||||
{ "_wxCoord","_EBool",0},
|
||||
{ "_wxCoord","_size_t",0},
|
||||
{ "_wxCoord","_time_t",0},
|
||||
{ "_wxCoord","_wxPrintQuality",0},
|
||||
{ "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
|
||||
{ "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
|
||||
{0,0,0}};
|
||||
|
||||
static PyObject *SWIG_globals;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT(void) initglcanvasc() {
|
||||
PyObject *m, *d;
|
||||
SWIG_globals = SWIG_newvarlink();
|
||||
m = Py_InitModule("glcanvasc", glcanvascMethods);
|
||||
d = PyModule_GetDict(m);
|
||||
PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
|
||||
PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
|
||||
PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
|
||||
PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
|
||||
PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
|
||||
PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
|
||||
PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
|
||||
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = 0; _swig_mapping[i].n1; i++)
|
||||
SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
|
||||
}
|
||||
}
|
@@ -1,149 +1,79 @@
|
||||
# This file was created automatically by SWIG.
|
||||
import glcanvasc
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
from misc import *
|
||||
import _glcanvas
|
||||
|
||||
from misc2 import *
|
||||
|
||||
from windows import *
|
||||
|
||||
from gdi import *
|
||||
|
||||
from fonts import *
|
||||
|
||||
from clip_dnd import *
|
||||
|
||||
from events import *
|
||||
|
||||
from streams import *
|
||||
|
||||
from utils import *
|
||||
|
||||
from mdi import *
|
||||
|
||||
from frames import *
|
||||
|
||||
from stattool import *
|
||||
|
||||
from controls import *
|
||||
|
||||
from controls2 import *
|
||||
|
||||
from windows2 import *
|
||||
|
||||
from cmndlgs import *
|
||||
|
||||
from windows3 import *
|
||||
|
||||
from image import *
|
||||
|
||||
from printfw import *
|
||||
|
||||
from sizers import *
|
||||
|
||||
from filesys import *
|
||||
import wx
|
||||
class wxGLContextPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self, delfunc=glcanvasc.delete_wxGLContext):
|
||||
if self.thisown == 1:
|
||||
try:
|
||||
delfunc(self)
|
||||
except:
|
||||
pass
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetWindow(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLContext_GetWindow(self, *_args, **_kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLContext(wxGLContextPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = glcanvasc.new_wxGLContext(*_args,**_kwargs)
|
||||
import core
|
||||
wx = core
|
||||
class GLContext(core.Object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLContext(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
|
||||
class wxGLCanvasPtr(wxWindowPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def SetCurrent(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetCurrent(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetColour(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetColour(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SwapBuffers(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SwapBuffers(self, *_args, **_kwargs)
|
||||
return val
|
||||
def GetContext(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_GetContext(self, *_args, **_kwargs)
|
||||
if val: val = wxGLContextPtr(val)
|
||||
return val
|
||||
def SetupPixelFormat(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetupPixelFormat(self, *_args, **_kwargs)
|
||||
return val
|
||||
def SetupPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_SetupPalette(self, *_args, **_kwargs)
|
||||
return val
|
||||
def CreateDefaultPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_CreateDefaultPalette(self, *_args, **_kwargs)
|
||||
if val: val = wxPalettePtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def GetPalette(self, *_args, **_kwargs):
|
||||
val = glcanvasc.wxGLCanvas_GetPalette(self, *_args, **_kwargs)
|
||||
if val: val = wxPalettePtr(val)
|
||||
return val
|
||||
del newobj.thisown
|
||||
def __del__(self, destroy=_glcanvas.delete_GLContext):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLContext_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLContext_SwapBuffers(*args, **kwargs)
|
||||
def GetWindow(*args, **kwargs): return _glcanvas.GLContext_GetWindow(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s instance; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
|
||||
class wxGLCanvas(wxGLCanvasPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = glcanvasc.new_wxGLCanvas(*_args,**_kwargs)
|
||||
return "<%s.%s; proxy of C++ wxGLContext instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLContextPtr(GLContext):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLContext
|
||||
_glcanvas.GLContext_swigregister(GLContextPtr)
|
||||
|
||||
WX_GL_RGBA = _glcanvas.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = _glcanvas.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = _glcanvas.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = _glcanvas.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = _glcanvas.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = _glcanvas.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = _glcanvas.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = _glcanvas.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = _glcanvas.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = _glcanvas.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = _glcanvas.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = _glcanvas.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = _glcanvas.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = _glcanvas.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = _glcanvas.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = _glcanvas.WX_GL_MIN_ACCUM_ALPHA
|
||||
class GLCanvas(core.Window):
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _glcanvas.new_GLCanvas(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._setOORInfo(self)
|
||||
def SetCurrent(*args, **kwargs): return _glcanvas.GLCanvas_SetCurrent(*args, **kwargs)
|
||||
def SetColour(*args, **kwargs): return _glcanvas.GLCanvas_SetColour(*args, **kwargs)
|
||||
def SwapBuffers(*args, **kwargs): return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
|
||||
def GetContext(*args, **kwargs): return _glcanvas.GLCanvas_GetContext(*args, **kwargs)
|
||||
def SetupPixelFormat(*args, **kwargs): return _glcanvas.GLCanvas_SetupPixelFormat(*args, **kwargs)
|
||||
def SetupPalette(*args, **kwargs): return _glcanvas.GLCanvas_SetupPalette(*args, **kwargs)
|
||||
def CreateDefaultPalette(*args, **kwargs): return _glcanvas.GLCanvas_CreateDefaultPalette(*args, **kwargs)
|
||||
def GetPalette(*args, **kwargs): return _glcanvas.GLCanvas_GetPalette(*args, **kwargs)
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxGLCanvas instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
|
||||
class GLCanvasPtr(GLCanvas):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = GLCanvas
|
||||
_glcanvas.GLCanvas_swigregister(GLCanvasPtr)
|
||||
|
||||
|
||||
def wxGLCanvasWithContext(*_args,**_kwargs):
|
||||
val = wxGLCanvasPtr(glcanvasc.new_wxGLCanvasWithContext(*_args,**_kwargs))
|
||||
def wxGLCanvasWithContext(*args, **kwargs):
|
||||
val = _glcanvas.new_wxGLCanvasWithContext(*args, **kwargs)
|
||||
val.thisown = 1
|
||||
val._setOORInfo(self)
|
||||
val._setOORInfo(val)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
||||
WX_GL_RGBA = glcanvasc.WX_GL_RGBA
|
||||
WX_GL_BUFFER_SIZE = glcanvasc.WX_GL_BUFFER_SIZE
|
||||
WX_GL_LEVEL = glcanvasc.WX_GL_LEVEL
|
||||
WX_GL_DOUBLEBUFFER = glcanvasc.WX_GL_DOUBLEBUFFER
|
||||
WX_GL_STEREO = glcanvasc.WX_GL_STEREO
|
||||
WX_GL_AUX_BUFFERS = glcanvasc.WX_GL_AUX_BUFFERS
|
||||
WX_GL_MIN_RED = glcanvasc.WX_GL_MIN_RED
|
||||
WX_GL_MIN_GREEN = glcanvasc.WX_GL_MIN_GREEN
|
||||
WX_GL_MIN_BLUE = glcanvasc.WX_GL_MIN_BLUE
|
||||
WX_GL_MIN_ALPHA = glcanvasc.WX_GL_MIN_ALPHA
|
||||
WX_GL_DEPTH_SIZE = glcanvasc.WX_GL_DEPTH_SIZE
|
||||
WX_GL_STENCIL_SIZE = glcanvasc.WX_GL_STENCIL_SIZE
|
||||
WX_GL_MIN_ACCUM_RED = glcanvasc.WX_GL_MIN_ACCUM_RED
|
||||
WX_GL_MIN_ACCUM_GREEN = glcanvasc.WX_GL_MIN_ACCUM_GREEN
|
||||
WX_GL_MIN_ACCUM_BLUE = glcanvasc.WX_GL_MIN_ACCUM_BLUE
|
||||
WX_GL_MIN_ACCUM_ALPHA = glcanvasc.WX_GL_MIN_ACCUM_ALPHA
|
||||
|
1253
wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp
Normal file
1253
wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,747 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: glcanvas.cpp
|
||||
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under MS Windows
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "glcanvas.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include <wx/setup.h>
|
||||
|
||||
|
||||
#undef wxUSE_GLCANVAS
|
||||
#define wxUSE_GLCANVAS 1
|
||||
#if wxUSE_GLCANVAS
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#include "myglcanvas.h"
|
||||
|
||||
const wxChar* wxGLCanvasName = wxT("GLcanvas");
|
||||
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
|
||||
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
|
||||
|
||||
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/*
|
||||
* GLContext implementation
|
||||
*/
|
||||
|
||||
wxGLContext::wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette)
|
||||
{
|
||||
m_window = win;
|
||||
|
||||
m_hDC = win->GetHDC();
|
||||
|
||||
m_glContext = wglCreateContext((HDC) m_hDC);
|
||||
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
|
||||
|
||||
wglMakeCurrent((HDC) m_hDC, m_glContext);
|
||||
}
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
bool isRGB, wxGLCanvas *win,
|
||||
const wxPalette& palette,
|
||||
const wxGLContext *other /* for sharing display lists */
|
||||
)
|
||||
{
|
||||
m_window = win;
|
||||
|
||||
m_hDC = win->GetHDC();
|
||||
|
||||
m_glContext = wglCreateContext((HDC) m_hDC);
|
||||
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
|
||||
|
||||
if( other != 0 )
|
||||
wglShareLists( other->m_glContext, m_glContext );
|
||||
|
||||
wglMakeCurrent((HDC) m_hDC, m_glContext);
|
||||
}
|
||||
|
||||
wxGLContext::~wxGLContext()
|
||||
{
|
||||
if (m_glContext)
|
||||
{
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(m_glContext);
|
||||
}
|
||||
}
|
||||
|
||||
void wxGLContext::SwapBuffers()
|
||||
{
|
||||
if (m_glContext)
|
||||
{
|
||||
wglMakeCurrent((HDC) m_hDC, m_glContext);
|
||||
::SwapBuffers((HDC) m_hDC); //blits the backbuffer into DC
|
||||
}
|
||||
}
|
||||
|
||||
void wxGLContext::SetCurrent()
|
||||
{
|
||||
if (m_glContext)
|
||||
{
|
||||
wglMakeCurrent((HDC) m_hDC, m_glContext);
|
||||
}
|
||||
|
||||
/*
|
||||
setupPixelFormat(hDC);
|
||||
setupPalette(hDC);
|
||||
*/
|
||||
}
|
||||
|
||||
void wxGLContext::SetColour(const wxChar *colour)
|
||||
{
|
||||
float r = 0.0;
|
||||
float g = 0.0;
|
||||
float b = 0.0;
|
||||
wxColour *col = wxTheColourDatabase->FindColour(colour);
|
||||
if (col)
|
||||
{
|
||||
r = (float)(col->Red()/256.0);
|
||||
g = (float)(col->Green()/256.0);
|
||||
b = (float)(col->Blue()/256.0);
|
||||
glColor3f( r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
|
||||
EVT_SIZE(wxGLCanvas::OnSize)
|
||||
EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
|
||||
EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette) : wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
bool ret = Create(parent, id, pos, size, style, name);
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
}
|
||||
|
||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||
|
||||
SetupPixelFormat(attribList);
|
||||
SetupPalette(palette);
|
||||
|
||||
m_glContext = new wxGLContext(TRUE, this, palette);
|
||||
}
|
||||
|
||||
wxGLCanvas::wxGLCanvas( wxWindow *parent,
|
||||
const wxGLContext *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette )
|
||||
: wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
bool ret = Create(parent, id, pos, size, style, name);
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
}
|
||||
|
||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||
|
||||
SetupPixelFormat(attribList);
|
||||
SetupPalette(palette);
|
||||
|
||||
m_glContext = new wxGLContext(TRUE, this, palette, shared );
|
||||
}
|
||||
|
||||
// Not very useful for wxMSW, but this is to be wxGTK compliant
|
||||
|
||||
wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette ):
|
||||
wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
bool ret = Create(parent, id, pos, size, style, name);
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
}
|
||||
|
||||
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
|
||||
|
||||
SetupPixelFormat(attribList);
|
||||
SetupPalette(palette);
|
||||
|
||||
wxGLContext *sharedContext=0;
|
||||
if (shared) sharedContext=shared->GetContext();
|
||||
m_glContext = new wxGLContext(TRUE, this, palette, sharedContext );
|
||||
}
|
||||
|
||||
wxGLCanvas::~wxGLCanvas()
|
||||
{
|
||||
if (m_glContext)
|
||||
delete m_glContext;
|
||||
|
||||
::ReleaseDC((HWND) GetHWND(), (HDC) m_hDC);
|
||||
}
|
||||
|
||||
// Replaces wxWindow::Create functionality, since we need to use a different
|
||||
// window class
|
||||
bool wxGLCanvas::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
static bool s_registeredGLCanvasClass = FALSE;
|
||||
|
||||
// We have to register a special window class because we need
|
||||
// the CS_OWNDC style for GLCanvas.
|
||||
|
||||
/*
|
||||
From Angel Popov <jumpo@bitex.com>
|
||||
|
||||
Here are two snips from a dicussion in the OpenGL Gamedev list that explains
|
||||
how this problem can be fixed:
|
||||
|
||||
"There are 5 common DCs available in Win95. These are aquired when you call
|
||||
GetDC or GetDCEx from a window that does _not_ have the OWNDC flag.
|
||||
OWNDC flagged windows do not get their DC from the common DC pool, the issue
|
||||
is they require 800 bytes each from the limited 64Kb local heap for GDI."
|
||||
|
||||
"The deal is, if you hold onto one of the 5 shared DC's too long (as GL apps
|
||||
do), Win95 will actually "steal" it from you. MakeCurrent fails,
|
||||
apparently, because Windows re-assigns the HDC to a different window. The
|
||||
only way to prevent this, the only reliable means, is to set CS_OWNDC."
|
||||
*/
|
||||
|
||||
if (!s_registeredGLCanvasClass)
|
||||
{
|
||||
WNDCLASS wndclass;
|
||||
|
||||
// the fields which are common to all classes
|
||||
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
wndclass.cbWndExtra = sizeof( DWORD ); // VZ: what is this DWORD used for?
|
||||
wndclass.hInstance = wxhInstance;
|
||||
wndclass.hIcon = (HICON) NULL;
|
||||
wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
|
||||
wndclass.lpszMenuName = NULL;
|
||||
|
||||
// Register the GLCanvas class name
|
||||
wndclass.hbrBackground = (HBRUSH)NULL;
|
||||
wndclass.lpszClassName = wxGLCanvasClassName;
|
||||
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC;
|
||||
|
||||
if ( !::RegisterClass(&wndclass) )
|
||||
{
|
||||
wxLogLastError(wxT("RegisterClass(wxGLCanvasClass)"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Register the GLCanvas class name for windows which don't do full repaint
|
||||
// on resize
|
||||
wndclass.lpszClassName = wxGLCanvasClassNameNoRedraw;
|
||||
wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW);
|
||||
|
||||
if ( !::RegisterClass(&wndclass) )
|
||||
{
|
||||
wxLogLastError(wxT("RegisterClass(wxGLCanvasClassNameNoRedraw)"));
|
||||
|
||||
::UnregisterClass(wxGLCanvasClassName, wxhInstance);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s_registeredGLCanvasClass = TRUE;
|
||||
}
|
||||
|
||||
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
|
||||
|
||||
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
|
||||
parent->AddChild(this);
|
||||
|
||||
DWORD msflags = 0;
|
||||
if ( style & wxBORDER )
|
||||
msflags |= WS_BORDER;
|
||||
if ( style & wxTHICK_FRAME )
|
||||
msflags |= WS_THICKFRAME;
|
||||
|
||||
/*
|
||||
A general rule with OpenGL and Win32 is that any window that will have a
|
||||
HGLRC built for it must have two flags: WS_CLIPCHILDREN & WS_CLIPSIBLINGS.
|
||||
You can find references about this within the knowledge base and most OpenGL
|
||||
books that contain the wgl function descriptions.
|
||||
*/
|
||||
|
||||
msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
|
||||
|
||||
bool want3D;
|
||||
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
|
||||
|
||||
// Even with extended styles, need to combine with WS_BORDER
|
||||
// for them to look right.
|
||||
if ( want3D || (m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
|
||||
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
|
||||
{
|
||||
msflags |= WS_BORDER;
|
||||
}
|
||||
|
||||
return MSWCreate(wxGLCanvasClassName, NULL, pos, size, msflags, exStyle);
|
||||
}
|
||||
|
||||
static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
|
||||
{
|
||||
if (attribList) {
|
||||
pfd.dwFlags &= ~PFD_DOUBLEBUFFER;
|
||||
pfd.iPixelType = PFD_TYPE_COLORINDEX;
|
||||
pfd.cColorBits = 0;
|
||||
int arg=0;
|
||||
|
||||
while( (attribList[arg]!=0) )
|
||||
{
|
||||
switch( attribList[arg++] )
|
||||
{
|
||||
case WX_GL_RGBA:
|
||||
pfd.iPixelType = PFD_TYPE_RGBA;
|
||||
break;
|
||||
case WX_GL_BUFFER_SIZE:
|
||||
pfd.cColorBits = attribList[arg++];
|
||||
break;
|
||||
case WX_GL_LEVEL:
|
||||
// this member looks like it may be obsolete
|
||||
if (attribList[arg] > 0) {
|
||||
pfd.iLayerType = (BYTE)PFD_OVERLAY_PLANE;
|
||||
} else if (attribList[arg] < 0) {
|
||||
pfd.iLayerType = (BYTE)PFD_UNDERLAY_PLANE;
|
||||
} else {
|
||||
pfd.iLayerType = (BYTE)PFD_MAIN_PLANE;
|
||||
}
|
||||
arg++;
|
||||
break;
|
||||
case WX_GL_DOUBLEBUFFER:
|
||||
pfd.dwFlags |= PFD_DOUBLEBUFFER;
|
||||
break;
|
||||
case WX_GL_STEREO:
|
||||
pfd.dwFlags |= PFD_STEREO;
|
||||
break;
|
||||
case WX_GL_AUX_BUFFERS:
|
||||
pfd.cAuxBuffers = attribList[arg++];
|
||||
break;
|
||||
case WX_GL_MIN_RED:
|
||||
pfd.cColorBits += (pfd.cRedBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_GREEN:
|
||||
pfd.cColorBits += (pfd.cGreenBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_BLUE:
|
||||
pfd.cColorBits += (pfd.cBlueBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_ALPHA:
|
||||
// doesn't count in cColorBits
|
||||
pfd.cAlphaBits = attribList[arg++];
|
||||
break;
|
||||
case WX_GL_DEPTH_SIZE:
|
||||
pfd.cDepthBits = attribList[arg++];
|
||||
break;
|
||||
case WX_GL_STENCIL_SIZE:
|
||||
pfd.cStencilBits = attribList[arg++];
|
||||
break;
|
||||
case WX_GL_MIN_ACCUM_RED:
|
||||
pfd.cAccumBits += (pfd.cAccumRedBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_ACCUM_GREEN:
|
||||
pfd.cAccumBits += (pfd.cAccumGreenBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_ACCUM_BLUE:
|
||||
pfd.cAccumBits += (pfd.cAccumBlueBits = attribList[arg++]);
|
||||
break;
|
||||
case WX_GL_MIN_ACCUM_ALPHA:
|
||||
pfd.cAccumBits += (pfd.cAccumAlphaBits = attribList[arg++]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
|
||||
{
|
||||
PIXELFORMATDESCRIPTOR pfd = {
|
||||
sizeof(PIXELFORMATDESCRIPTOR), /* size */
|
||||
1, /* version */
|
||||
PFD_SUPPORT_OPENGL |
|
||||
PFD_DRAW_TO_WINDOW |
|
||||
PFD_DOUBLEBUFFER, /* support double-buffering */
|
||||
PFD_TYPE_RGBA, /* color type */
|
||||
16, /* prefered color depth */
|
||||
0, 0, 0, 0, 0, 0, /* color bits (ignored) */
|
||||
0, /* no alpha buffer */
|
||||
0, /* alpha bits (ignored) */
|
||||
0, /* no accumulation buffer */
|
||||
0, 0, 0, 0, /* accum bits (ignored) */
|
||||
16, /* depth buffer */
|
||||
0, /* no stencil buffer */
|
||||
0, /* no auxiliary buffers */
|
||||
PFD_MAIN_PLANE, /* main layer */
|
||||
0, /* reserved */
|
||||
0, 0, 0, /* no layer, visible, damage masks */
|
||||
};
|
||||
|
||||
AdjustPFDForAttributes(pfd, attribList);
|
||||
|
||||
int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
|
||||
if (pixelFormat == 0) {
|
||||
wxLogLastError(_T("ChoosePixelFormat"));
|
||||
}
|
||||
else {
|
||||
if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
|
||||
wxLogLastError(_T("SetPixelFormat"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetupPalette(const wxPalette& palette)
|
||||
{
|
||||
int pixelFormat = GetPixelFormat((HDC) m_hDC);
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
|
||||
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
|
||||
|
||||
if (pfd.dwFlags & PFD_NEED_PALETTE)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_palette = palette;
|
||||
|
||||
if ( !m_palette.Ok() )
|
||||
{
|
||||
m_palette = CreateDefaultPalette();
|
||||
}
|
||||
|
||||
if (m_palette.Ok())
|
||||
{
|
||||
SelectPalette((HDC) m_hDC, (HPALETTE) m_palette.GetHPALETTE(), FALSE);
|
||||
RealizePalette((HDC) m_hDC);
|
||||
}
|
||||
}
|
||||
|
||||
wxPalette wxGLCanvas::CreateDefaultPalette()
|
||||
{
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
int paletteSize;
|
||||
int pixelFormat = GetPixelFormat((HDC) m_hDC);
|
||||
|
||||
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
|
||||
|
||||
paletteSize = 1 << pfd.cColorBits;
|
||||
|
||||
LOGPALETTE* pPal =
|
||||
(LOGPALETTE*) malloc(sizeof(LOGPALETTE) + paletteSize * sizeof(PALETTEENTRY));
|
||||
pPal->palVersion = 0x300;
|
||||
pPal->palNumEntries = paletteSize;
|
||||
|
||||
/* build a simple RGB color palette */
|
||||
{
|
||||
int redMask = (1 << pfd.cRedBits) - 1;
|
||||
int greenMask = (1 << pfd.cGreenBits) - 1;
|
||||
int blueMask = (1 << pfd.cBlueBits) - 1;
|
||||
int i;
|
||||
|
||||
for (i=0; i<paletteSize; ++i) {
|
||||
pPal->palPalEntry[i].peRed =
|
||||
(((i >> pfd.cRedShift) & redMask) * 255) / redMask;
|
||||
pPal->palPalEntry[i].peGreen =
|
||||
(((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
|
||||
pPal->palPalEntry[i].peBlue =
|
||||
(((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
|
||||
pPal->palPalEntry[i].peFlags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
HPALETTE hPalette = CreatePalette(pPal);
|
||||
free(pPal);
|
||||
|
||||
wxPalette palette;
|
||||
palette.SetHPALETTE((WXHPALETTE) hPalette);
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
void wxGLCanvas::SwapBuffers()
|
||||
{
|
||||
if (m_glContext)
|
||||
m_glContext->SwapBuffers();
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetCurrent()
|
||||
{
|
||||
if (m_glContext)
|
||||
{
|
||||
m_glContext->SetCurrent();
|
||||
}
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetColour(const wxChar *colour)
|
||||
{
|
||||
if (m_glContext)
|
||||
m_glContext->SetColour(colour);
|
||||
}
|
||||
|
||||
// TODO: Have to have this called by parent frame (?)
|
||||
// So we need wxFrame to call OnQueryNewPalette for all children...
|
||||
void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
|
||||
{
|
||||
/* realize palette if this is the current window */
|
||||
if ( GetPalette()->Ok() ) {
|
||||
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
|
||||
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
|
||||
::RealizePalette((HDC) GetHDC());
|
||||
Refresh();
|
||||
event.SetPaletteRealized(TRUE);
|
||||
}
|
||||
else
|
||||
event.SetPaletteRealized(FALSE);
|
||||
}
|
||||
|
||||
// I think this doesn't have to be propagated to child windows.
|
||||
void wxGLCanvas::OnPaletteChanged(wxPaletteChangedEvent& event)
|
||||
{
|
||||
/* realize palette if this is *not* the current window */
|
||||
if ( GetPalette() &&
|
||||
GetPalette()->Ok() && (this != event.GetChangedWindow()) )
|
||||
{
|
||||
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
|
||||
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
|
||||
::RealizePalette((HDC) GetHDC());
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
/* Give extensions proper function names. */
|
||||
|
||||
/* EXT_vertex_array */
|
||||
void glArrayElementEXT(GLint i)
|
||||
{
|
||||
}
|
||||
|
||||
void glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
|
||||
{
|
||||
#ifdef GL_EXT_vertex_array
|
||||
static PFNGLDRAWARRAYSEXTPROC proc = 0;
|
||||
|
||||
if ( !proc )
|
||||
{
|
||||
proc = (PFNGLDRAWARRAYSEXTPROC) wglGetProcAddress("glDrawArraysEXT");
|
||||
}
|
||||
|
||||
if ( proc )
|
||||
(* proc) (mode, first, count);
|
||||
#endif
|
||||
}
|
||||
|
||||
void glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glGetPointervEXT(GLenum pname, GLvoid* *params)
|
||||
{
|
||||
}
|
||||
|
||||
void glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
#ifdef GL_EXT_vertex_array
|
||||
static PFNGLNORMALPOINTEREXTPROC proc = 0;
|
||||
|
||||
if ( !proc )
|
||||
{
|
||||
proc = (PFNGLNORMALPOINTEREXTPROC) wglGetProcAddress("glNormalPointerEXT");
|
||||
}
|
||||
|
||||
if ( proc )
|
||||
(* proc) (type, stride, count, pointer);
|
||||
#endif
|
||||
}
|
||||
|
||||
void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
#ifdef GL_EXT_vertex_array
|
||||
static PFNGLVERTEXPOINTEREXTPROC proc = 0;
|
||||
|
||||
if ( !proc )
|
||||
{
|
||||
proc = (PFNGLVERTEXPOINTEREXTPROC) wglGetProcAddress("glVertexPointerEXT");
|
||||
}
|
||||
if ( proc )
|
||||
(* proc) (size, type, stride, count, pointer);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* EXT_color_subtable */
|
||||
void glColorSubtableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table)
|
||||
{
|
||||
}
|
||||
|
||||
/* EXT_color_table */
|
||||
void glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
|
||||
{
|
||||
}
|
||||
|
||||
void glCopyColorTableEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table)
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTableParamaterfvEXT(GLenum target, GLenum pname, GLfloat *params)
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTavleParameterivEXT(GLenum target, GLenum pname, GLint *params)
|
||||
{
|
||||
}
|
||||
|
||||
/* SGI_compiled_vertex_array */
|
||||
void glLockArraysSGI(GLint first, GLsizei count)
|
||||
{
|
||||
}
|
||||
|
||||
void glUnlockArraysSGI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* SGI_cull_vertex */
|
||||
void glCullParameterdvSGI(GLenum pname, GLdouble* params)
|
||||
{
|
||||
}
|
||||
|
||||
void glCullParameterfvSGI(GLenum pname, GLfloat* params)
|
||||
{
|
||||
}
|
||||
|
||||
/* SGI_index_func */
|
||||
void glIndexFuncSGI(GLenum func, GLclampf ref)
|
||||
{
|
||||
}
|
||||
|
||||
/* SGI_index_material */
|
||||
void glIndexMaterialSGI(GLenum face, GLenum mode)
|
||||
{
|
||||
}
|
||||
|
||||
/* WIN_swap_hint */
|
||||
void glAddSwapHintRectWin(GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxGLApp
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(wxGLApp, wxApp)
|
||||
|
||||
bool wxGLApp::InitGLVisual(int *attribList)
|
||||
{
|
||||
int pixelFormat;
|
||||
PIXELFORMATDESCRIPTOR pfd = {
|
||||
sizeof(PIXELFORMATDESCRIPTOR), /* size */
|
||||
1, /* version */
|
||||
PFD_SUPPORT_OPENGL |
|
||||
PFD_DRAW_TO_WINDOW |
|
||||
PFD_DOUBLEBUFFER, /* support double-buffering */
|
||||
PFD_TYPE_RGBA, /* color type */
|
||||
16, /* prefered color depth */
|
||||
0, 0, 0, 0, 0, 0, /* color bits (ignored) */
|
||||
0, /* no alpha buffer */
|
||||
0, /* alpha bits (ignored) */
|
||||
0, /* no accumulation buffer */
|
||||
0, 0, 0, 0, /* accum bits (ignored) */
|
||||
16, /* depth buffer */
|
||||
0, /* no stencil buffer */
|
||||
0, /* no auxiliary buffers */
|
||||
PFD_MAIN_PLANE, /* main layer */
|
||||
0, /* reserved */
|
||||
0, 0, 0, /* no layer, visible, damage masks */
|
||||
};
|
||||
|
||||
AdjustPFDForAttributes(pfd, attribList);
|
||||
|
||||
// use DC for whole (root) screen, since no windows have yet been created
|
||||
pixelFormat = ChoosePixelFormat(ScreenHDC(), &pfd);
|
||||
|
||||
if (pixelFormat == 0) {
|
||||
wxLogError(_("Failed to initialize OpenGL"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxGLApp::~wxGLApp()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_GLCANVAS
|
@@ -1,162 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: glcanvas.h
|
||||
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Windows
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "glcanvas.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WX_GLCANVAS_H_
|
||||
#define _WX_GLCANVAS_H_
|
||||
|
||||
#include <wx/setup.h>
|
||||
#undef wxUSE_GLCANVAS
|
||||
#define wxUSE_GLCANVAS 1
|
||||
|
||||
#include <wx/palette.h>
|
||||
#include <wx/scrolwin.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include "wx/msw/winundef.h"
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Constants for attriblist
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// The generic GL implementation doesn't support most of these options,
|
||||
// such as stereo, auxiliary buffers, alpha channel, and accum buffer.
|
||||
// Other implementations may actually support them.
|
||||
|
||||
enum
|
||||
{
|
||||
WX_GL_RGBA=1, /* use true color palette */
|
||||
WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
|
||||
WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
|
||||
WX_GL_DOUBLEBUFFER, /* use doublebuffer */
|
||||
WX_GL_STEREO, /* use stereoscopic display */
|
||||
WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
|
||||
WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
|
||||
WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
|
||||
WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
|
||||
WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
|
||||
WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
|
||||
WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
|
||||
WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
|
||||
WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
|
||||
WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
|
||||
WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
|
||||
};
|
||||
|
||||
class wxGLCanvas; /* forward reference */
|
||||
|
||||
class wxGLContext: public wxObject
|
||||
{
|
||||
public:
|
||||
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
|
||||
wxGLContext(
|
||||
bool isRGB, wxGLCanvas *win,
|
||||
const wxPalette& WXUNUSED(palette),
|
||||
const wxGLContext *other /* for sharing display lists */
|
||||
);
|
||||
~wxGLContext();
|
||||
|
||||
void SetCurrent();
|
||||
void SetColour(const wxChar *colour);
|
||||
void SwapBuffers();
|
||||
|
||||
|
||||
inline wxWindow* GetWindow() const { return m_window; }
|
||||
inline WXHDC GetHDC() const { return m_hDC; }
|
||||
inline HGLRC GetGLRC() const { return m_glContext; }
|
||||
|
||||
public:
|
||||
HGLRC m_glContext;
|
||||
WXHDC m_hDC;
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
|
||||
extern const wxChar* wxGLCanvasName;
|
||||
|
||||
|
||||
class wxGLCanvas: public wxWindow
|
||||
{
|
||||
DECLARE_CLASS(wxGLCanvas)
|
||||
public:
|
||||
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
|
||||
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
|
||||
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0, const wxString&
|
||||
name = wxGLCanvasName,
|
||||
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
|
||||
|
||||
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
|
||||
|
||||
~wxGLCanvas();
|
||||
|
||||
// Replaces wxWindow::Create functionality, since we need to use a different window class
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
|
||||
|
||||
void SetCurrent();
|
||||
void SetColour(const wxChar *colour);
|
||||
void SwapBuffers();
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
|
||||
void OnPaletteChanged(wxPaletteChangedEvent& event);
|
||||
|
||||
inline wxGLContext* GetContext() const { return m_glContext; }
|
||||
|
||||
inline WXHDC GetHDC() const { return m_hDC; }
|
||||
void SetupPixelFormat(int *attribList = (int*) NULL);
|
||||
void SetupPalette(const wxPalette& palette);
|
||||
wxPalette CreateDefaultPalette();
|
||||
|
||||
inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
|
||||
|
||||
protected:
|
||||
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
|
||||
wxPalette m_palette;
|
||||
WXHDC m_hDC;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxGLApp : public wxApp
|
||||
{
|
||||
public:
|
||||
wxGLApp() : wxApp() { }
|
||||
virtual ~wxGLApp();
|
||||
|
||||
// use this in the constructor of the user-derived wxGLApp class to
|
||||
// determine if an OpenGL rendering context with these attributes
|
||||
// is available - returns TRUE if so, FALSE if not.
|
||||
bool InitGLVisual(int *attribList);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGLApp)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_GLCANVAS_H_
|
||||
|
@@ -1,17 +0,0 @@
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
// For MSW I keep my own copy of the glcanvas code. This lets me build
|
||||
// the main wxWindows library without OpenGL support and the DLL
|
||||
// depenencies that go along with it. The DLL dependencies will then
|
||||
// be localized to this extension module, will not need to be loaded
|
||||
// when the core is started up, and won't make the core unrunnable on
|
||||
// systems that don't have OpenGL.
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "msw/myglcanvas.h"
|
||||
#else
|
||||
#include <wx/glcanvas.h>
|
||||
#endif
|
Reference in New Issue
Block a user