summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-05 20:09:38 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-05 22:47:44 -0600
commit6c2943e735c99579b5b861f67f2d98e5ddd6306f (patch)
treee882a1dda2726dd9dfca3fe2dd44750b17b1edda /libdimension/dimension
parentb14506e501770aeaf54d1160c0073398cc29a038 (diff)
downloaddimension-6c2943e735c99579b5b861f67f2d98e5ddd6306f.tar.xz
Use C99 for loop initializers.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/canvas.h12
-rw-r--r--libdimension/dimension/gl.h4
2 files changed, 9 insertions, 7 deletions
diff --git a/libdimension/dimension/canvas.h b/libdimension/dimension/canvas.h
index 306b55c..7caae69 100644
--- a/libdimension/dimension/canvas.h
+++ b/libdimension/dimension/canvas.h
@@ -25,9 +25,11 @@
#ifndef DIMENSION_CANVAS_H
#define DIMENSION_CANVAS_H
+#include <stddef.h>
+
typedef struct {
/* width, height */
- unsigned int x, y;
+ size_t x, y;
/* An array of dmnsn_canvas_optimizer's */
dmnsn_array *optimizers;
@@ -45,7 +47,7 @@ typedef struct dmnsn_canvas_optimizer dmnsn_canvas_optimizer;
/* Canvas optimizer callback types */
typedef void dmnsn_canvas_optimizer_fn(dmnsn_canvas *canvas,
dmnsn_canvas_optimizer optimizer,
- unsigned int x, unsigned int y);
+ size_t x, size_t y);
/* Canvas optimizer */
struct dmnsn_canvas_optimizer {
@@ -58,7 +60,7 @@ struct dmnsn_canvas_optimizer {
};
/* Allocate and free a canvas */
-dmnsn_canvas *dmnsn_new_canvas(unsigned int x, unsigned int y);
+dmnsn_canvas *dmnsn_new_canvas(size_t x, size_t y);
void dmnsn_delete_canvas(dmnsn_canvas *canvas);
/* Set a canvas optimizer */
@@ -68,12 +70,12 @@ void dmnsn_optimize_canvas(dmnsn_canvas *canvas,
/* Pixel accessors */
DMNSN_INLINE dmnsn_color
-dmnsn_get_pixel(const dmnsn_canvas *canvas, unsigned int x, unsigned int y)
+dmnsn_get_pixel(const dmnsn_canvas *canvas, size_t x, size_t y)
{
return canvas->pixels[y*canvas->x + x];
}
-void dmnsn_set_pixel(dmnsn_canvas *canvas, unsigned int x, unsigned int y,
+void dmnsn_set_pixel(dmnsn_canvas *canvas, size_t x, size_t y,
dmnsn_color color);
void dmnsn_clear_canvas(dmnsn_canvas *canvas, dmnsn_color color);
diff --git a/libdimension/dimension/gl.h b/libdimension/dimension/gl.h
index fb68229..d1b23f7 100644
--- a/libdimension/dimension/gl.h
+++ b/libdimension/dimension/gl.h
@@ -33,7 +33,7 @@ int dmnsn_gl_optimize_canvas(dmnsn_canvas *canvas);
int dmnsn_gl_write_canvas(const dmnsn_canvas *canvas);
/* Read a canvas from a GL framebuffer. Returns NULL on failure. */
-dmnsn_canvas *dmnsn_gl_read_canvas(unsigned int x0, unsigned int y0,
- unsigned int width, unsigned int height);
+dmnsn_canvas *dmnsn_gl_read_canvas(size_t x0, size_t y0,
+ size_t width, size_t height);
#endif /* DIMENSION_GL_H */