Blender  V2.59
Defines | Functions | Variables
bgl.c File Reference
#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_list (Buffer *self, void *UNUSED(arg))
static PyObject * Buffer_dimensions (Buffer *self, void *UNUSED(arg))
int BGL_typeSize (int type)
BufferBGL_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

Detailed Description

Definition in file bgl.c.


Define Documentation

#define BGL_Wrap (   nargs,
  funcname,
  ret,
  arg_list 
)
Value:
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; \
}

Definition at line 222 of file bgl.c.

#define BGLU_Wrap (   nargs,
  funcname,
  ret,
  arg_list 
)
Value:
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; \
}

Definition at line 231 of file bgl.c.

#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 292 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().


Function Documentation

Buffer* BGL_MakeBuffer ( int  type,
int  ndimensions,
int *  dimensions,
void *  initbuffer 
) [read]
int BGL_typeSize ( int  type)

Definition at line 243 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 617 of file bgl.c.

References MethodDef, MethodDefu, and NULL.

PyObject* BPyInit_bgl ( void  )

Definition at line 1300 of file bgl.c.

References EXPP_ADDCONST, and NULL.

static int Buffer_ass_item ( Buffer self,
int  i,
PyObject *  v 
) [static]

Definition at line 439 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 476 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 552 of file bgl.c.

References Buffer_ass_item(), Buffer_ass_slice(), and i.

static void Buffer_dealloc ( Buffer self) [static]

Definition at line 585 of file bgl.c.

References MEM_freeN().

static PyObject* Buffer_dimensions ( Buffer self,
void *  UNUSEDarg 
) [static]

Definition at line 124 of file bgl.c.

References i.

static PyObject * Buffer_item ( Buffer self,
int  i 
) [static]
static int Buffer_len ( Buffer self) [static]

Definition at line 372 of file bgl.c.

static PyObject* Buffer_list ( Buffer self,
void *  UNUSEDarg 
) [static]

Definition at line 118 of file bgl.c.

References Buffer_to_list().

static PyObject* Buffer_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]
static PyObject* Buffer_new ( PyTypeObject *  UNUSEDtype,
PyObject *  args,
PyObject *  kwds 
) [static]

Definition at line 293 of file bgl.c.

References BGL_MakeBuffer(), Buffer_ass_slice(), ELEM5, i, init(), MAX_DIMENSIONS, NULL, and STRINGIFY.

static PyObject * Buffer_repr ( Buffer self) [static]

Definition at line 596 of file bgl.c.

References Buffer_to_list_recursive().

static PyObject * Buffer_slice ( Buffer self,
int  begin,
int  end 
) [static]

Definition at line 422 of file bgl.c.

References Buffer_item().

Referenced by Buffer_subscript().

static PyObject * Buffer_subscript ( Buffer self,
PyObject *  item 
) [static]

Definition at line 515 of file bgl.c.

References Buffer_item(), Buffer_slice(), i, and NULL.

static PyObject* Buffer_to_list ( Buffer self) [static]

Definition at line 84 of file bgl.c.

References Buffer_item(), and i.

Referenced by Buffer_list(), and Buffer_to_list_recursive().

static PyObject* Buffer_to_list_recursive ( Buffer self) [static]

Definition at line 96 of file bgl.c.

References Buffer_item(), Buffer_to_list(), and i.

Referenced by Buffer_repr().


Variable Documentation

PyTypeObject BGL_bufferType

Definition at line 149 of file bgl.c.

Referenced by load(), and plot().

struct PyModuleDef BGL_module_def [static]
Initial value:
 {
        PyModuleDef_HEAD_INIT,
        "bgl",  
        NULL,  
        0,  
        BGL_methods,  
        NULL,  
        NULL,  
        NULL,  
        NULL,  
}

Definition at line 1287 of file bgl.c.

PyMappingMethods Buffer_AsMapping [static]
Initial value:
 {
        (lenfunc)Buffer_len,
        (binaryfunc)Buffer_subscript,
        (objobjargproc)Buffer_ass_subscript
}

Definition at line 75 of file bgl.c.

PyGetSetDef Buffer_getseters[] [static]
Initial value:
 {
        {(char *)"list", (getter)Buffer_list, NULL, NULL, NULL},
        {(char *)"dimensions", (getter)Buffer_dimensions, NULL, NULL, NULL},
         {NULL, NULL, NULL, NULL, NULL}
}

Definition at line 142 of file bgl.c.

PyMethodDef Buffer_methods[] [static]
Initial value:
 {
        {"to_list", (PyCFunction)Buffer_to_list_recursive, METH_NOARGS,
     "return the buffer as a list"},
        {NULL, NULL, 0, NULL}
}

Definition at line 136 of file bgl.c.

PySequenceMethods Buffer_SeqMethods [static]
Initial value:
 {
        (lenfunc) Buffer_len,                                           
        (binaryfunc) NULL,                                                      
        (ssizeargfunc) NULL,                                            
        (ssizeargfunc) Buffer_item,                                     
        (ssizessizeargfunc) Buffer_slice,                       
        (ssizeobjargproc) Buffer_ass_item,                      
        (ssizessizeobjargproc) Buffer_ass_slice,        
        (objobjproc) NULL,                                                      
        (binaryfunc) NULL,                                                      
        (ssizeargfunc) NULL,                                            
}

Definition at line 61 of file bgl.c.