![]() |
Blender V2.61 - r43446
|
#include <Python.h>#include "bgl.h"#include <GL/glew.h>#include "MEM_guardedalloc.h"#include "BLI_utildefines.h"Go to the source code of this file.
Defines | |
| #define | BGL_Wrap(nargs, funcname, ret, arg_list) |
| #define | BGLU_Wrap(nargs, funcname, ret, arg_list) |
| #define | MAX_DIMENSIONS 256 |
| #define | MethodDef(func) {"gl"#func, Method_##func, METH_VARARGS, "no string"} |
| #define | MethodDefu(func) {"glu"#func, Method_##func, METH_VARARGS, "no string"} |
| #define | EXPP_ADDCONST(x) PyDict_SetItemString(dict, #x, item=PyLong_FromLong((int)x)); Py_DECREF(item) |
Functions | |
| static PyObject * | Buffer_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
| static int | Buffer_len (Buffer *self) |
| static PyObject * | Buffer_item (Buffer *self, int i) |
| static PyObject * | Buffer_slice (Buffer *self, int begin, int end) |
| static int | Buffer_ass_item (Buffer *self, int i, PyObject *v) |
| static int | Buffer_ass_slice (Buffer *self, int begin, int end, PyObject *seq) |
| static PyObject * | Buffer_subscript (Buffer *self, PyObject *item) |
| static int | Buffer_ass_subscript (Buffer *self, PyObject *item, PyObject *value) |
| static void | Buffer_dealloc (Buffer *self) |
| static PyObject * | Buffer_repr (Buffer *self) |
| static PyObject * | Buffer_to_list (Buffer *self) |
| static PyObject * | Buffer_to_list_recursive (Buffer *self) |
| static PyObject * | Buffer_dimensions (Buffer *self, void *UNUSED(arg)) |
| int | BGL_typeSize (int type) |
| Buffer * | BGL_MakeBuffer (int type, int ndimensions, int *dimensions, void *initbuffer) |
| static PyObject * | Buffer_new (PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) |
| BGL_Wrap (BGL_Wrap(2, Accum, BGL_Wrap(void,(GLenum, GLfloat)) | |
| PyObject * | BPyInit_bgl (void) |
Variables | |
| static PySequenceMethods | Buffer_SeqMethods |
| static PyMappingMethods | Buffer_AsMapping |
| static PyMethodDef | Buffer_methods [] |
| static PyGetSetDef | Buffer_getseters [] |
| PyTypeObject | BGL_bufferType |
| static struct PyModuleDef | BGL_module_def |
This file is the 'bgl' module which wraps OpenGL functions and constants, allowing script writers to make OpenGL calls in their Python scripts.
Definition in file bgl.c.
| #define BGL_Wrap | ( | nargs, | |
| funcname, | |||
| ret, | |||
| arg_list | |||
| ) |
static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) \ { \ arg_def##nargs arg_list; \ ret_def_##ret; \ if (!PyArg_ParseTuple(args, \ arg_str##nargs arg_list, \ arg_ref##nargs arg_list)) \ { \ return NULL; \ } \ ret_set_##ret gl##funcname (arg_var##nargs arg_list); \ ret_ret_##ret; \ }
| #define BGLU_Wrap | ( | nargs, | |
| funcname, | |||
| ret, | |||
| arg_list | |||
| ) |
static PyObject *Method_##funcname (PyObject *UNUSED(self), PyObject *args) \ { \ arg_def##nargs arg_list; \ ret_def_##ret; \ if (!PyArg_ParseTuple(args, \ arg_str##nargs arg_list, \ arg_ref##nargs arg_list)) \ { \ return NULL; \ } \ ret_set_##ret glu##funcname (arg_var##nargs arg_list); \ ret_ret_##ret; \ }
| #define EXPP_ADDCONST | ( | x | ) | PyDict_SetItemString(dict, #x, item=PyLong_FromLong((int)x)); Py_DECREF(item) |
Referenced by BPyInit_bgl().
| #define MAX_DIMENSIONS 256 |
Definition at line 288 of file bgl.c.
Referenced by Buffer_new().
| #define MethodDef | ( | func | ) | {"gl"#func, Method_##func, METH_VARARGS, "no string"} |
Referenced by BGL_Wrap().
| #define MethodDefu | ( | func | ) | {"glu"#func, Method_##func, METH_VARARGS, "no string"} |
Referenced by BGL_Wrap().
| Buffer* BGL_MakeBuffer | ( | int | type, |
| int | ndimensions, | ||
| int * | dimensions, | ||
| void * | initbuffer | ||
| ) | [read] |
Definition at line 256 of file bgl.c.
References _Buffer::asvoid, BGL_typeSize(), _Buffer::buf, _Buffer::dimensions, i, length(), MEM_mallocN(), _Buffer::ndimensions, NULL, _Buffer::parent, size(), and _Buffer::type.
Referenced by Buffer_new(), and Image_getImage().
| int BGL_typeSize | ( | int | type | ) |
Definition at line 239 of file bgl.c.
Referenced by BGL_MakeBuffer(), Buffer_item(), and testBGLBuffer().
| BGL_Wrap | ( | BGL_Wrap( | 2, |
| Accum | , | ||
| BGL_Wrap( | void, | ||
| (GLenum, GLfloat) | |||
| ) |
Definition at line 613 of file bgl.c.
References MethodDef, MethodDefu, and NULL.
| PyObject* BPyInit_bgl | ( | void | ) |
Definition at line 1296 of file bgl.c.
References EXPP_ADDCONST, and NULL.
| static int Buffer_ass_item | ( | Buffer * | self, |
| int | i, | ||
| PyObject * | v | ||
| ) | [static] |
Definition at line 435 of file bgl.c.
References Buffer_ass_slice(), Buffer_item(), and _Buffer::dimensions.
Referenced by Buffer_ass_slice(), and Buffer_ass_subscript().
| static int Buffer_ass_slice | ( | Buffer * | self, |
| int | begin, | ||
| int | end, | ||
| PyObject * | seq | ||
| ) | [static] |
Definition at line 472 of file bgl.c.
References Buffer_ass_item(), and err.
Referenced by Buffer_ass_item(), Buffer_ass_subscript(), and Buffer_new().
| static int Buffer_ass_subscript | ( | Buffer * | self, |
| PyObject * | item, | ||
| PyObject * | value | ||
| ) | [static] |
Definition at line 548 of file bgl.c.
References Buffer_ass_item(), Buffer_ass_slice(), i, and step().
| static void Buffer_dealloc | ( | Buffer * | self | ) | [static] |
Definition at line 581 of file bgl.c.
References MEM_freeN().
| static PyObject* Buffer_dimensions | ( | Buffer * | self, |
| void * | UNUSEDarg | ||
| ) | [static] |
| static PyObject * Buffer_item | ( | Buffer * | self, |
| int | i | ||
| ) | [static] |
Definition at line 373 of file bgl.c.
References _Buffer::asvoid, BGL_typeSize(), _Buffer::buf, _Buffer::dimensions, length(), MEM_mallocN(), _Buffer::ndimensions, NULL, _Buffer::parent, size(), and _Buffer::type.
Referenced by Buffer_ass_item(), Buffer_slice(), Buffer_subscript(), Buffer_to_list(), and Buffer_to_list_recursive().
| static PyObject* Buffer_new | ( | PyTypeObject * | UNUSEDtype, |
| PyObject * | args, | ||
| PyObject * | kwds | ||
| ) | [static] |
Definition at line 289 of file bgl.c.
References BGL_MakeBuffer(), Buffer_ass_slice(), ELEM5, i, init(), MAX_DIMENSIONS, NULL, and STRINGIFY.
| static PyObject* Buffer_new | ( | PyTypeObject * | type, |
| PyObject * | args, | ||
| PyObject * | kwds | ||
| ) | [static] |
| static PyObject * Buffer_repr | ( | Buffer * | self | ) | [static] |
Definition at line 592 of file bgl.c.
References Buffer_to_list_recursive().
| static PyObject * Buffer_slice | ( | Buffer * | self, |
| int | begin, | ||
| int | end | ||
| ) | [static] |
| static PyObject * Buffer_subscript | ( | Buffer * | self, |
| PyObject * | item | ||
| ) | [static] |
Definition at line 511 of file bgl.c.
References Buffer_item(), Buffer_slice(), i, NULL, and step().
| static PyObject* Buffer_to_list | ( | Buffer * | self | ) | [static] |
Definition at line 81 of file bgl.c.
References Buffer_item(), i, and len().
Referenced by Buffer_to_list_recursive().
| static PyObject* Buffer_to_list_recursive | ( | Buffer * | self | ) | [static] |
Definition at line 93 of file bgl.c.
References Buffer_item(), Buffer_to_list(), i, and len().
Referenced by Buffer_repr().
| PyTypeObject BGL_bufferType |
struct PyModuleDef BGL_module_def [static] |
PyMappingMethods Buffer_AsMapping [static] |
{
(lenfunc)Buffer_len,
(binaryfunc)Buffer_subscript,
(objobjargproc)Buffer_ass_subscript
}
PyGetSetDef Buffer_getseters[] [static] |
PyMethodDef Buffer_methods[] [static] |
{
{"to_list", (PyCFunction)Buffer_to_list_recursive, METH_NOARGS,
"return the buffer as a list"},
{NULL, NULL, 0, NULL}
}
PySequenceMethods Buffer_SeqMethods [static] |
{
(lenfunc) Buffer_len,
(binaryfunc) NULL,
(ssizeargfunc) NULL,
(ssizeargfunc) Buffer_item,
(ssizessizeargfunc) NULL,
(ssizeobjargproc) Buffer_ass_item,
(ssizessizeobjargproc) NULL,
(objobjproc) NULL,
(binaryfunc) NULL,
(ssizeargfunc) NULL,
}