summaryrefslogtreecommitdiffstats
path: root/libdimension-python/Canvas.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-05-22 14:22:07 -0600
committerTavian Barnes <tavianator@gmail.com>2011-05-22 14:22:07 -0600
commit1bf306d4d93cc21c220a3f31835023e49e84dd2d (patch)
tree436959a8321100a3c36e8eef9a19279cb446e1fa /libdimension-python/Canvas.c
parent0f0b704144bddc045657f7ed852b49d5e349b0bd (diff)
downloaddimension-1bf306d4d93cc21c220a3f31835023e49e84dd2d.tar.xz
Add cameras, objects, and spheres to Python module.
Diffstat (limited to 'libdimension-python/Canvas.c')
-rw-r--r--libdimension-python/Canvas.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libdimension-python/Canvas.c b/libdimension-python/Canvas.c
index 6cce310..c5063d0 100644
--- a/libdimension-python/Canvas.c
+++ b/libdimension-python/Canvas.c
@@ -18,8 +18,7 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
-#include "Color.h"
-#include "Canvas.h"
+#include "dimension-python.h"
static int
dmnsn_py_Canvas_init(dmnsn_py_Canvas *self, PyObject *args, PyObject *kwds)
@@ -74,13 +73,13 @@ dmnsn_py_Canvas_optimizeGL(dmnsn_py_Canvas *self)
}
static PyObject *
-dmnsn_py_Canvas_clear(dmnsn_py_Canvas *self, PyObject *args, PyObject *kwds)
+dmnsn_py_Canvas_clear(dmnsn_py_Canvas *self, PyObject *args)
{
- dmnsn_color color;
- if (!dmnsn_py_Color_args(&color, args, kwds))
+ dmnsn_py_Color *color;
+ if (!PyArg_ParseTuple(args, "O!", &dmnsn_py_ColorType, &color))
return NULL;
- dmnsn_clear_canvas(self->canvas, color);
+ dmnsn_clear_canvas(self->canvas, color->c);
Py_INCREF(Py_None);
return Py_None;
@@ -124,7 +123,7 @@ static PyMethodDef dmnsn_py_Canvas_methods[] = {
"Optimize a canvas for PNG output" },
{ "optimizeGL", (PyCFunction)dmnsn_py_Canvas_optimizeGL, METH_NOARGS,
"Optimize a canvas for OpenGL output" },
- { "clear", (PyCFunction)dmnsn_py_Canvas_clear, METH_VARARGS | METH_KEYWORDS,
+ { "clear", (PyCFunction)dmnsn_py_Canvas_clear, METH_VARARGS,
"Clear a canvas with a solid color" },
{ "writePNG", (PyCFunction)dmnsn_py_Canvas_writePNG, METH_VARARGS,
"Write a canvas to a PNG file" },