summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-02-10 01:57:32 +0000
committerRobert Bragg <robert@linux.intel.com>2010-02-12 14:05:00 +0000
commit0f5f4e8645d12eb6c5ff99c13503f2380740bb10 (patch)
tree608ac1afdc5924f097bd6e140c6fc887070eb533
parent10fa7c7ce9a69b733e4652a51e101a98911d5bb8 (diff)
downloadcogl-0f5f4e8645d12eb6c5ff99c13503f2380740bb10.tar.gz
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so this is a first pass at tidying things up by giving them some consistency. These changes are all consistent with how new code in Cogl is being written, but the style isn't consistently applied across all code yet. There are two parts to this patch; but since each one required a large amount of effort to maintain tidy indenting it made sense to combine the changes to reduce the time spent re indenting the same lines. The first change is to use a consistent style for declaring function prototypes in headers. Cogl headers now consistently use this style for prototypes: return_type cogl_function_name (CoglType arg0, CoglType arg1); Not everyone likes this style, but it seems that most of the currently active Cogl developers agree on it. The second change is to constrain the use of redundant glib data types in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all been replaced with int, unsigned int, float, long, unsigned long and char respectively. When talking about pixel data; use of guchar has been replaced with guint8, otherwise unsigned char can be used. The glib types that we continue to use for portability are gboolean, gint{8,16,32,64}, guint{8,16,32,64} and gsize. The general intention is that Cogl should look palatable to the widest range of C programmers including those outside the Gnome community so - especially for the public API - we want to minimize the number of foreign looking typedefs.
-rw-r--r--cogl/cogl-atlas-texture.c52
-rw-r--r--cogl/cogl-atlas.c22
-rw-r--r--cogl/cogl-atlas.h18
-rw-r--r--cogl/cogl-bitmap-fallback.c82
-rw-r--r--cogl/cogl-bitmap-pixbuf.c60
-rw-r--r--cogl/cogl-bitmap-private.h30
-rw-r--r--cogl/cogl-bitmap.c34
-rw-r--r--cogl/cogl-bitmap.h15
-rw-r--r--cogl/cogl-blend-string.c12
-rw-r--r--cogl/cogl-blend-string.h4
-rw-r--r--cogl/cogl-buffer-private.h14
-rw-r--r--cogl/cogl-buffer.c8
-rw-r--r--cogl/cogl-buffer.h26
-rw-r--r--cogl/cogl-clip-stack.c16
-rw-r--r--cogl/cogl-clip-stack.h14
-rw-r--r--cogl/cogl-color.h75
-rw-r--r--cogl/cogl-context.c2
-rw-r--r--cogl/cogl-context.h10
-rw-r--r--cogl/cogl-debug.c8
-rw-r--r--cogl/cogl-debug.h4
-rw-r--r--cogl/cogl-feature-private.c19
-rw-r--r--cogl/cogl-feature-private.h14
-rw-r--r--cogl/cogl-fixed.c24
-rw-r--r--cogl/cogl-fixed.h72
-rw-r--r--cogl/cogl-handle.h2
-rw-r--r--cogl/cogl-internal.h32
-rw-r--r--cogl/cogl-journal.c26
-rw-r--r--cogl/cogl-material-private.h67
-rw-r--r--cogl/cogl-material.c22
-rw-r--r--cogl/cogl-material.h175
-rw-r--r--cogl/cogl-matrix.h110
-rw-r--r--cogl/cogl-path.h138
-rw-r--r--cogl/cogl-pixel-buffer-private.h9
-rw-r--r--cogl/cogl-pixel-buffer.c53
-rw-r--r--cogl/cogl-pixel-buffer.h46
-rw-r--r--cogl/cogl-primitives.c48
-rw-r--r--cogl/cogl-primitives.h13
-rw-r--r--cogl/cogl-shader.h96
-rw-r--r--cogl/cogl-sub-texture-private.h14
-rw-r--r--cogl/cogl-sub-texture.c70
-rw-r--r--cogl/cogl-texture-2d-private.h4
-rw-r--r--cogl/cogl-texture-2d-sliced-private.h6
-rw-r--r--cogl/cogl-texture-2d-sliced.c163
-rw-r--r--cogl/cogl-texture-2d.c34
-rw-r--r--cogl/cogl-texture-private.h6
-rw-r--r--cogl/cogl-texture.c106
-rw-r--r--cogl/cogl-texture.h220
-rw-r--r--cogl/cogl-types.h15
-rw-r--r--cogl/cogl-util.c30
-rw-r--r--cogl/cogl-vertex-buffer-private.h2
-rw-r--r--cogl/cogl-vertex-buffer.c18
-rw-r--r--cogl/cogl-vertex-buffer.h6
-rw-r--r--cogl/cogl.c52
-rw-r--r--cogl/cogl.h310
-rw-r--r--cogl/driver/gl/cogl-program.c18
-rw-r--r--cogl/driver/gl/cogl-shader.c2
-rw-r--r--cogl/driver/gl/cogl-texture-driver.c2
-rw-r--r--cogl/driver/gl/cogl.c8
-rw-r--r--cogl/driver/gles/cogl-gles2-wrapper.c6
-rw-r--r--cogl/driver/gles/cogl-gles2-wrapper.h12
-rw-r--r--cogl/driver/gles/cogl-program.c42
-rw-r--r--cogl/driver/gles/cogl-shader.c4
-rw-r--r--cogl/driver/gles/cogl-texture-driver.c4
-rw-r--r--doc/CODING_STYLE49
64 files changed, 1491 insertions, 1184 deletions
diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index f8459476..9f94e209 100644
--- a/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl-atlas-texture.c
@@ -92,8 +92,8 @@ typedef struct _CoglAtlasTextureBlitData
complete texture data in */
unsigned char *image_data;
CoglPixelFormat format;
- gint bpp;
- guint src_height, src_width;
+ int bpp;
+ unsigned int src_height, src_width;
GLenum dst_gl_target;
} CoglAtlasTextureBlitData;
@@ -169,12 +169,12 @@ _cogl_atlas_texture_blit_begin (CoglAtlasTextureBlitData *data,
static void
_cogl_atlas_texture_blit (CoglAtlasTextureBlitData *data,
- guint src_x,
- guint src_y,
- guint dst_x,
- guint dst_y,
- guint width,
- guint height)
+ unsigned int src_x,
+ unsigned int src_y,
+ unsigned int dst_x,
+ unsigned int dst_y,
+ unsigned int width,
+ unsigned int height)
{
/* If we have an FBO then we can do a fast blit */
if (data->fbo)
@@ -269,7 +269,7 @@ _cogl_atlas_texture_free (CoglAtlasTexture *atlas_tex)
cogl_handle_unref (atlas_tex->sub_texture);
}
-static gint
+static int
_cogl_atlas_texture_get_max_waste (CoglTexture *tex)
{
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -506,7 +506,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
pixels to the border */
if (atlas_tex->in_atlas)
{
- gint bpp;
+ int bpp;
CoglBitmap source_bmp;
CoglBitmap tmp_bmp;
gboolean tmp_bmp_owner = FALSE;
@@ -524,7 +524,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
source_bmp.width = width;
source_bmp.height = height;
source_bmp.format = format;
- source_bmp.data = (guchar*) data;
+ source_bmp.data = (guint8 *)data;
/* Rowstride from width if none specified */
bpp = _cogl_get_format_bpp (format);
@@ -604,7 +604,7 @@ _cogl_atlas_texture_get_gl_format (CoglTexture *tex)
return _cogl_texture_get_gl_format (atlas_tex->sub_texture);
}
-static gint
+static int
_cogl_atlas_texture_get_width (CoglTexture *tex)
{
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -613,7 +613,7 @@ _cogl_atlas_texture_get_width (CoglTexture *tex)
return cogl_texture_get_width (atlas_tex->sub_texture);
}
-static gint
+static int
_cogl_atlas_texture_get_height (CoglTexture *tex)
{
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -644,13 +644,13 @@ typedef struct _CoglAtlasTextureRepositionData
} CoglAtlasTextureRepositionData;
static void
-_cogl_atlas_texture_migrate (guint n_textures,
+_cogl_atlas_texture_migrate (unsigned int n_textures,
CoglAtlasTextureRepositionData *textures,
CoglHandle old_texture,
CoglHandle new_texture,
CoglAtlasTexture *skip_texture)
{
- guint i;
+ unsigned int i;
CoglAtlasTextureBlitData blit_data;
_cogl_atlas_texture_blit_begin (&blit_data, new_texture, old_texture);
@@ -686,7 +686,7 @@ typedef struct _CoglAtlasTextureGetRectanglesData
{
CoglAtlasTextureRepositionData *textures;
/* Number of textures found so far */
- guint n_textures;
+ unsigned int n_textures;
} CoglAtlasTextureGetRectanglesData;
static void
@@ -700,8 +700,8 @@ _cogl_atlas_texture_get_rectangles_cb (const CoglAtlasRectangle *rectangle,
}
static void
-_cogl_atlas_texture_get_next_size (guint *atlas_width,
- guint *atlas_height)
+_cogl_atlas_texture_get_next_size (unsigned int *atlas_width,
+ unsigned int *atlas_height)
{
/* Double the size of the texture by increasing whichever dimension
is smaller */
@@ -712,9 +712,9 @@ _cogl_atlas_texture_get_next_size (guint *atlas_width,
}
static CoglAtlas *
-_cogl_atlas_texture_create_atlas (guint atlas_width,
- guint atlas_height,
- guint n_textures,
+_cogl_atlas_texture_create_atlas (unsigned int atlas_width,
+ unsigned int atlas_height,
+ unsigned int n_textures,
CoglAtlasTextureRepositionData *textures)
{
GLint max_texture_size = 1024;
@@ -731,7 +731,7 @@ _cogl_atlas_texture_create_atlas (guint atlas_width,
while (atlas_width < max_texture_size && atlas_height < max_texture_size)
{
CoglAtlas *new_atlas = _cogl_atlas_new (atlas_width, atlas_height, NULL);
- guint i;
+ unsigned int i;
/* Add all of the textures and keep track of the new position */
for (i = 0; i < n_textures; i++)
@@ -763,7 +763,7 @@ _cogl_atlas_texture_compare_size_cb (const void *a,
{
const CoglAtlasTextureRepositionData *ta = a;
const CoglAtlasTextureRepositionData *tb = b;
- guint a_size, b_size;
+ unsigned int a_size, b_size;
a_size = ta->texture->rectangle.width * ta->texture->rectangle.height;
b_size = tb->texture->rectangle.width * tb->texture->rectangle.height;
@@ -773,13 +773,13 @@ _cogl_atlas_texture_compare_size_cb (const void *a,
static gboolean
_cogl_atlas_texture_reserve_space (CoglAtlasTexture *new_sub_tex,
- guint width,
- guint height)
+ unsigned int width,
+ unsigned int height)
{
CoglAtlasTextureGetRectanglesData data;
CoglAtlas *new_atlas;
CoglHandle new_tex;
- guint atlas_width, atlas_height;
+ unsigned int atlas_width, atlas_height;
gboolean ret;
_COGL_GET_CONTEXT (ctx, FALSE);
diff --git a/cogl/cogl-atlas.c b/cogl/cogl-atlas.c
index 47c16598..6e9167de 100644
--- a/cogl/cogl-atlas.c
+++ b/cogl/cogl-atlas.c
@@ -67,8 +67,8 @@ struct _CoglAtlas
{
CoglAtlasNode *root;
- guint space_remaining;
- guint n_rectangles;
+ unsigned int space_remaining;
+ unsigned int n_rectangles;
GDestroyNotify value_destroy_func;
};
@@ -119,7 +119,8 @@ _cogl_atlas_node_free (CoglAtlasNode *node)
}
CoglAtlas *
-_cogl_atlas_new (guint width, guint height,
+_cogl_atlas_new (unsigned int width,
+ unsigned int height,
GDestroyNotify value_destroy_func)
{
CoglAtlas *atlas = g_new (CoglAtlas, 1);
@@ -166,7 +167,7 @@ _cogl_atlas_stack_pop (CoglAtlasStackEntry *stack)
static CoglAtlasNode *
_cogl_atlas_node_split_horizontally (CoglAtlasNode *node,
- guint left_width)
+ unsigned int left_width)
{
/* Splits the node horizontally (according to emacs' definition, not
vim) by converting it to a branch and adding two new leaf
@@ -204,7 +205,7 @@ _cogl_atlas_node_split_horizontally (CoglAtlasNode *node,
static CoglAtlasNode *
_cogl_atlas_node_split_vertically (CoglAtlasNode *node,
- guint top_height)
+ unsigned int top_height)
{
/* Splits the node vertically (according to emacs' definition, not
vim) by converting it to a branch and adding two new leaf
@@ -242,7 +243,8 @@ _cogl_atlas_node_split_vertically (CoglAtlasNode *node,
gboolean
_cogl_atlas_add_rectangle (CoglAtlas *atlas,
- guint width, guint height,
+ unsigned int width,
+ unsigned int height,
gpointer data,
CoglAtlasRectangle *rectangle)
{
@@ -411,25 +413,25 @@ _cogl_atlas_remove_rectangle (CoglAtlas *atlas,
#endif
}
-guint
+unsigned int
_cogl_atlas_get_width (CoglAtlas *atlas)
{
return atlas->root->rectangle.width;
}
-guint
+unsigned int
_cogl_atlas_get_height (CoglAtlas *atlas)
{
return atlas->root->rectangle.height;
}
-guint
+unsigned int
_cogl_atlas_get_remaining_space (CoglAtlas *atlas)
{
return atlas->space_remaining;
}
-guint
+unsigned int
_cogl_atlas_get_n_rectangles (CoglAtlas *atlas)
{
return atlas->n_rectangles;
diff --git a/cogl/cogl-atlas.h b/cogl/cogl-atlas.h
index 00d4a086..768b8350 100644
--- a/cogl/cogl-atlas.h
+++ b/cogl/cogl-atlas.h
@@ -35,17 +35,19 @@ typedef void (* CoglAtlasCallback) (const CoglAtlasRectangle *rectangle,
struct _CoglAtlasRectangle
{
- guint x, y;
- guint width, height;
+ unsigned int x, y;
+ unsigned int width, height;
};
CoglAtlas *
-_cogl_atlas_new (guint width, guint height,
+_cogl_atlas_new (unsigned int width,
+ unsigned int height,
GDestroyNotify value_destroy_func);
gboolean
_cogl_atlas_add_rectangle (CoglAtlas *atlas,
- guint width, guint height,
+ unsigned int width,
+ unsigned int height,
gpointer data,
CoglAtlasRectangle *rectangle);
@@ -53,16 +55,16 @@ void
_cogl_atlas_remove_rectangle (CoglAtlas *atlas,
const CoglAtlasRectangle *rectangle);
-guint
+unsigned int
_cogl_atlas_get_width (CoglAtlas *atlas);
-guint
+unsigned int
_cogl_atlas_get_height (CoglAtlas *atlas);
-guint
+unsigned int
_cogl_atlas_get_remaining_space (CoglAtlas *atlas);
-guint
+unsigned int
_cogl_atlas_get_n_rectangles (CoglAtlas *atlas);
void
diff --git a/cogl/cogl-bitmap-fallback.c b/cogl/cogl-bitmap-fallback.c
index 410a6c13..b4ceca3f 100644
--- a/cogl/cogl-bitmap-fallback.c
+++ b/cogl/cogl-bitmap-fallback.c
@@ -34,7 +34,7 @@
/* TO rgba */
inline static void
-_cogl_g_to_rgba (const guchar *src, guchar *dst)
+_cogl_g_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[0];
dst[1] = src[0];
@@ -43,7 +43,7 @@ _cogl_g_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgb_to_rgba (const guchar *src, guchar *dst)
+_cogl_rgb_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[0];
dst[1] = src[1];
@@ -52,7 +52,7 @@ _cogl_rgb_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_bgr_to_rgba (const guchar *src, guchar *dst)
+_cogl_bgr_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[2];
dst[1] = src[1];
@@ -61,7 +61,7 @@ _cogl_bgr_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_bgra_to_rgba (const guchar *src, guchar *dst)
+_cogl_bgra_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[2];
dst[1] = src[1];
@@ -70,7 +70,7 @@ _cogl_bgra_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_argb_to_rgba (const guchar *src, guchar *dst)
+_cogl_argb_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[1];
dst[1] = src[2];
@@ -79,7 +79,7 @@ _cogl_argb_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_abgr_to_rgba (const guchar *src, guchar *dst)
+_cogl_abgr_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[3];
dst[1] = src[2];
@@ -88,7 +88,7 @@ _cogl_abgr_to_rgba (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgba_to_rgba (const guchar *src, guchar *dst)
+_cogl_rgba_to_rgba (const guint8 *src, guint8 *dst)
{
dst[0] = src[0];
dst[1] = src[1];
@@ -99,13 +99,13 @@ _cogl_rgba_to_rgba (const guchar *src, guchar *dst)
/* FROM rgba */
inline static void
-_cogl_rgba_to_g (const guchar *src, guchar *dst)
+_cogl_rgba_to_g (const guint8 *src, guint8 *dst)
{
dst[0] = (src[0] + src[1] + src[2]) / 3;
}
inline static void
-_cogl_rgba_to_rgb (const guchar *src, guchar *dst)
+_cogl_rgba_to_rgb (const guint8 *src, guint8 *dst)
{
dst[0] = src[0];
dst[1] = src[1];
@@ -113,7 +113,7 @@ _cogl_rgba_to_rgb (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgba_to_bgr (const guchar *src, guchar *dst)
+_cogl_rgba_to_bgr (const guint8 *src, guint8 *dst)
{
dst[0] = src[2];
dst[1] = src[1];
@@ -121,7 +121,7 @@ _cogl_rgba_to_bgr (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgba_to_bgra (const guchar *src, guchar *dst)
+_cogl_rgba_to_bgra (const guint8 *src, guint8 *dst)
{
dst[0] = src[2];
dst[1] = src[1];
@@ -130,7 +130,7 @@ _cogl_rgba_to_bgra (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgba_to_argb (const guchar *src, guchar *dst)
+_cogl_rgba_to_argb (const guint8 *src, guint8 *dst)
{
dst[0] = src[3];
dst[1] = src[0];
@@ -139,7 +139,7 @@ _cogl_rgba_to_argb (const guchar *src, guchar *dst)
}
inline static void
-_cogl_rgba_to_abgr (const guchar *src, guchar *dst)
+_cogl_rgba_to_abgr (const guint8 *src, guint8 *dst)
{
dst[0] = src[3];
dst[1] = src[2];
@@ -150,7 +150,7 @@ _cogl_rgba_to_abgr (const guchar *src, guchar *dst)
/* (Un)Premultiplication */
inline static void
-_cogl_unpremult_alpha_0 (guchar *dst)
+_cogl_unpremult_alpha_0 (guint8 *dst)
{
dst[0] = 0;
dst[1] = 0;
@@ -159,9 +159,9 @@ _cogl_unpremult_alpha_0 (guchar *dst)
}
inline static void
-_cogl_unpremult_alpha_last (guchar *dst)
+_cogl_unpremult_alpha_last (guint8 *dst)
{
- guchar alpha = dst[3];
+ guint8 alpha = dst[3];
dst[0] = (dst[0] * 255) / alpha;
dst[1] = (dst[1] * 255) / alpha;
@@ -169,9 +169,9 @@ _cogl_unpremult_alpha_last (guchar *dst)
}
inline static void
-_cogl_unpremult_alpha_first (guchar *dst)
+_cogl_unpremult_alpha_first (guint8 *dst)
{
- guchar alpha = dst[0];
+ guint8 alpha = dst[0];
dst[1] = (dst[1] * 255) / alpha;
dst[2] = (dst[2] * 255) / alpha;
@@ -189,24 +189,24 @@ _cogl_unpremult_alpha_first (guchar *dst)
} G_STMT_END
inline static void
-_cogl_premult_alpha_last (guchar *dst)
+_cogl_premult_alpha_last (guint8 *dst)
{
- guchar alpha = dst[3];
+ guint8 alpha = dst[3];
/* Using a separate temporary per component has given slightly better
* code generation with GCC in the past; it shouldn't do any worse in
* any case.
*/
- guint t1, t2, t3;
+ unsigned int t1, t2, t3;
MULT(dst[0], alpha, t1);
MULT(dst[1], alpha, t2);
MULT(dst[2], alpha, t3);
}
inline static void
-_cogl_premult_alpha_first (guchar *dst)
+_cogl_premult_alpha_first (guint8 *dst)
{
- guchar alpha = dst[0];
- guint t1, t2, t3;
+ guint8 alpha = dst[0];
+ unsigned int t1, t2, t3;
MULT(dst[1], alpha, t1);
MULT(dst[2], alpha, t2);
@@ -342,12 +342,12 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
CoglBitmap *dst_bmp,
CoglPixelFormat dst_format)
{
- guchar *src;
- guchar *dst;
- gint src_bpp;
- gint dst_bpp;
- gint x,y;
- guchar temp_rgba[4] = {0,0,0,0};
+ guint8 *src;
+ guint8 *dst;
+ int src_bpp;
+ int dst_bpp;
+ int x,y;
+ guint8 temp_rgba[4] = {0,0,0,0};
/* Make sure conversion supported */
if (!_cogl_bitmap_fallback_can_convert (bmp->format, dst_format))
@@ -358,20 +358,20 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
/* Initialize destination bitmap */
*dst_bmp = *bmp;
- dst_bmp->rowstride = sizeof(guchar) * dst_bpp * dst_bmp->width;
+ dst_bmp->rowstride = sizeof(guint8) * dst_bpp * dst_bmp->width;
dst_bmp->format = ((bmp->format & COGL_PREMULT_BIT) |
(dst_format & COGL_UNPREMULT_MASK));
/* Allocate a new buffer to hold converted data */
- dst_bmp->data = g_malloc (sizeof(guchar)
+ dst_bmp->data = g_malloc (sizeof(guint8)
* dst_bmp->height
* dst_bmp->rowstride);
/* FIXME: Optimize */
for (y = 0; y < bmp->height; y++)
{
- src = (guchar*)bmp->data + y * bmp->rowstride;
- dst = (guchar*)dst_bmp->data + y * dst_bmp->rowstride;
+ src = (guint8*)bmp->data + y * bmp->rowstride;
+ dst = (guint8*)dst_bmp->data + y * dst_bmp->rowstride;
for (x = 0; x < bmp->width; x++)
{
@@ -429,8 +429,8 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
gboolean
_cogl_bitmap_fallback_unpremult (CoglBitmap *bmp)
{
- guchar *p;
- gint x,y;
+ guint8 *p;
+ int x,y;
/* Make sure format supported for un-premultiplication */
if (!_cogl_bitmap_fallback_can_unpremult (bmp->format))
@@ -438,7 +438,7 @@ _cogl_bitmap_fallback_unpremult (CoglBitmap *bmp)
for (y = 0; y < bmp->height; y++)
{
- p = (guchar*) bmp->data + y * bmp->rowstride;
+ p = (guint8*) bmp->data + y * bmp->rowstride;
if (bmp->format & COGL_AFIRST_BIT)
{
@@ -472,8 +472,8 @@ _cogl_bitmap_fallback_unpremult (CoglBitmap *bmp)
gboolean
_cogl_bitmap_fallback_premult (CoglBitmap *bmp)
{
- guchar *p;
- gint x,y;
+ guint8 *p;
+ int x,y;
/* Make sure format supported for un-premultiplication */
if (!_cogl_bitmap_fallback_can_premult (bmp->format))
@@ -481,7 +481,7 @@ _cogl_bitmap_fallback_premult (CoglBitmap *bmp)
for (y = 0; y < bmp->height; y++)
{
- p = (guchar*) bmp->data + y * bmp->rowstride;
+ p = (guint8*) bmp->data + y * bmp->rowstride;
if (bmp->format & COGL_AFIRST_BIT)
{
@@ -525,7 +525,7 @@ _cogl_bitmap_fallback_premult (CoglBitmap *bmp)
gboolean
_cogl_bitmap_fallback_from_file (CoglBitmap *bmp,
- const gchar *filename)
+ const char *filename)
{
/* FIXME: use jpeglib, libpng, etc. manually maybe */
return FALSE;
diff --git a/cogl/cogl-bitmap-pixbuf.c b/cogl/cogl-bitmap-pixbuf.c
index b1a756a2..f82c525e 100644
--- a/cogl/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl-bitmap-pixbuf.c
@@ -94,9 +94,9 @@ cogl_bitmap_error_quark (void)
}
gboolean
-_cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height)
+_cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height)
{
if (width)
*width = 0;
@@ -110,7 +110,7 @@ _cogl_bitmap_get_size_from_file (const gchar *filename,
/* the error does not contain the filename as the caller already has it */
gboolean
_cogl_bitmap_from_file (CoglBitmap *bmp,
- const gchar *filename,
+ const char *filename,
GError **error)
{
g_assert (bmp != NULL);
@@ -145,8 +145,8 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
CGImageRef image = CGImageSourceCreateImageAtIndex (image_source, 0, NULL);
CFRelease (image_source);
- size_t width = CGImageGetWidth (image);
- size_t height = CGImageGetHeight (image);
+ gsize width = CGImageGetWidth (image);
+ gsize height = CGImageGetHeight (image);
if (width == 0 || height == 0)
{
/* incomplete or corrupt */
@@ -157,7 +157,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
}
/* allocate buffer big enough to hold pixel data */
- size_t rowstride;
+ gsize rowstride;
rowstride = 4 * width;
guint8 *out_data = g_malloc0 (height * rowstride);
@@ -188,9 +188,9 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
#elif defined(USE_GDKPIXBUF)
gboolean
-_cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height)
+_cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height)
{
g_return_val_if_fail (filename != NULL, FALSE);
@@ -202,23 +202,23 @@ _cogl_bitmap_get_size_from_file (const gchar *filename,
gboolean
_cogl_bitmap_from_file (CoglBitmap *bmp,
- const gchar *filename,
+ const char *filename,
GError **error)
{
GdkPixbuf *pixbuf;
gboolean has_alpha;
GdkColorspace color_space;
CoglPixelFormat pixel_format;
- gint width;
- gint height;
- gint rowstride;
- gint bits_per_sample;
- gint n_channels;
- gint last_row_size;
- guchar *pixels;
- guchar *out_data;
- guchar *out;
- gint r;
+ int width;
+ int height;
+ int rowstride;
+ int bits_per_sample;
+ int n_channels;
+ int last_row_size;
+ guint8 *pixels;
+ guint8 *out_data;
+ guint8 *out;
+ int r;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -270,7 +270,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
/* FIXME: Any way to destroy pixbuf but retain pixel data? */
pixels = gdk_pixbuf_get_pixels (pixbuf);
- out_data = (guchar*) g_malloc (height * rowstride);
+ out_data = g_malloc (height * rowstride);
out = out_data;
/* Copy up to last row */
@@ -305,9 +305,9 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
#include "stb_image.c"
gboolean
-_cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height)
+_cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height)
{
if (width)
*width = 0;
@@ -320,13 +320,13 @@ _cogl_bitmap_get_size_from_file (const gchar *filename,
gboolean
_cogl_bitmap_from_file (CoglBitmap *bmp,
- const gchar *filename,
+ const char *filename,
GError **error)
{
- gint stb_pixel_format;
- gint width;
- gint height;
- guchar *pixels;
+ int stb_pixel_format;
+ int width;
+ int height;
+ guint8 *pixels;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
diff --git a/cogl/cogl-bitmap-private.h b/cogl/cogl-bitmap-private.h
index 803e10bb..2163fabd 100644
--- a/cogl/cogl-bitmap-private.h
+++ b/cogl/cogl-bitmap-private.h
@@ -33,11 +33,11 @@
typedef struct _CoglBitmap
{
CoglHandleObject _parent;
- guchar *data;
+ guint8 *data;
CoglPixelFormat format;
- gint width;
- gint height;
- gint rowstride;
+ int width;
+ int height;
+ int rowstride;
} CoglBitmap;
gboolean
@@ -81,12 +81,12 @@ _cogl_bitmap_fallback_premult (CoglBitmap *dst_bmp);
gboolean
_cogl_bitmap_from_file (CoglBitmap *bmp,
- const gchar *filename,
+ const char *filename,
GError **error);
gboolean
_cogl_bitmap_fallback_from_file (CoglBitmap *bmp,
- const gchar *filename);
+ const char *filename);
gboolean
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
@@ -100,16 +100,16 @@ _cogl_bitmap_convert_format_and_premult (const CoglBitmap *bmp,
void
_cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst,
- gint src_x,
- gint src_y,
- gint dst_x,
- gint dst_y,
- gint width,
- gint height);
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ int width,
+ int height);
gboolean
-_cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height);
+_cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height);
#endif /* __COGL_BITMAP_H */
diff --git a/cogl/cogl-bitmap.c b/cogl/cogl-bitmap.c
index fe3cbdb7..fa54d292 100644
--- a/cogl/cogl-bitmap.c
+++ b/cogl/cogl-bitmap.c
@@ -42,10 +42,10 @@ _cogl_bitmap_free (CoglBitmap *bmp)
g_free (bmp);
}
-gint
+int
_cogl_get_format_bpp (CoglPixelFormat format)
{
- gint bpp_lut[] = {
+ int bpp_lut[] = {
0, /* invalid */
1, /* A_8 */
3, /* 888 */
@@ -119,17 +119,17 @@ _cogl_bitmap_convert_format_and_premult (const CoglBitmap *bmp,
void
_cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst,
- gint src_x,
- gint src_y,
- gint dst_x,
- gint dst_y,
- gint width,
- gint height)
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ int width,
+ int height)
{
- guchar *srcdata;
- guchar *dstdata;
- gint bpp;
- gint line;
+ guint8 *srcdata;
+ guint8 *dstdata;
+ int bpp;
+ int line;
/* Intended only for fast copies when format is equal! */
g_assert (src->format == dst->format);
@@ -147,16 +147,16 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
}
gboolean
-cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height)
+cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height)
{
return _cogl_bitmap_get_size_from_file (filename, width, height);
}
CoglHandle
-cogl_bitmap_new_from_file (const gchar *filename,
- GError **error)
+cogl_bitmap_new_from_file (const char *filename,
+ GError **error)
{
CoglBitmap bmp;
CoglBitmap *ret;
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index 581cc410..1d228287 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -56,8 +56,9 @@ G_BEGIN_DECLS
*
* Since: 1.0
*/
-CoglHandle cogl_bitmap_new_from_file (const gchar *filename,
- GError **error);
+CoglHandle
+cogl_bitmap_new_from_file (const char *filename,
+ GError **error);
/**
* cogl_bitmap_get_size_from_file:
@@ -72,9 +73,10 @@ CoglHandle cogl_bitmap_new_from_file (const gchar *filename,
*
* Since: 1.0
*/
-gboolean cogl_bitmap_get_size_from_file (const gchar *filename,
- gint *width,
- gint *height);
+gboolean
+cogl_bitmap_get_size_from_file (const char *filename,
+ int *width,
+ int *height);
/**
* cogl_is_bitmap:
@@ -87,7 +89,8 @@ gboolean cogl_bitmap_get_size_from_file (const gchar *filename,
*
* Since: 1.0
*/
-gboolean cogl_is_bitmap (CoglHandle handle);
+gboolean
+cogl_is_bitmap (CoglHandle handle);
G_END_DECLS
diff --git a/cogl/cogl-blend-string.c b/cogl/cogl-blend-string.c
index b4cc724b..6ac1ed87 100644
--- a/cogl/cogl-blend-string.c
+++ b/cogl/cogl-blend-string.c
@@ -413,9 +413,9 @@ get_function_info (const char *mark,
const char *p,
CoglBlendStringContext context)
{
- size_t len = p - mark;
+ gsize len = p - mark;
CoglBlendStringFunctionInfo *functions;
- size_t array_len;
+ gsize array_len;
int i;
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@@ -443,9 +443,9 @@ get_color_src_info (const char *mark,
const char *p,
CoglBlendStringContext context)
{
- size_t len = p - mark;
+ gsize len = p - mark;
CoglBlendStringColorSourceInfo *sources;
- size_t array_len;
+ gsize array_len;
int i;
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@@ -617,7 +617,7 @@ parse_argument (const char *string, /* original user string */
case PARSER_ARG_STATE_SCRAPING_MASK:
if (*p == ']')
{
- size_t len = p - mark;
+ gsize len = p - mark;
CoglBlendStringColorSource *source =
parsing_factor ? &arg->factor.source : &arg->source;
@@ -678,7 +678,7 @@ parse_argument (const char *string, /* original user string */
case PARSER_ARG_STATE_MAYBE_SRC_ALPHA_SATURATE:
if (!is_symbol_char (*p))
{
- size_t len = p - mark;
+ gsize len = p - mark;
if (len >= strlen ("SRC_ALPHA_SATURATE") &&
strncmp (mark, "SRC_ALPHA_SATURATE", len) == 0)
{
diff --git a/cogl/cogl-blend-string.h b/cogl/cogl-blend-string.h
index 8469cf5e..8e045145 100644
--- a/cogl/cogl-blend-string.h
+++ b/cogl/cogl-blend-string.h
@@ -65,7 +65,7 @@ typedef struct _CoglBlendStringColorSourceInfo
{
CoglBlendStringColorSourceType type;
const char *name;
- size_t name_len;
+ gsize name_len;
} CoglBlendStringColorSourceInfo;
typedef struct _CoglBlendStringColorSource
@@ -111,7 +111,7 @@ typedef struct _CoglBlendStringFunctionInfo
{
enum _CoglBlendStringFunctionType type;
const char *name;
- size_t name_len;
+ gsize name_len;
int argc;
} CoglBlendStringFunctionInfo;
diff --git a/cogl/cogl-buffer-private.h b/cogl/cogl-buffer-private.h
index 35a0a632..6cc4c7f7 100644
--- a/cogl/cogl-buffer-private.h
+++ b/cogl/cogl-buffer-private.h
@@ -50,15 +50,15 @@ typedef struct _CoglBufferVtable CoglBufferVtable;
struct _CoglBufferVtable
{
- guchar * (* map) (CoglBuffer *buffer,
+ guint8 * (* map) (CoglBuffer *buffer,
CoglBufferAccess access);
void (* unmap) (CoglBuffer *buffer);
gboolean (* set_data) (CoglBuffer *buffer,
- guint offset,
- const guchar *data,
- guint size);
+ unsigned int offset,
+ const guint8 *data,
+ unsigned int size);
};
typedef enum _CoglBufferFlags
@@ -76,18 +76,18 @@ struct _CoglBuffer
CoglBufferFlags flags;
GLuint gl_handle; /* OpenGL handle */
- guint size; /* size of the buffer, in bytes */
+ unsigned int size; /* size of the buffer, in bytes */
CoglBufferUsageHint usage_hint;
CoglBufferUpdateHint update_hint;
- guchar *data; /* points to the mapped memory when
+ guint8 *data; /* points to the mapped memory when
* the CoglBuffer is a VBO, PBO, ... or
* points to allocated memory in the
* fallback paths */
};
void _cogl_buffer_initialize (CoglBuffer *buffer,
- guint size,
+ unsigned int size,
CoglBufferUsageHint usage_hint,
CoglBufferUpdateHint update_hint);
void _cogl_buffer_fini (CoglBuffer *buffer);
diff --git a/cogl/cogl-buffer.c b/cogl/cogl-buffer.c
index a74879da..55a5d7c3 100644
--- a/cogl/cogl-buffer.c
+++ b/cogl/cogl-buffer.c
@@ -85,7 +85,7 @@ cogl_is_buffer_EXP (CoglHandle handle)
void
_cogl_buffer_initialize (CoglBuffer *buffer,
- guint size,
+ unsigned int size,
CoglBufferUsageHint usage_hint,
CoglBufferUpdateHint update_hint)
{
@@ -183,7 +183,7 @@ _cogl_buffer_bind (CoglBuffer *buffer,
ctx->current_pbo = buffer;
}
-guint
+unsigned int
cogl_buffer_get_size_EXP (CoglHandle handle)
{
if (!cogl_is_buffer (handle))
@@ -236,7 +236,7 @@ cogl_buffer_get_update_hint_EXP (CoglHandle handle)
return COGL_BUFFER (handle)->update_hint;
}
-guchar *
+guint8 *
cogl_buffer_map_EXP (CoglHandle handle,
CoglBufferAccess access)
{
@@ -273,7 +273,7 @@ cogl_buffer_unmap_EXP (CoglHandle handle)
gboolean
cogl_buffer_set_data_EXP (CoglHandle handle,
gsize offset,
- const guchar *data,
+ const guint8 *data,
gsize size)
{
CoglBuffer *buffer;
diff --git a/cogl/cogl-buffer.h b/cogl/cogl-buffer.h
index 3d90d1ef..c1db72cb 100644
--- a/cogl/cogl-buffer.h
+++ b/cogl/cogl-buffer.h
@@ -70,7 +70,7 @@ cogl_is_buffer (CoglHandle handle);
* Since: 1.2
* Stability: Unstable
*/
-guint
+unsigned int
cogl_buffer_get_size (CoglHandle handle);
/**
@@ -85,7 +85,7 @@ cogl_buffer_get_size (CoglHandle handle);
* Stability: Unstable
*/
typedef enum { /*< prefix=COGL_BUFFER_USAGE_HINT >*/
- COGL_BUFFER_USAGE_HINT_TEXTURE,
+ COGL_BUFFER_USAGE_HINT_TEXTURE,
} CoglBufferUsageHint;
/**
@@ -148,7 +148,7 @@ typedef enum { /*< prefix=COGL_BUFFER_UPDATE_HINT >*/
* Stability: Unstable
*/
void
-cogl_buffer_set_update_hint (CoglHandle handle,
+cogl_buffer_set_update_hint (CoglHandle handle,
CoglBufferUpdateHint hint);
/**
@@ -196,7 +196,7 @@ typedef enum { /*< prefix=COGL_BUFFER_ACCESS >*/
* Since: 1.2
* Stability: Unstable
*/
-guchar *
+guint8 *
cogl_buffer_map (CoglHandle handle,
CoglBufferAccess access);
@@ -230,9 +230,9 @@ cogl_buffer_unmap (CoglHandle handle);
*/
gboolean
cogl_buffer_set_data (CoglHandle handle,
- gsize offset,
- const guchar *data,
- gsize size);
+ gsize offset,
+ const guint8 *data,
+ gsize size);
/* the functions above are experimental, the actual symbols are suffixed by
* _EXP so we can ensure ABI compatibility and leave the cogl_buffer namespace
@@ -242,7 +242,7 @@ cogl_buffer_set_data (CoglHandle handle,
gboolean
cogl_is_buffer_EXP (CoglHandle handle);
-guint
+unsigned int
cogl_buffer_get_size_EXP (CoglHandle handle);
void
@@ -253,13 +253,13 @@ CoglBufferUsageHint
cogl_buffer_get_usage_hint_EXP (CoglHandle handle);
void
-cogl_buffer_set_update_hint_EXP (CoglHandle handle,
+cogl_buffer_set_update_hint_EXP (CoglHandle handle,
CoglBufferUpdateHint hint);
CoglBufferUpdateHint
cogl_buffer_get_update_hint_EXP (CoglHandle handle);
-guchar *
+guint8 *
cogl_buffer_map_EXP (CoglHandle handle,
CoglBufferAccess access);
@@ -268,9 +268,9 @@ cogl_buffer_unmap_EXP (CoglHandle handle);
gboolean
cogl_buffer_set_data_EXP (CoglHandle handle,
- gsize offset,
- const guchar *data,
- gsize size);
+ gsize offset,
+ const guint8 *data,
+ gsize size);
#define cogl_is_buffer cogl_is_buffer_EXP
#define cogl_buffer_get_size cogl_buffer_get_size_EXP
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index f58792e2..d7ad1d1c 100644
--- a/cogl/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
@@ -37,9 +37,9 @@
#include "cogl-internal.h"
#include "cogl-framebuffer-private.h"
-void _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
- floatVec2 nodes_max,
- guint path_size,
+void _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
+ floatVec2 nodes_max,
+ unsigned int path_size,
CoglPathNode *path,
gboolean merge,
gboolean need_clear);
@@ -97,7 +97,7 @@ struct _CoglClipStackEntryPath
floatVec2 path_nodes_min;
floatVec2 path_nodes_max;
- guint path_size;
+ unsigned int path_size;
CoglPathNode path[1];
};
@@ -642,10 +642,10 @@ _cogl_flush_clip_state (CoglClipStackState *clip_state)
gboolean using_clip_planes = FALSE;
gboolean using_stencil_buffer = FALSE;
GList *node;
- gint scissor_x0 = 0;
- gint scissor_y0 = 0;
- gint scissor_x1 = G_MAXINT;
- gint scissor_y1 = G_MAXINT;
+ int scissor_x0 = 0;
+ int scissor_y0 = 0;
+ int scissor_x1 = G_MAXINT;
+ int scissor_y1 = G_MAXINT;
CoglMatrixStack *modelview_stack =
_cogl_framebuffer_get_modelview_stack (_cogl_get_framebuffer ());
diff --git a/cogl/cogl-clip-stack.h b/cogl/cogl-clip-stack.h
index 0ca041ec..604ec182 100644
--- a/cogl/cogl-clip-stack.h
+++ b/cogl/cogl-clip-stack.h
@@ -35,10 +35,16 @@ struct _CoglClipStackState
gboolean stencil_used;
};
-void _cogl_clip_stack_state_init (CoglClipStackState *state);
-void _cogl_clip_stack_state_destroy (CoglClipStackState *state);
-void _cogl_clip_stack_state_dirty (CoglClipStackState *state);
+void
+_cogl_clip_stack_state_init (CoglClipStackState *state);
-void _cogl_flush_clip_state (CoglClipStackState *clip_state);
+void
+_cogl_clip_stack_state_destroy (CoglClipStackState *state);
+
+void
+_cogl_clip_stack_state_dirty (CoglClipStackState *state);
+
+void
+_cogl_flush_clip_state (CoglClipStackState *clip_state);
#endif /* __COGL_CLIP_STACK_H */
diff --git a/cogl/cogl-color.h b/cogl/cogl-color.h
index abc0e644..eb750fd6 100644
--- a/cogl/cogl-color.h
+++ b/cogl/cogl-color.h
@@ -52,7 +52,8 @@ G_BEGIN_DECLS
*
* Since: 1.0
*/
-CoglColor *cogl_color_new (void);
+CoglColor *
+cogl_color_new (void);
/**
* cogl_color_copy:
@@ -65,7 +66,8 @@ CoglColor *cogl_color_new (void);
*
* Since: 1.0
*/
-CoglColor *cogl_color_copy (const CoglColor *color);
+CoglColor *
+cogl_color_copy (const CoglColor *color);
/**
* cogl_color_free:
@@ -75,7 +77,8 @@ CoglColor *cogl_color_copy (const CoglColor *color);
*
* Since: 1.0
*/
-void cogl_color_free (CoglColor *color);
+void
+cogl_color_free (CoglColor *color);
/**
* cogl_color_set_from_4ub:
@@ -89,11 +92,12 @@ void cogl_color_free (CoglColor *color);
*
* Since: 1.0
*/
-void cogl_color_set_from_4ub (CoglColor *dest,
- guint8 red,
- guint8 green,
- guint8 blue,
- guint8 alpha);
+void
+cogl_color_set_from_4ub (CoglColor *dest,
+ guint8 red,
+ guint8 green,
+ guint8 blue,
+ guint8 alpha);
/**
* cogl_color_set_from_4f:
@@ -107,11 +111,12 @@ void cogl_color_set_from_4ub (CoglColor *dest,
*
* Since: 1.0
*/
-void cogl_color_set_from_4f (CoglColor *dest,
- float red,
- float green,
- float blue,
- float alpha);
+void
+cogl_color_set_from_4f (CoglColor *dest,
+ float red,
+ float green,
+ float blue,
+ float alpha);
/**
* cogl_color_get_red_byte:
@@ -124,7 +129,8 @@ void cogl_color_set_from_4f (CoglColor *dest,
*
* Since: 1.0
*/
-unsigned char cogl_color_get_red_byte (const CoglColor *color);
+unsigned char
+cogl_color_get_red_byte (const CoglColor *color);
/**
* cogl_color_get_green_byte:
@@ -137,7 +143,8 @@ unsigned char cogl_color_get_red_byte (const CoglColor *color);
*
* Since: 1.0
*/
-unsigned char cogl_color_get_green_byte (const CoglColor *color);
+unsigned char
+cogl_color_get_green_byte (const CoglColor *color);
/**
* cogl_color_get_blue_byte:
@@ -150,7 +157,8 @@ unsigned char cogl_color_get_green_byte (const CoglColor *color);
*
* Since: 1.0
*/
-unsigned char cogl_color_get_blue_byte (const CoglColor *color);
+unsigned char
+cogl_color_get_blue_byte (const CoglColor *color);
/**
* cogl_color_get_alpha_byte:
@@ -163,7 +171,8 @@ unsigned char cogl_color_get_blue_byte (const CoglColor *color);
*
* Since: 1.0
*/
-unsigned char cogl_color_get_alpha_byte (const CoglColor *color);
+unsigned char
+cogl_color_get_alpha_byte (const CoglColor *color);
/**
* cogl_color_get_red_float:
@@ -176,7 +185,8 @@ unsigned char cogl_color_get_alpha_byte (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_red_float (const CoglColor *color);
+float
+cogl_color_get_red_float (const CoglColor *color);
/**
* cogl_color_get_green_float:
@@ -189,7 +199,8 @@ float cogl_color_get_red_float (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_green_float (const CoglColor *color);
+float
+cogl_color_get_green_float (const CoglColor *color);
/**
* cogl_color_get_blue_float:
@@ -202,7 +213,8 @@ float cogl_color_get_green_float (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_blue_float (const CoglColor *color);
+float
+cogl_color_get_blue_float (const CoglColor *color);
/**
* cogl_color_get_alpha_float:
@@ -215,7 +227,8 @@ float cogl_color_get_blue_float (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_alpha_float (const CoglColor *color);
+float
+cogl_color_get_alpha_float (const CoglColor *color);
/**
* cogl_color_get_red:
@@ -228,7 +241,8 @@ float cogl_color_get_alpha_float (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_red (const CoglColor *color);
+float
+cogl_color_get_red (const CoglColor *color);
/**
* cogl_color_get_green:
@@ -241,7 +255,8 @@ float cogl_color_get_red (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_green (const CoglColor *color);
+float
+cogl_color_get_green (const CoglColor *color);
/**
* cogl_color_get_blue:
@@ -254,7 +269,8 @@ float cogl_color_get_green (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_blue (const CoglColor *color);
+float
+cogl_color_get_blue (const CoglColor *color);
/**
* cogl_color_get_alpha:
@@ -267,7 +283,8 @@ float cogl_color_get_blue (const CoglColor *color);
*
* Since: 1.0
*/
-float cogl_color_get_alpha (const CoglColor *color);
+float
+cogl_color_get_alpha (const CoglColor *color);
/**
* cogl_color_premultiply:
@@ -279,7 +296,8 @@ float cogl_color_get_alpha (const CoglColor *color);
*
* Since: 1.0
*/
-void cogl_color_premultiply (CoglColor *color);
+void
+cogl_color_premultiply (CoglColor *color);
/**
* cogl_color_equal:
@@ -295,8 +313,9 @@ void cogl_color_premultiply (CoglColor *color);
*
* Since: 1.0
*/
-gboolean cogl_color_equal (gconstpointer v1,
- gconstpointer v2);
+gboolean
+cogl_color_equal (gconstpointer v1,
+ gconstpointer v2);
G_END_DECLS
diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
index 1e0af655..20c307e1 100644
--- a/cogl/cogl-context.c
+++ b/cogl/cogl-context.c
@@ -46,7 +46,7 @@ static gboolean
cogl_create_context (void)
{
GLubyte default_texture_data[] = { 0xff, 0xff, 0xff, 0x0 };
- gulong enable_flags = 0;
+ unsigned long enable_flags = 0;
CoglHandle window_buffer;
if (_context != NULL)
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 20ba2578..3d59c0ec 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -49,7 +49,7 @@ typedef struct
CoglHandle default_material;
/* Enable cache */
- gulong enable_flags;
+ unsigned long enable_flags;
guint8 color_alpha;
gboolean enable_backface_culling;
@@ -83,10 +83,10 @@ typedef struct
/* Some simple caching, to minimize state changes... */
CoglHandle current_material;
- gulong current_material_flags;
+ unsigned long current_material_flags;
CoglMaterialFlushOptions current_material_flush_options;
GArray *current_layers;
- guint n_texcoord_arrays_enabled;
+ unsigned int n_texcoord_arrays_enabled;
/* PBOs */
/* This can be used to check if a pbo is bound */
@@ -102,7 +102,7 @@ typedef struct
floatVec2 path_start;
floatVec2 path_pen;
GArray *path_nodes;
- guint last_path;
+ unsigned int last_path;
floatVec2 path_nodes_min;
floatVec2 path_nodes_max;
CoglHandle stencil_material;
@@ -110,7 +110,7 @@ typedef struct
/* Pre-generated VBOs containing indices to generate GL_TRIANGLES
out of a vertex array of quads */
CoglHandle quad_indices_byte;
- guint quad_indices_short_len;
+ unsigned int quad_indices_short_len;
CoglHandle quad_indices_short;
gboolean in_begin_gl_block;
diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c
index 1ee18056..b1b146fd 100644
--- a/cogl/cogl-debug.c
+++ b/cogl/cogl-debug.c
@@ -53,10 +53,10 @@ static const GDebugKey cogl_debug_keys[] = {
{ "disable-atlas", COGL_DEBUG_DISABLE_ATLAS }
};
-static const gint n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys);
+static const int n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys);
#endif /* COGL_ENABLE_DEBUG */
-guint cogl_debug_flags = 0;
+unsigned int cogl_debug_flags = 0;
#ifdef COGL_ENABLE_DEBUG
static gboolean
@@ -73,8 +73,8 @@ cogl_arg_debug_cb (const char *key,
static gboolean
cogl_arg_no_debug_cb (const char *key,
- const char *value,
- gpointer user_data)
+ const char *value,
+ gpointer user_data)
{
cogl_debug_flags &=
~g_parse_debug_string (value,
diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h
index 0c6fb4de..e0945e64 100644
--- a/cogl/cogl-debug.h
+++ b/cogl/cogl-debug.h
@@ -62,7 +62,7 @@ typedef enum {
#else
#define COGL_NOTE(type,...) G_STMT_START { \
if (cogl_debug_flags & COGL_DEBUG_##type) { \
- gchar *_fmt = g_strdup_printf (__VA_ARGS__); \
+ char *_fmt = g_strdup_printf (__VA_ARGS__); \
g_message ("[" #type "] " G_STRLOC ": %s", _fmt); \
g_free (_fmt); \
} } G_STMT_END
@@ -75,7 +75,7 @@ typedef enum {
#endif /* COGL_ENABLE_DEBUG */
-extern guint cogl_debug_flags;
+extern unsigned int cogl_debug_flags;
G_END_DECLS
diff --git a/cogl/cogl-feature-private.c b/cogl/cogl-feature-private.c
index 2f98e275..db6fa76c 100644
--- a/cogl/cogl-feature-private.c
+++ b/cogl/cogl-feature-private.c
@@ -34,11 +34,12 @@
gboolean
_cogl_feature_check (const CoglFeatureData *data,
- guint gl_major, guint gl_minor,
- const gchar *extensions_string)
+ unsigned int gl_major,
+ unsigned int gl_minor,
+ const char *extensions_string)
{
- const gchar *suffix = NULL;
+ const char *suffix = NULL;
int func_num;
_COGL_GET_CONTEXT (ctx, FALSE);
@@ -51,14 +52,14 @@ _cogl_feature_check (const CoglFeatureData *data,
else
{
/* Otherwise try all of the extensions */
- const gchar *namespace, *namespace_suffix;
- guint namespace_len;
+ const char *namespace, *namespace_suffix;
+ unsigned int namespace_len;
for (namespace = data->namespaces;
*namespace;
namespace += strlen (namespace) + 1)
{
- const gchar *extension;
+ const char *extension;
GString *full_extension_name = g_string_new ("");
/* If the namespace part contains a ':' then the suffix for
@@ -110,7 +111,7 @@ _cogl_feature_check (const CoglFeatureData *data,
for (func_num = 0; data->functions[func_num].name; func_num++)
{
void *func;
- gchar *full_function_name;
+ char *full_function_name;
full_function_name = g_strconcat (data->functions[func_num].name,
suffix, NULL);
@@ -121,7 +122,7 @@ _cogl_feature_check (const CoglFeatureData *data,
break;
/* Set the function pointer in the context */
- *(void **) ((guchar *) ctx +
+ *(void **) ((guint8 *) ctx +
data->functions[func_num].pointer_offset) = func;
}
@@ -132,7 +133,7 @@ _cogl_feature_check (const CoglFeatureData *data,
if (data->functions[func_num].name)
{
while (func_num-- > 0)
- *(void **) ((guchar *) ctx +
+ *(void **) ((guint8 *) ctx +
data->functions[func_num].pointer_offset) = NULL;
return FALSE;
}
diff --git a/cogl/cogl-feature-private.h b/cogl/cogl-feature-private.h
index 0782669b..258f185a 100644
--- a/cogl/cogl-feature-private.h
+++ b/cogl/cogl-feature-private.h
@@ -36,9 +36,9 @@ typedef struct _CoglFeatureFunction CoglFeatureFunction;
struct _CoglFeatureFunction
{
/* The name of the function without the "EXT" or "ARB" suffix */
- const gchar *name;
+ const char *name;
/* The offset in the context of where to store the function pointer */
- guint pointer_offset;
+ unsigned int pointer_offset;
};
typedef struct _CoglFeatureData CoglFeatureData;
@@ -48,15 +48,15 @@ struct _CoglFeatureData
/* A minimum GL version which the functions should be defined in
without needing an extension. Set to 255,255 if it's only
provided in an extension */
- guchar min_gl_major, min_gl_minor;
+ guint8 min_gl_major, min_gl_minor;
/* \0 separated list of namespaces to try. Eg "EXT\0ARB\0" */
- const gchar *namespaces;
+ const char *namespaces;
/* \0 separated list of required extension names without the GL_EXT
or GL_ARB prefix. All of the extensions must be available for the
feature to be considered available. If the suffix for an
extension is different from the namespace, you can specify it
with a ':' after the namespace */
- const gchar *extension_names;
+ const char *extension_names;
/* A set of feature flags to enable if the extension is available */
CoglFeatureFlags feature_flags;
/* A list of functions required for this feature. Terminated with a
@@ -65,7 +65,7 @@ struct _CoglFeatureData
};
gboolean _cogl_feature_check (const CoglFeatureData *data,
- guint gl_major, guint gl_minor,
- const gchar *extensions_string);
+ unsigned int gl_major, unsigned int gl_minor,
+ const char *extensions_string);
#endif /* __COGL_FEATURE_PRIVATE_H */
diff --git a/cogl/cogl-fixed.c b/cogl/cogl-fixed.c
index f1564063..33f331a4 100644
--- a/cogl/cogl-fixed.c
+++ b/cogl/cogl-fixed.c
@@ -295,7 +295,7 @@ static const CoglFixed sqrt_tbl[] =
/* the difference of the angle for two adjacent values in the
* sin_tbl table, expressed as CoglFixed number
*/
-static const gint sin_tbl_size = G_N_ELEMENTS (sin_tbl) - 1;
+static const int sin_tbl_size = G_N_ELEMENTS (sin_tbl) - 1;
static const double _magic = 68719476736.0 * 1.5;
@@ -346,11 +346,11 @@ cogl_double_to_fixed (double val)
*
* Return value: Integer part of the double
*/
-gint
+int
cogl_double_to_int (double val)
{
#ifdef COGL_NO_FAST_CONVERSIONS
- return (gint) (val);
+ return (int) (val);
#else
union {
double d;
@@ -364,11 +364,11 @@ cogl_double_to_int (double val)
#endif
}
-guint
+unsigned int
cogl_double_to_uint (double val)
{
#ifdef COGL_NO_FAST_CONVERSIONS
- return (guint)(val);
+ return (unsigned int)(val);
#else
union {
double d;
@@ -716,8 +716,8 @@ cogl_fixed_sqrt (CoglFixed x)
*
* Since: 0.2
*/
-gint
-cogl_sqrti (gint number)
+int
+cogl_sqrti (int number)
{
#if defined __SSE2__
/* The GCC built-in with SSE2 (sqrtsd) is up to twice as fast as
@@ -859,7 +859,7 @@ cogl_fixed_mul_div (CoglFixed a,
*/
CoglFixed
-cogl_fixed_log2 (guint x)
+cogl_fixed_log2 (unsigned int x)
{
/* Note: we could easily have a version for CoglFixed x, but the int
* precision is enough for the current purposes.
@@ -889,7 +889,7 @@ cogl_fixed_log2 (guint x)
return flt.i + y;
}
-guint
+unsigned int
cogl_fixed_pow2 (CoglFixed x)
{
/* Note: we could easily have a version that produces CoglFixed result,
@@ -926,9 +926,9 @@ cogl_fixed_pow2 (CoglFixed x)
return COGL_FLOAT_TO_UINT (flt.f);
}
-guint
-cogl_fixed_pow (guint x,
- CoglFixed y)
+unsigned int
+cogl_fixed_pow (unsigned int x,
+ CoglFixed y)
{
return cogl_fixed_pow2 (COGL_FIXED_MUL (y, cogl_fixed_log2 (x)));
}
diff --git a/cogl/cogl-fixed.h b/cogl/cogl-fixed.h
index 86843517..14ca419e 100644
--- a/cogl/cogl-fixed.h
+++ b/cogl/cogl-fixed.h
@@ -468,7 +468,8 @@ G_BEGIN_DECLS
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_sin (CoglFixed angle);
+CoglFixed
+cogl_fixed_sin (CoglFixed angle);
/**
* cogl_fixed_tan:
@@ -480,7 +481,8 @@ CoglFixed cogl_fixed_sin (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_tan (CoglFixed angle);
+CoglFixed
+cogl_fixed_tan (CoglFixed angle);
/**
* cogl_fixed_cos:
@@ -492,7 +494,7 @@ CoglFixed cogl_fixed_tan (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_cos (CoglFixed angle);
+CoglFixed cogl_fixed_cos (CoglFixed angle);
/**
* cogl_fixed_atani:
@@ -504,7 +506,8 @@ CoglFixed cogl_fixed_cos (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_atani (CoglFixed a);
+CoglFixed
+cogl_fixed_atani (CoglFixed a);
/**
* cogl_fixed_atan2:
@@ -519,19 +522,25 @@ CoglFixed cogl_fixed_atani (CoglFixed a);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_atan2 (CoglFixed a,
- CoglFixed b);
+CoglFixed
+cogl_fixed_atan2 (CoglFixed a,
+ CoglFixed b);
/*< public >*/
/* Fixed point math routines */
-G_INLINE_FUNC CoglFixed cogl_fixed_mul (CoglFixed a,
- CoglFixed b);
-G_INLINE_FUNC CoglFixed cogl_fixed_div (CoglFixed a,
- CoglFixed b);
-G_INLINE_FUNC CoglFixed cogl_fixed_mul_div (CoglFixed a,
- CoglFixed b,
- CoglFixed c);
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul (CoglFixed a,
+ CoglFixed b);
+
+G_INLINE_FUNC CoglFixed
+cogl_fixed_div (CoglFixed a,
+ CoglFixed b);
+
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul_div (CoglFixed a,
+ CoglFixed b,
+ CoglFixed c);
/**
* COGL_SQRTI_ARG_MAX:
@@ -585,7 +594,8 @@ G_INLINE_FUNC CoglFixed cogl_fixed_mul_div (CoglFixed a,
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_sqrt (CoglFixed x);
+CoglFixed
+cogl_fixed_sqrt (CoglFixed x);
/**
* cogl_fixed_log2:
@@ -600,7 +610,8 @@ CoglFixed cogl_fixed_sqrt (CoglFixed x);
*
* Since: 1.0
*/
-CoglFixed cogl_fixed_log2 (guint x);
+CoglFixed
+cogl_fixed_log2 (unsigned int x);
/**
* cogl_fixed_pow2:
@@ -615,7 +626,8 @@ CoglFixed cogl_fixed_log2 (guint x);
*
* Since: 1.0
*/
-guint cogl_fixed_pow2 (CoglFixed x);
+unsigned int
+cogl_fixed_pow2 (CoglFixed x);
/**
* cogl_fixed_pow:
@@ -628,8 +640,9 @@ guint cogl_fixed_pow2 (CoglFixed x);
*
* Since: 1.0
*/
-guint cogl_fixed_pow (guint x,
- CoglFixed y);
+unsigned int
+cogl_fixed_pow (unsigned int x,
+ CoglFixed y);
/**
* cogl_sqrti:
@@ -647,7 +660,8 @@ guint cogl_fixed_pow (guint x,
*
* Since: 1.0
*/
-gint cogl_sqrti (gint x);
+int
+cogl_sqrti (int x);
/**
* COGL_ANGLE_FROM_DEG:
@@ -700,7 +714,8 @@ gint cogl_sqrti (gint x);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_sin (CoglAngle angle);
+CoglFixed
+cogl_angle_sin (CoglAngle angle);
/**
* cogl_angle_tan:
@@ -712,7 +727,8 @@ CoglFixed cogl_angle_sin (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_tan (CoglAngle angle);
+CoglFixed
+cogl_angle_tan (CoglAngle angle);
/**
* cogl_angle_cos:
@@ -724,7 +740,8 @@ CoglFixed cogl_angle_tan (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed cogl_angle_cos (CoglAngle angle);
+CoglFixed
+cogl_angle_cos (CoglAngle angle);
/*< private >*/
@@ -773,9 +790,14 @@ cogl_fixed_mul_div (CoglFixed a,
}
#endif
-extern CoglFixed cogl_double_to_fixed (double value);
-extern gint cogl_double_to_int (double value);
-extern guint cogl_double_to_unit (double value);
+CoglFixed
+cogl_double_to_fixed (double value);
+
+int
+cogl_double_to_int (double value);
+
+unsigned int
+cogl_double_to_unit (double value);
G_END_DECLS
diff --git a/cogl/cogl-handle.h b/cogl/cogl-handle.h
index d69920df..3918689d 100644
--- a/cogl/cogl-handle.h
+++ b/cogl/cogl-handle.h
@@ -39,7 +39,7 @@ typedef struct _CoglHandleClass
*/
typedef struct _CoglHandleObject
{
- guint ref_count;
+ unsigned int ref_count;
CoglHandleClass *klass;
} CoglHandleObject;
diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h
index 61de4fe5..9b852520 100644
--- a/cogl/cogl-internal.h
+++ b/cogl/cogl-internal.h
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2007,2008,2009 Intel Corporation.
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -48,11 +48,11 @@ typedef struct _CoglBoxedValue
gboolean transpose;
union {
- gfloat float_value[4];
- gint int_value[4];
- gfloat matrix[16];
- gfloat *float_array;
- gint *int_array;
+ float float_value[4];
+ int int_value[4];
+ float matrix[16];
+ float *float_array;
+ int *int_array;
gpointer array;
} v;
} CoglBoxedValue;
@@ -60,7 +60,8 @@ typedef struct _CoglBoxedValue
#ifdef COGL_GL_DEBUG
-const gchar *cogl_gl_error_to_string (GLenum error_code);
+const char *
+cogl_gl_error_to_string (GLenum error_code);
#define GE(x) G_STMT_START { \
GLenum __err; \
@@ -97,12 +98,17 @@ const gchar *cogl_gl_error_to_string (GLenum error_code);
#define COGL_ENABLE_COLOR_ARRAY (1<<4)
#define COGL_ENABLE_BACKFACE_CULLING (1<<5)
-void _cogl_features_init (void);
+void
+_cogl_features_init (void);
+
+int
+_cogl_get_format_bpp (CoglPixelFormat format);
-gint _cogl_get_format_bpp (CoglPixelFormat format);
+void
+cogl_enable (gulong flags);
-void cogl_enable (gulong flags);
-gulong cogl_get_enable (void);
+unsigned long
+cogl_get_enable (void);
typedef struct _CoglTextureUnit
{
@@ -112,9 +118,11 @@ typedef struct _CoglTextureUnit
CoglTextureUnit *
_cogl_get_texture_unit (int index_);
+
void
_cogl_destroy_texture_units (void);
-guint
+
+unsigned int
_cogl_get_max_texture_image_units (void);
void
diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index a684a526..84846c8c 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -88,7 +88,7 @@ typedef CoglVertexBufferIndices CoglJournalIndices;
typedef struct _CoglJournalFlushState
{
- size_t stride;
+ gsize stride;
/* Note: this is a pointer to handle fallbacks. It normally holds a VBO
* offset, but when the driver doesn't support VBOs then this points into
* our GArray of logged vertices. */
@@ -96,7 +96,7 @@ typedef struct _CoglJournalFlushState
GLuint vertex_offset;
#ifndef HAVE_COGL_GL
CoglJournalIndices *indices;
- size_t indices_type_size;
+ gsize indices_type_size;
#endif
CoglMatrixStack *modelview_stack;
} CoglJournalFlushState;
@@ -110,7 +110,7 @@ typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
void
_cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
{
- size_t stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers);
+ gsize stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers);
int i;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -144,7 +144,7 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
void
_cogl_journal_dump_quad_batch (guint8 *data, int n_layers, int n_quads)
{
- size_t byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4;
+ gsize byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4;
int i;
g_print ("_cogl_journal_dump_quad_batch: n_layers = %d, n_quads = %d\n",
@@ -304,10 +304,10 @@ compare_entry_modelviews (CoglJournalEntry *entry0,
* materials, but they may not all have the same modelview matrix */
static void
_cogl_journal_flush_material_and_entries (CoglJournalEntry *batch_start,
- gint batch_len,
+ int batch_len,
void *data)
{
- gulong enable_flags = 0;
+ unsigned long enable_flags = 0;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -367,7 +367,7 @@ compare_entry_materials (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
static void
_cogl_journal_flush_texcoord_vbo_offsets_and_entries (
CoglJournalEntry *batch_start,
- gint batch_len,
+ int batch_len,
void *data)
{
CoglJournalFlushState *state = data;
@@ -423,11 +423,11 @@ compare_entry_n_layers (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
* of journal entries */
static void
_cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
- gint batch_len,
+ int batch_len,
void *data)
{
CoglJournalFlushState *state = data;
- size_t stride;
+ gsize stride;
#ifndef HAVE_COGL_GL
int needed_indices = batch_len * 6;
CoglHandle indices_handle;
@@ -502,7 +502,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
/* progress forward through the VBO containing all our vertices */
state->vbo_offset += (stride * 4 * batch_len);
if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_JOURNAL))
- g_print ("new vbo offset = %lu\n", (gulong)state->vbo_offset);
+ g_print ("new vbo offset = %lu\n", (unsigned long)state->vbo_offset);
}
static gboolean
@@ -524,7 +524,7 @@ compare_entry_strides (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
static GLuint
upload_vertices_to_vbo (GArray *vertices, CoglJournalFlushState *state)
{
- size_t needed_vbo_len;
+ gsize needed_vbo_len;
GLuint journal_vbo;
_COGL_GET_CONTEXT (ctx, 0);
@@ -668,8 +668,8 @@ _cogl_journal_log_quad (float x_1,
const float *tex_coords,
unsigned int tex_coords_len)
{
- size_t stride;
- size_t byte_stride;
+ gsize stride;
+ gsize byte_stride;
int next_vert;
GLfloat *v;
GLubyte *c;
diff --git a/cogl/cogl-material-private.h b/cogl/cogl-material-private.h
index a5a846fa..73077859 100644
--- a/cogl/cogl-material-private.h
+++ b/cogl/cogl-material-private.h
@@ -60,23 +60,23 @@ typedef enum _CoglMaterialLayerPrivFlags
/* For tracking the state of a layer that's been flushed to OpenGL */
typedef struct _CoglLayerInfo
{
- CoglHandle handle;
- gulong flags;
- GLenum gl_target;
- GLuint gl_texture;
- gboolean fallback;
- gboolean disabled;
- gboolean layer0_overridden;
+ CoglHandle handle;
+ unsigned long flags;
+ GLenum gl_target;
+ GLuint gl_texture;
+ gboolean fallback;
+ gboolean disabled;
+ gboolean layer0_overridden;
} CoglLayerInfo;
struct _CoglMaterialLayer
{
CoglHandleObject _parent;
- guint index; /*!< lowest index is blended first then others
- on top */
- gulong flags;
- CoglHandle texture; /*!< The texture for this layer, or COGL_INVALID_HANDLE
- for an empty layer */
+ unsigned int index; /*!< lowest index is blended first then others on
+ top */
+ unsigned long flags;
+ CoglHandle texture; /*!< The texture for this layer, or
+ COGL_INVALID_HANDLE for an empty layer */
CoglMaterialFilter mag_filter;
CoglMaterialFilter min_filter;
@@ -112,9 +112,9 @@ typedef enum _CoglMaterialFlags
struct _CoglMaterial
{
CoglHandleObject _parent;
- gulong journal_ref_count;
+ unsigned long journal_ref_count;
- gulong flags;
+ unsigned long flags;
/* If no lighting is enabled; this is the basic material color */
GLubyte unlit[4];
@@ -141,8 +141,8 @@ struct _CoglMaterial
GLint blend_src_factor_rgb;
GLint blend_dst_factor_rgb;
- GList *layers;
- guint n_layers;
+ GList *layers;
+ unsigned int n_layers;
};
/*
@@ -179,7 +179,8 @@ _cogl_material_init_default_material (void);
* will be replaced.
*/
/* TODO: find a nicer solution! */
-gulong _cogl_material_get_cogl_enable_flags (CoglHandle handle);
+unsigned long
+_cogl_material_get_cogl_enable_flags (CoglHandle handle);
/*
* CoglMaterialLayerFlags:
@@ -202,13 +203,15 @@ typedef enum _CoglMaterialLayerFlags
* internally, but if you are developing custom primitives directly with
* OpenGL you may need this.
*/
-gulong _cogl_material_layer_get_flags (CoglHandle layer_handle);
+unsigned long
+_cogl_material_layer_get_flags (CoglHandle layer_handle);
/*
* Ensures the mipmaps are available for the texture in the layer if
* the filter settings would require it
*/
-void _cogl_material_layer_ensure_mipmaps (CoglHandle layer_handler);
+void
+_cogl_material_layer_ensure_mipmaps (CoglHandle layer_handler);
/*
* CoglMaterialFlushFlag:
@@ -251,19 +254,25 @@ typedef struct _CoglMaterialFlushOptions
-void _cogl_material_get_colorubv (CoglHandle handle,
- guint8 *color);
+void
+_cogl_material_get_colorubv (CoglHandle handle,
+ guint8 *color);
-void _cogl_material_flush_gl_state (CoglHandle material,
- CoglMaterialFlushOptions *options);
+void
+_cogl_material_flush_gl_state (CoglHandle material,
+ CoglMaterialFlushOptions *options);
-gboolean _cogl_material_equal (CoglHandle material0_handle,
- CoglMaterialFlushOptions *material0_flush_options,
- CoglHandle material1_handle,
- CoglMaterialFlushOptions *material1_flush_options);
+gboolean
+_cogl_material_equal (CoglHandle material0_handle,
+ CoglMaterialFlushOptions *material0_flush_options,
+ CoglHandle material1_handle,
+ CoglMaterialFlushOptions *material1_flush_options);
-CoglHandle _cogl_material_journal_ref (CoglHandle material_handle);
-void _cogl_material_journal_unref (CoglHandle material_handle);
+CoglHandle
+_cogl_material_journal_ref (CoglHandle material_handle);
+
+void
+_cogl_material_journal_unref (CoglHandle material_handle);
#endif /* __COGL_MATERIAL_PRIVATE_H */
diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c
index 60e037b3..a9661e4f 100644
--- a/cogl/cogl-material.c
+++ b/cogl/cogl-material.c
@@ -740,7 +740,7 @@ cogl_material_set_blend_constant (CoglHandle handle,
*/
static CoglMaterialLayer *
_cogl_material_get_layer (CoglMaterial *material,
- gint index_,
+ int index_,
gboolean create_if_not_found)
{
CoglMaterialLayer *layer;
@@ -801,7 +801,7 @@ _cogl_material_get_layer (CoglMaterial *material,
void
cogl_material_set_layer (CoglHandle material_handle,
- gint layer_index,
+ int layer_index,
CoglHandle texture_handle)
{
CoglMaterial *material;
@@ -934,7 +934,7 @@ setup_texture_combine_state (CoglBlendStringStatement *statement,
gboolean
cogl_material_set_layer_combine (CoglHandle handle,
- gint layer_index,
+ int layer_index,
const char *combine_description,
GError **error)
{
@@ -1004,7 +1004,7 @@ cogl_material_set_layer_combine (CoglHandle handle,
void
cogl_material_set_layer_combine_constant (CoglHandle handle,
- gint layer_index,
+ int layer_index,
CoglColor *constant_color)
{
CoglMaterial *material;
@@ -1031,7 +1031,7 @@ cogl_material_set_layer_combine_constant (CoglHandle handle,
void
cogl_material_set_layer_matrix (CoglHandle material_handle,
- gint layer_index,
+ int layer_index,
CoglMatrix *matrix)
{
CoglMaterial *material;
@@ -1062,7 +1062,7 @@ _cogl_material_layer_free (CoglMaterialLayer *layer)
void
cogl_material_remove_layer (CoglHandle material_handle,
- gint layer_index)
+ int layer_index)
{
CoglMaterial *material;
CoglMaterialLayer *layer;
@@ -1099,11 +1099,11 @@ cogl_material_remove_layer (CoglHandle material_handle,
/* XXX: This API is hopfully just a stop-gap solution. Ideally cogl_enable
* will be replaced. */
-gulong
+unsigned long
_cogl_material_get_cogl_enable_flags (CoglHandle material_handle)
{
CoglMaterial *material;
- gulong enable_flags = 0;
+ unsigned long enable_flags = 0;
_COGL_GET_CONTEXT (ctx, 0);
@@ -1169,7 +1169,7 @@ cogl_material_layer_get_texture (CoglHandle layer_handle)
return layer->texture;
}
-gulong
+unsigned long
_cogl_material_layer_get_flags (CoglHandle layer_handle)
{
CoglMaterialLayer *layer;
@@ -1196,7 +1196,7 @@ _cogl_material_layer_copy (CoglHandle layer_handle)
return _cogl_material_layer_handle_new (layer_copy);
}
-static guint
+static unsigned int
get_n_args_for_combine_func (GLint func)
{
switch (func)
@@ -2056,7 +2056,7 @@ cogl_material_layer_get_mag_filter (CoglHandle layer_handle)
void
cogl_material_set_layer_filters (CoglHandle handle,
- gint layer_index,
+ int layer_index,
CoglMaterialFilter min_filter,
CoglMaterialFilter mag_filter)
{
diff --git a/cogl/cogl-material.h b/cogl/cogl-material.h
index 4a62a3ce..f8660d03 100644
--- a/cogl/cogl-material.h
+++ b/cogl/cogl-material.h
@@ -86,7 +86,8 @@ typedef enum {
*
* Return value: a handle to the new material
*/
-CoglHandle cogl_material_new (void);
+CoglHandle
+cogl_material_new (void);
/**
* cogl_material_copy:
@@ -104,7 +105,8 @@ CoglHandle cogl_material_new (void);
*
* Since: 1.2
*/
-CoglHandle cogl_material_copy (CoglHandle source);
+CoglHandle
+cogl_material_copy (CoglHandle source);
#ifndef COGL_DISABLE_DEPRECATED
@@ -120,7 +122,8 @@ CoglHandle cogl_material_copy (CoglHandle source);
*
* Deprecated: 1.2: Use cogl_handle_ref() instead
*/
-CoglHandle cogl_material_ref (CoglHandle handle);
+CoglHandle
+cogl_material_ref (CoglHandle handle);
/**
* cogl_material_unref:
@@ -132,7 +135,8 @@ CoglHandle cogl_material_ref (CoglHandle handle);
*
* Deprecated: 1.2: Use cogl_handle_unref() instead
*/
-void cogl_material_unref (CoglHandle handle);
+void
+cogl_material_unref (CoglHandle handle);
#endif /* COGL_DISABLE_DEPRECATED */
@@ -145,7 +149,8 @@ void cogl_material_unref (CoglHandle handle);
* Return value: %TRUE if the handle references a #CoglMaterial,
* %FALSE otherwise
*/
-gboolean cogl_is_material (CoglHandle handle);
+gboolean
+cogl_is_material (CoglHandle handle);
/**
* cogl_material_set_color:
@@ -163,8 +168,9 @@ gboolean cogl_is_material (CoglHandle handle);
*
* Since: 1.0
*/
-void cogl_material_set_color (CoglHandle material,
- const CoglColor *color);
+void
+cogl_material_set_color (CoglHandle material,
+ const CoglColor *color);
/**
* cogl_material_set_color4ub:
@@ -180,11 +186,12 @@ void cogl_material_set_color (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_color4ub (CoglHandle material,
- guint8 red,
- guint8 green,
- guint8 blue,
- guint8 alpha);
+void
+cogl_material_set_color4ub (CoglHandle material,
+ guint8 red,
+ guint8 green,
+ guint8 blue,
+ guint8 alpha);
/**
* cogl_material_set_color4f:
@@ -200,11 +207,12 @@ void cogl_material_set_color4ub (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_color4f (CoglHandle material,
- float red,
- float green,
- float blue,
- float alpha);
+void
+cogl_material_set_color4f (CoglHandle material,
+ float red,
+ float green,
+ float blue,
+ float alpha);
/**
* cogl_material_get_color:
@@ -215,8 +223,9 @@ void cogl_material_set_color4f (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_get_color (CoglHandle material,
- CoglColor *color);
+void
+cogl_material_get_color (CoglHandle material,
+ CoglColor *color);
/**
* cogl_material_set_ambient:
@@ -234,8 +243,9 @@ void cogl_material_get_color (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_ambient (CoglHandle material,
- const CoglColor *ambient);
+void
+cogl_material_set_ambient (CoglHandle material,
+ const CoglColor *ambient);
/**
* cogl_material_get_ambient:
@@ -246,8 +256,9 @@ void cogl_material_set_ambient (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_get_ambient (CoglHandle material,
- CoglColor *ambient);
+void
+cogl_material_get_ambient (CoglHandle material,
+ CoglColor *ambient);
/**
* cogl_material_set_diffuse:
@@ -262,8 +273,9 @@ void cogl_material_get_ambient (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_diffuse (CoglHandle material,
- const CoglColor *diffuse);
+void
+cogl_material_set_diffuse (CoglHandle material,
+ const CoglColor *diffuse);
/**
* cogl_material_get_diffuse:
@@ -274,8 +286,9 @@ void cogl_material_set_diffuse (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_get_diffuse (CoglHandle material,
- CoglColor *diffuse);
+void
+cogl_material_get_diffuse (CoglHandle material,
+ CoglColor *diffuse);
/**
* cogl_material_set_ambient_and_diffuse:
@@ -291,8 +304,9 @@ void cogl_material_get_diffuse (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_ambient_and_diffuse (CoglHandle material,
- const CoglColor *color);
+void
+cogl_material_set_ambient_and_diffuse (CoglHandle material,
+ const CoglColor *color);
/**
* cogl_material_set_specular:
@@ -307,8 +321,9 @@ void cogl_material_set_ambient_and_diffuse (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_specular (CoglHandle material,
- const CoglColor *specular);
+void
+cogl_material_set_specular (CoglHandle material,
+ const CoglColor *specular);
/**
* cogl_material_get_specular:
@@ -319,8 +334,9 @@ void cogl_material_set_specular (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_get_specular (CoglHandle material,
- CoglColor *specular);
+void
+cogl_material_get_specular (CoglHandle material,
+ CoglColor *specular);
/**
* cogl_material_set_shininess:
@@ -335,8 +351,10 @@ void cogl_material_get_specular (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_shininess (CoglHandle material,
- float shininess);
+void
+cogl_material_set_shininess (CoglHandle material,
+ float shininess);
+
/**
* cogl_material_get_shininess:
* @material: A CoglMaterial object
@@ -347,7 +365,8 @@ void cogl_material_set_shininess (CoglHandle material,
*
* Since: 1.0
*/
-float cogl_material_get_shininess (CoglHandle material);
+float
+cogl_material_get_shininess (CoglHandle material);
/**
* cogl_material_set_emission:
@@ -362,8 +381,9 @@ float cogl_material_get_shininess (CoglHandle material);
*
* Since: 1.0
*/
-void cogl_material_set_emission (CoglHandle material,
- const CoglColor *emission);
+void
+cogl_material_set_emission (CoglHandle material,
+ const CoglColor *emission);
/**
* cogl_material_get_emission:
@@ -374,8 +394,9 @@ void cogl_material_set_emission (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_get_emission (CoglHandle material,
- CoglColor *emission);
+void
+cogl_material_get_emission (CoglHandle material,
+ CoglColor *emission);
/**
* CoglMaterialAlphaFunc:
@@ -427,9 +448,10 @@ typedef enum {
*
* Since: 1.0
*/
-void cogl_material_set_alpha_test_function (CoglHandle material,
- CoglMaterialAlphaFunc alpha_func,
- float alpha_reference);
+void
+cogl_material_set_alpha_test_function (CoglHandle material,
+ CoglMaterialAlphaFunc alpha_func,
+ float alpha_reference);
/**
* cogl_material_set_blend:
@@ -515,9 +537,10 @@ void cogl_material_set_alpha_test_function (CoglHandle material,
*
* Since: 1.0
*/
-gboolean cogl_material_set_blend (CoglHandle material,
- const char *blend_string,
- GError **error);
+gboolean
+cogl_material_set_blend (CoglHandle material,
+ const char *blend_string,
+ GError **error);
/**
* cogl_material_set_blend_constant:
@@ -529,8 +552,9 @@ gboolean cogl_material_set_blend (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_blend_constant (CoglHandle material,
- CoglColor *constant_color);
+void
+cogl_material_set_blend_constant (CoglHandle material,
+ CoglColor *constant_color);
/**
* cogl_material_set_layer:
@@ -551,9 +575,10 @@ void cogl_material_set_blend_constant (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_layer (CoglHandle material,
- int layer_index,
- CoglHandle texture);
+void
+cogl_material_set_layer (CoglHandle material,
+ int layer_index,
+ CoglHandle texture);
/**
* cogl_material_remove_layer:
@@ -562,8 +587,9 @@ void cogl_material_set_layer (CoglHandle material,
*
* This function removes a layer from your material
*/
-void cogl_material_remove_layer (CoglHandle material,
- gint layer_index);
+void
+cogl_material_remove_layer (CoglHandle material,
+ int layer_index);
/**
@@ -660,7 +686,7 @@ void cogl_material_remove_layer (CoglHandle material,
*/
gboolean
cogl_material_set_layer_combine (CoglHandle material,
- gint layer_index,
+ int layer_index,
const char *blend_string,
GError **error);
@@ -676,9 +702,10 @@ cogl_material_set_layer_combine (CoglHandle material,
*
* Since: 1.0
*/
-void cogl_material_set_layer_combine_constant (CoglHandle material,
- int layer_index,
- CoglColor *constant);
+void
+cogl_material_set_layer_combine_constant (CoglHandle material,
+ int layer_index,
+ CoglColor *constant);
/**
* cogl_material_set_layer_matrix:
@@ -689,9 +716,10 @@ void cogl_material_set_layer_combine_constant (CoglHandle material,
* This function lets you set a matrix that can be used to e.g. translate
* and rotate a single layer of a material used to fill your geometry.
*/
-void cogl_material_set_layer_matrix (CoglHandle material,
- int layer_index,
- CoglMatrix *matrix);
+void
+cogl_material_set_layer_matrix (CoglHandle material,
+ int layer_index,
+ CoglMatrix *matrix);
/**
* cogl_material_get_layers:
@@ -705,7 +733,8 @@ void cogl_material_set_layer_matrix (CoglHandle material,
* functions. The list is owned by COGL and it should not be modified or
* freed
*/
-G_CONST_RETURN GList *cogl_material_get_layers (CoglHandle material);
+G_CONST_RETURN GList *
+cogl_material_get_layers (CoglHandle material);
/**
* cogl_material_get_n_layers:
@@ -717,7 +746,8 @@ G_CONST_RETURN GList *cogl_material_get_layers (CoglHandle material);
*
* Since: 1.0
*/
-int cogl_material_get_n_layers (CoglHandle material);
+int
+cogl_material_get_n_layers (CoglHandle material);
/**
* CoglMaterialLayerType:
@@ -747,7 +777,8 @@ typedef enum {
*
* Return value: the type of the layer
*/
-CoglMaterialLayerType cogl_material_layer_get_type (CoglHandle layer);
+CoglMaterialLayerType
+cogl_material_layer_get_type (CoglHandle layer);
/**
* cogl_material_layer_get_texture:
@@ -763,7 +794,8 @@ CoglMaterialLayerType cogl_material_layer_get_type (CoglHandle layer);
*
* Return value: a #CoglHandle for the texture inside the layer
*/
-CoglHandle cogl_material_layer_get_texture (CoglHandle layer);
+CoglHandle
+cogl_material_layer_get_texture (CoglHandle layer);
/**
* cogl_material_layer_get_min_filter:
@@ -773,7 +805,8 @@ CoglHandle cogl_material_layer_get_texture (CoglHandle layer);
*
* Return value: the current downscaling filter
*/
-CoglMaterialFilter cogl_material_layer_get_min_filter (CoglHandle layer);
+CoglMaterialFilter
+cogl_material_layer_get_min_filter (CoglHandle layer);
/**
* cogl_material_layer_get_mag_filter:
@@ -783,7 +816,8 @@ CoglMaterialFilter cogl_material_layer_get_min_filter (CoglHandle layer);
*
* Return value: the current downscaling filter
*/
-CoglMaterialFilter cogl_material_layer_get_mag_filter (CoglHandle layer);
+CoglMaterialFilter
+cogl_material_layer_get_mag_filter (CoglHandle layer);
/**
* cogl_material_set_layer_filters:
@@ -795,10 +829,11 @@ CoglMaterialFilter cogl_material_layer_get_mag_filter (CoglHandle layer);
* Changes the decimation and interpolation filters used when a texture is
* drawn at other scales than 100%.
*/
-void cogl_material_set_layer_filters (CoglHandle material,
- gint layer_index,
- CoglMaterialFilter min_filter,
- CoglMaterialFilter mag_filter);
+void
+cogl_material_set_layer_filters (CoglHandle material,
+ int layer_index,
+ CoglMaterialFilter min_filter,
+ CoglMaterialFilter mag_filter);
G_END_DECLS
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index eb5215a1..3d84eaf8 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -101,9 +101,9 @@ struct _CoglMatrix
/* Note: we may want to extend this later with private flags
* and a cache of the inverse transform matrix. */
float inv[16];
- gulong type;
- gulong flags;
- gulong _padding3;
+ unsigned long type;
+ unsigned long flags;
+ unsigned long _padding3;
};
/**
@@ -119,7 +119,8 @@ struct _CoglMatrix
* .wx=0; .wy=0; .wz=0; .ww=1;
* ]|
*/
-void cogl_matrix_init_identity (CoglMatrix *matrix);
+void
+cogl_matrix_init_identity (CoglMatrix *matrix);
/**
* cogl_matrix_multiply:
@@ -130,9 +131,10 @@ void cogl_matrix_init_identity (CoglMatrix *matrix);
* Multiplies the two supplied matrices together and stores
* the resulting matrix inside @result
*/
-void cogl_matrix_multiply (CoglMatrix *result,
- const CoglMatrix *a,
- const CoglMatrix *b);
+void
+cogl_matrix_multiply (CoglMatrix *result,
+ const CoglMatrix *a,
+ const CoglMatrix *b);
/**
* cogl_matrix_rotate:
@@ -145,11 +147,12 @@ void cogl_matrix_multiply (CoglMatrix *result,
* Multiplies @matrix with a rotation matrix that applies a rotation
* of @angle degrees around the specified 3D vector.
*/
-void cogl_matrix_rotate (CoglMatrix *matrix,
- float angle,
- float x,
- float y,
- float z);
+void
+cogl_matrix_rotate (CoglMatrix *matrix,
+ float angle,
+ float x,
+ float y,
+ float z);
/**
* cogl_matrix_translate:
@@ -161,10 +164,11 @@ void cogl_matrix_rotate (CoglMatrix *matrix,
* Multiplies @matrix with a transform matrix that translates along
* the X, Y and Z axis.
*/
-void cogl_matrix_translate (CoglMatrix *matrix,
- float x,
- float y,
- float z);
+void
+cogl_matrix_translate (CoglMatrix *matrix,
+ float x,
+ float y,
+ float z);
/**
* cogl_matrix_scale:
@@ -176,10 +180,11 @@ void cogl_matrix_translate (CoglMatrix *matrix,
* Multiplies @matrix with a transform matrix that scales along the X,
* Y and Z axis.
*/
-void cogl_matrix_scale (CoglMatrix *matrix,
- float sx,
- float sy,
- float sz);
+void
+cogl_matrix_scale (CoglMatrix *matrix,
+ float sx,
+ float sy,
+ float sz);
/**
* cogl_matrix_frustum:
@@ -193,13 +198,14 @@ void cogl_matrix_scale (CoglMatrix *matrix,
*
* Multiplies @matrix by the given frustum perspective matrix.
*/
-void cogl_matrix_frustum (CoglMatrix *matrix,
- float left,
- float right,
- float bottom,
- float top,
- float z_near,
- float z_far);
+void
+cogl_matrix_frustum (CoglMatrix *matrix,
+ float left,
+ float right,
+ float bottom,
+ float top,
+ float z_near,
+ float z_far);
/**
* cogl_matrix_perspective:
@@ -218,11 +224,12 @@ void cogl_matrix_frustum (CoglMatrix *matrix,
* be enough precision to identify the depth of objects near to each
* other.</note>
*/
-void cogl_matrix_perspective (CoglMatrix *matrix,
- float fov_y,
- float aspect,
- float z_near,
- float z_far);
+void
+cogl_matrix_perspective (CoglMatrix *matrix,
+ float fov_y,
+ float aspect,
+ float z_near,
+ float z_far);
/**
* cogl_matrix_ortho:
@@ -238,13 +245,14 @@ void cogl_matrix_perspective (CoglMatrix *matrix,
*
* Multiplies @matrix by a parallel projection matrix.
*/
-void cogl_matrix_ortho (CoglMatrix *matrix,
- float left,
- float right,
- float bottom,
- float top,
- float z_near,
- float z_far);
+void
+cogl_matrix_ortho (CoglMatrix *matrix,
+ float left,
+ float right,
+ float bottom,
+ float top,
+ float z_near,
+ float z_far);
/**
* cogl_matrix_init_from_array:
@@ -253,8 +261,9 @@ void cogl_matrix_ortho (CoglMatrix *matrix,
*
* Initializes @matrix with the contents of @array
*/
-void cogl_matrix_init_from_array (CoglMatrix *matrix,
- const float *array);
+void
+cogl_matrix_init_from_array (CoglMatrix *matrix,
+ const float *array);
/**
* cogl_matrix_get_array:
@@ -264,7 +273,8 @@ void cogl_matrix_init_from_array (CoglMatrix *matrix,
*
* Return value: a pointer to the float array
*/
-G_CONST_RETURN float *cogl_matrix_get_array (const CoglMatrix *matrix);
+G_CONST_RETURN float *
+cogl_matrix_get_array (const CoglMatrix *matrix);
/**
* cogl_matrix_get_inverse:
@@ -286,8 +296,9 @@ G_CONST_RETURN float *cogl_matrix_get_array (const CoglMatrix *matrix);
*
* Since: 1.2
*/
-gboolean cogl_matrix_get_inverse (const CoglMatrix *matrix,
- CoglMatrix *inverse);
+gboolean
+cogl_matrix_get_inverse (const CoglMatrix *matrix,
+ CoglMatrix *inverse);
/**
* cogl_matrix_transform_point:
@@ -300,11 +311,12 @@ gboolean cogl_matrix_get_inverse (const CoglMatrix *matrix,
* Transforms a point whos position is given and returned as four float
* components.
*/
-void cogl_matrix_transform_point (const CoglMatrix *matrix,
- float *x,
- float *y,
- float *z,
- float *w);
+void
+cogl_matrix_transform_point (const CoglMatrix *matrix,
+ float *x,
+ float *y,
+ float *z,
+ float *w);
G_END_DECLS
diff --git a/cogl/cogl-path.h b/cogl/cogl-path.h
index 08d8af92..692b5964 100644
--- a/cogl/cogl-path.h
+++ b/cogl/cogl-path.h
@@ -63,10 +63,11 @@ G_BEGIN_DECLS
*
* Fills a rectangle at the given coordinates with the current source material
**/
-void cogl_rectangle (float x_1,
- float y_1,
- float x_2,
- float y_2);
+void
+cogl_rectangle (float x_1,
+ float y_1,
+ float x_2,
+ float y_2);
/**
* cogl_path_fill:
@@ -75,7 +76,8 @@ void cogl_rectangle (float x_1,
* current path is then cleared. To use the path again, call
* cogl_path_fill_preserve() instead.
**/
-void cogl_path_fill (void);
+void
+cogl_path_fill (void);
/**
* cogl_path_fill_preserve:
@@ -85,7 +87,8 @@ void cogl_path_fill (void);
*
* Since: 1.0
**/
-void cogl_path_fill_preserve (void);
+void
+cogl_path_fill_preserve (void);
/**
* cogl_path_stroke:
@@ -95,7 +98,8 @@ void cogl_path_fill_preserve (void);
* matrix). To current path is then cleared. To use the path again,
* call cogl_path_stroke_preserve() instead.
**/
-void cogl_path_stroke (void);
+void
+cogl_path_stroke (void);
/**
@@ -106,7 +110,8 @@ void cogl_path_stroke (void);
*
* Since: 1.0
**/
-void cogl_path_stroke_preserve (void);
+void
+cogl_path_stroke_preserve (void);
/**
* cogl_path_new:
@@ -115,7 +120,8 @@ void cogl_path_stroke_preserve (void);
*
* Since: 1.0
*/
-void cogl_path_new (void);
+void
+cogl_path_new (void);
/**
* cogl_path_move_to:
@@ -125,8 +131,9 @@ void cogl_path_new (void);
* Moves the pen to the given location. If there is an existing path
* this will start a new disjoint subpath.
**/
-void cogl_path_move_to (float x,
- float y);
+void
+cogl_path_move_to (float x,
+ float y);
/**
@@ -138,8 +145,9 @@ void cogl_path_move_to (float x,
* location. If there is an existing path this will start a new
* disjoint subpath.
**/
-void cogl_path_rel_move_to (float x,
- float y);
+void
+cogl_path_rel_move_to (float x,
+ float y);
/**
* cogl_path_line_to:
@@ -149,8 +157,9 @@ void cogl_path_rel_move_to (float x,
* Adds a straight line segment to the current path that ends at the
* given coordinates.
**/
-void cogl_path_line_to (float x,
- float y);
+void
+cogl_path_line_to (float x,
+ float y);
/**
* cogl_path_rel_line_to:
@@ -160,8 +169,9 @@ void cogl_path_line_to (float x,
* Adds a straight line segment to the current path that ends at the
* given coordinates relative to the current pen location.
**/
-void cogl_path_rel_line_to (float x,
- float y);
+void
+cogl_path_rel_line_to (float x,
+ float y);
/**
@@ -178,14 +188,13 @@ void cogl_path_rel_line_to (float x,
* of the arc. If you perform a move_to to the arcs start just before
* drawing it you create a free standing arc.
**/
-void cogl_path_arc (float center_x,
- float center_y,
- float radius_x,
- float radius_y,
- float angle_1,
- float angle_2);
-
-
+void
+cogl_path_arc (float center_x,
+ float center_y,
+ float radius_x,
+ float radius_y,
+ float angle_1,
+ float angle_2);
/**
* cogl_path_curve_to:
@@ -200,12 +209,13 @@ void cogl_path_arc (float center_x,
* second, third and fourth control points and using current pen location
* as the first control point.
**/
-void cogl_path_curve_to (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float x_3,
- float y_3);
+void
+cogl_path_curve_to (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float x_3,
+ float y_3);
/**
* cogl_path_rel_curve_to:
@@ -221,12 +231,13 @@ void cogl_path_curve_to (float x_1,
* as the first control point. The given coordinates are relative to the
* current pen location.
*/
-void cogl_path_rel_curve_to (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float x_3,
- float y_3);
+void
+cogl_path_rel_curve_to (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float x_3,
+ float y_3);
/**
* cogl_path_close:
@@ -234,7 +245,8 @@ void cogl_path_rel_curve_to (float x_1,
* Closes the path being constructed by adding a straight line segment
* to it that ends at the first vertex of the path.
**/
-void cogl_path_close (void);
+void
+cogl_path_close (void);
/**
* cogl_path_line:
@@ -247,10 +259,11 @@ void cogl_path_close (void);
* coordinates. If there is an existing path this will start a new
* disjoint sub-path.
**/
-void cogl_path_line (float x_1,
- float y_1,
- float x_2,
- float y_2);
+void
+cogl_path_line (float x_1,
+ float y_1,
+ float x_2,
+ float y_2);
/**
* cogl_path_polyline:
@@ -270,8 +283,9 @@ void cogl_path_line (float x_1,
* fashion for the rest of the vertices. (num_points - 1) segments will
* be constructed.
**/
-void cogl_path_polyline (float *coords,
- gint num_points);
+void
+cogl_path_polyline (float *coords,
+ int num_points);
/**
@@ -288,8 +302,9 @@ void cogl_path_polyline (float *coords,
* represents the Y coordinate of the first vertex, continuing in the same
* fashion for the rest of the vertices.
**/
-void cogl_path_polygon (float *coords,
- gint num_points);
+void
+cogl_path_polygon (float *coords,
+ int num_points);
/**
@@ -302,10 +317,11 @@ void cogl_path_polygon (float *coords,
* Constructs a rectangular shape at the given coordinates. If there
* is an existing path this will start a new disjoint sub-path.
**/
-void cogl_path_rectangle (float x_1,
- float y_1,
- float x_2,
- float y_2);
+void
+cogl_path_rectangle (float x_1,
+ float y_1,
+ float x_2,
+ float y_2);
/**
* cogl_path_ellipse:
@@ -317,10 +333,11 @@ void cogl_path_rectangle (float x_1,
* Constructs an ellipse shape. If there is an existing path this will
* start a new disjoint sub-path.
**/
-void cogl_path_ellipse (float center_x,
- float center_y,
- float radius_x,
- float radius_y);
+void
+cogl_path_ellipse (float center_x,
+ float center_y,
+ float radius_x,
+ float radius_y);
/**
* cogl_path_round_rectangle:
@@ -335,12 +352,13 @@ void cogl_path_ellipse (float center_x,
* Constructs a rectangular shape with rounded corners. If there is an
* existing path this will start a new disjoint sub-path.
**/
-void cogl_path_round_rectangle (float x_1,
- float y_1,
- float x_2,
- float y_2,
- float radius,
- float arc_step);
+void
+cogl_path_round_rectangle (float x_1,
+ float y_1,
+ float x_2,
+ float y_2,
+ float radius,
+ float arc_step);
G_END_DECLS
diff --git a/cogl/cogl-pixel-buffer-private.h b/cogl/cogl-pixel-buffer-private.h
index 593d8f02..470f95d8 100644
--- a/cogl/cogl-pixel-buffer-private.h
+++ b/cogl/cogl-pixel-buffer-private.h
@@ -59,13 +59,14 @@ typedef struct _CoglPixelBuffer
GLenum gl_target;
CoglPixelFormat format;
- guint width;
- guint height;
- guint stride;
+ unsigned int width;
+ unsigned int height;
+ unsigned int stride;
} CoglPixelBuffer;
-GQuark _cogl_handle_pixel_buffer_get_type (void);
+GQuark
+_cogl_handle_pixel_buffer_get_type (void);
G_END_DECLS
diff --git a/cogl/cogl-pixel-buffer.c b/cogl/cogl-pixel-buffer.c
index 4ee73981..9c4f029d 100644
--- a/cogl/cogl-pixel-buffer.c
+++ b/cogl/cogl-pixel-buffer.c
@@ -76,12 +76,15 @@
#endif
-static void _cogl_pixel_buffer_free (CoglPixelBuffer *buffer);
+static void
+_cogl_pixel_buffer_free (CoglPixelBuffer *buffer);
#if !defined (COGL_HAS_GLES)
-static const CoglBufferVtable cogl_pixel_buffer_vtable;
+static const CoglBufferVtable
+cogl_pixel_buffer_vtable;
#endif
-static const CoglBufferVtable cogl_malloc_pixel_buffer_vtable;
+static const CoglBufferVtable
+cogl_malloc_pixel_buffer_vtable;
/* we don't want to use the stock COGL_HANDLE_DEFINE * for 2 reasons:
* - it defines already deprecated symbols
@@ -138,7 +141,7 @@ cogl_is_##type_name##_EXP (CoglHandle handle) \
COGL_HANDLE_DEFINE_EXP(PixelBuffer, pixel_buffer)
CoglHandle
-cogl_pixel_buffer_new_EXP (guint size)
+cogl_pixel_buffer_new_EXP (unsigned int size)
{
CoglPixelBuffer *pixel_buffer = g_slice_new0 (CoglPixelBuffer);
CoglBuffer *buffer = COGL_BUFFER (pixel_buffer);
@@ -179,14 +182,14 @@ cogl_pixel_buffer_new_EXP (guint size)
}
CoglHandle
-cogl_pixel_buffer_new_for_size_EXP (guint width,
- guint height,
- CoglPixelFormat format,
- guint *rowstride)
+cogl_pixel_buffer_new_for_size_EXP (unsigned int width,
+ unsigned int height,
+ CoglPixelFormat format,
+ unsigned int *rowstride)
{
CoglHandle buffer;
CoglPixelBuffer *pixel_buffer;
- guint stride;
+ unsigned int stride;
/* creating a buffer to store "any" format does not make sense */
if (G_UNLIKELY (format == COGL_PIXEL_FORMAT_ANY))
@@ -225,13 +228,13 @@ _cogl_pixel_buffer_free (CoglPixelBuffer *buffer)
}
#if !defined (COGL_HAS_GLES)
-static guchar *
+static guint8 *
_cogl_pixel_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access)
{
CoglPixelBuffer *pixel_buffer = COGL_PIXEL_BUFFER (buffer);
GLenum gl_target;
- guchar *data;
+ guint8 *data;
_COGL_GET_CONTEXT (ctx, NULL);
@@ -281,9 +284,9 @@ _cogl_pixel_buffer_unmap (CoglBuffer *buffer)
static gboolean
_cogl_pixel_buffer_set_data (CoglBuffer *buffer,
- guint offset,
- const guchar *data,
- guint size)
+ unsigned int offset,
+ const guint8 *data,
+ unsigned int size)
{
CoglPixelBuffer *pixel_buffer = COGL_PIXEL_BUFFER (buffer);
@@ -315,13 +318,13 @@ _cogl_pixel_buffer_set_data (CoglBuffer *buffer,
#if 0
gboolean
-cogl_pixel_buffer_set_region_EXP (CoglHandle buffer,
- guchar *data,
- guint src_width,
- guint src_height,
- guint src_rowstride,
- guint dst_x,
- guint dst_y)
+cogl_pixel_buffer_set_region_EXP (CoglHandle buffer,
+ guint8 *data,
+ unsigned int src_width,
+ unsigned int src_height,
+ unsigned int src_rowstride,
+ unsigned int dst_x,
+ unsigned int dst_y)
{
if (!cogl_is_pixel_buffer (buffer))
return FALSE;
@@ -342,7 +345,7 @@ static const CoglBufferVtable cogl_pixel_buffer_vtable =
* Fallback path, buffer->data points to a malloc'ed buffer.
*/
-static guchar *
+static guint8 *
_cogl_malloc_pixel_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access)
{
@@ -358,9 +361,9 @@ _cogl_malloc_pixel_buffer_unmap (CoglBuffer *buffer)
static gboolean
_cogl_malloc_pixel_buffer_set_data (CoglBuffer *buffer,
- guint offset,
- const guchar *data,
- guint size)
+ unsigned int offset,
+ const guint8 *data,
+ unsigned int size)
{
memcpy (buffer->data + offset, data, size);
return TRUE;
diff --git a/cogl/cogl-pixel-buffer.h b/cogl/cogl-pixel-buffer.h
index 43c0f326..4c9956a3 100644
--- a/cogl/cogl-pixel-buffer.h
+++ b/cogl/cogl-pixel-buffer.h
@@ -50,7 +50,7 @@ G_BEGIN_DECLS
* Stability: Unstable
*/
CoglHandle
-cogl_pixel_buffer_new (guint size);
+cogl_pixel_buffer_new (unsigned int size);
/**
* cogl_pixel_buffer_new_for_size:
@@ -75,10 +75,10 @@ cogl_pixel_buffer_new (guint size);
* Stability: Unstable
*/
CoglHandle
-cogl_pixel_buffer_new_for_size (guint width,
- guint height,
+cogl_pixel_buffer_new_for_size (unsigned int width,
+ unsigned int height,
CoglPixelFormat format,
- guint *stride);
+ unsigned int *stride);
/**
* cogl_is_pixel_buffer:
@@ -117,13 +117,13 @@ cogl_is_pixel_buffer (CoglHandle handle);
*/
#if 0
gboolean
-cogl_pixel_buffer_set_region (CoglHandle buffer,
- guchar *data,
- guint src_width,
- guint src_height,
- guint src_rowstride,
- guint dst_x,
- guint dst_y);
+cogl_pixel_buffer_set_region (CoglHandle buffer,
+ guint8 *data,
+ unsigned int src_width,
+ unsigned int src_height,
+ unsigned int src_rowstride,
+ unsigned int dst_x,
+ unsigned int dst_y);
#endif
/* the functions above are experimental, the actual symbols are suffixed by
@@ -132,25 +132,25 @@ cogl_pixel_buffer_set_region (CoglHandle buffer,
* above into the real symbols */
CoglHandle
-cogl_pixel_buffer_new_EXP (guint size);
+cogl_pixel_buffer_new_EXP (unsigned int size);
CoglHandle
-cogl_pixel_buffer_new_for_size_EXP (guint width,
- guint height,
- CoglPixelFormat format,
- guint *stride);
+cogl_pixel_buffer_new_for_size_EXP (unsigned int width,
+ unsigned int height,
+ CoglPixelFormat format,
+ unsigned int *stride);
gboolean
cogl_is_pixel_buffer_EXP (CoglHandle handle);
#if 0
gboolean
-cogl_pixel_buffer_set_region_EXP (CoglHandle buffer,
- guchar *data,
- guint src_width,
- guint src_height,
- guint src_rowstride,
- guint dst_x,
- guint dst_y);
+cogl_pixel_buffer_set_region_EXP (CoglHandle buffer,
+ guint8 *data,
+ unsigned int src_width,
+ unsigned int src_height,
+ unsigned int src_rowstride,
+ unsigned int dst_x,
+ unsigned int dst_y);
#endif
#define cogl_pixel_buffer_new cogl_pixel_buffer_new_EXP
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index 419fc77f..e8f0f63f 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2007,2008,2009 Intel Corporation.
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -250,7 +250,7 @@ _cogl_multitexture_quad_single_primitive (float x_1,
float *out_tex_coords;
float default_tex_coords[4] = {0.0, 0.0, 1.0, 1.0};
gboolean need_repeat = FALSE;
- gint coord_num;
+ int coord_num;
GLenum wrap_mode;
tex_handle = cogl_material_layer_get_texture (layer);
@@ -364,13 +364,13 @@ struct _CoglMutiTexturedRect
float x_2;
float y_2;
const float *tex_coords;
- gint tex_coords_len;
+ int tex_coords_len;
};
static void
_cogl_rectangles_with_multitexture_coords (
struct _CoglMutiTexturedRect *rects,
- gint n_rects)
+ int n_rects)
{
CoglHandle material;
const GList *layers;
@@ -395,7 +395,7 @@ _cogl_rectangles_with_multitexture_coords (
{
CoglHandle layer = tmp->data;
CoglHandle tex_handle;
- gulong flags;
+ unsigned long flags;
if (cogl_material_layer_get_type (layer)
!= COGL_MATERIAL_LAYER_TYPE_TEXTURE)
@@ -542,7 +542,7 @@ _cogl_rectangles_with_multitexture_coords (
void
cogl_rectangles (const float *verts,
- guint n_rects)
+ unsigned int n_rects)
{
struct _CoglMutiTexturedRect *rects;
int i;
@@ -564,7 +564,7 @@ cogl_rectangles (const float *verts,
void
cogl_rectangles_with_texture_coords (const float *verts,
- guint n_rects)
+ unsigned int n_rects)
{
struct _CoglMutiTexturedRect *rects;
int i;
@@ -617,7 +617,7 @@ cogl_rectangle_with_multitexture_coords (float x_1,
float x_2,
float y_2,
const float *user_tex_coords,
- gint user_tex_coords_len)
+ int user_tex_coords_len)
{
struct _CoglMutiTexturedRect rect;
@@ -756,9 +756,9 @@ _cogl_texture_polygon_multiple_primitives (const CoglTextureVertex *vertices,
static void
_cogl_multitexture_polygon_single_primitive (const CoglTextureVertex *vertices,
- guint n_vertices,
- guint n_layers,
- guint stride,
+ unsigned int n_vertices,
+ unsigned int n_layers,
+ unsigned int stride,
gboolean use_color,
guint32 fallback_layers)
{
@@ -835,7 +835,7 @@ _cogl_multitexture_polygon_single_primitive (const CoglTextureVertex *vertices,
void
cogl_polygon (const CoglTextureVertex *vertices,
- guint n_vertices,
+ unsigned int n_vertices,
gboolean use_color)
{
CoglHandle material;
@@ -844,8 +844,8 @@ cogl_polygon (const CoglTextureVertex *vertices,
gboolean use_sliced_polygon_fallback = FALSE;
guint32 fallback_layers = 0;
int i;
- gulong enable_flags;
- guint stride;
+ unsigned long enable_flags;
+ unsigned int stride;
gsize stride_bytes;
GLfloat *v;
int prev_n_texcoord_arrays_enabled;
@@ -1081,7 +1081,7 @@ _cogl_path_stroke_nodes (void)
path_start);
GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode),
- (guchar *) path
+ (guint8 *) path
+ G_STRUCT_OFFSET (CoglPathNode, x)) );
GE( glDrawArrays (GL_LINE_STRIP, 0, path->path_size) );
@@ -1200,7 +1200,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
while (path_start < path_size)
{
GE (glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode),
- (guchar *) path
+ (guint8 *) path
+ G_STRUCT_OFFSET (CoglPathNode, x)));
GE (glDrawArrays (GL_TRIANGLE_FAN, 0, path->path_size));
@@ -1273,7 +1273,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
cogl_handle_unref (prev_source);
}
-static gint
+static int
compare_ints (gconstpointer a,
gconstpointer b)
{
@@ -1359,7 +1359,7 @@ _cogl_path_fill_nodes_scanlines (CoglPathNode *path,
y - bounds_y < bounds_h &&
lastline != y)
{
- gint x = prev_x + (dx * (y-prev_y)) / dy;
+ int x = prev_x + (dx * (y-prev_y)) / dy;
scanlines[ y - bounds_y ]=
g_slist_insert_sorted (scanlines[ y - bounds_y],
@@ -1640,9 +1640,9 @@ cogl_path_line (float x_1,
void
cogl_path_polyline (float *coords,
- gint num_points)
+ int num_points)
{
- gint c = 0;
+ int c = 0;
cogl_path_move_to (coords[0], coords[1]);
@@ -1652,7 +1652,7 @@ cogl_path_polyline (float *coords,
void
cogl_path_polygon (float *coords,
- gint num_points)
+ int num_points)
{
cogl_path_polyline (coords, num_points);
cogl_path_close ();
@@ -1679,7 +1679,7 @@ _cogl_path_arc (float center_x,
float angle_1,
float angle_2,
float angle_step,
- guint move_first)
+ unsigned int move_first)
{
float a = 0x0;
float cosa = 0x0;
@@ -1856,7 +1856,7 @@ _cogl_path_bezier3_sub (CoglBezCubic *cubic)
floatVec2 c3;
floatVec2 c4;
floatVec2 c5;
- gint cindex;
+ int cindex;
/* Put first curve on stack */
cubics[0] = *cubic;
@@ -2001,7 +2001,7 @@ _cogl_path_bezier2_sub (CoglBezQuad *quad)
floatVec2 c1;
floatVec2 c2;
floatVec2 c3;
- gint qindex;
+ int qindex;
/* Put first curve on stack */
quads[0] = *quad;
diff --git a/cogl/cogl-primitives.h b/cogl/cogl-primitives.h
index c2d76d62..0d465d1a 100644
--- a/cogl/cogl-primitives.h
+++ b/cogl/cogl-primitives.h
@@ -24,10 +24,10 @@
#ifndef __COGL_PRIMITIVES_H
#define __COGL_PRIMITIVES_H
-typedef struct _floatVec2 floatVec2;
-typedef struct _CoglBezQuad CoglBezQuad;
-typedef struct _CoglBezCubic CoglBezCubic;
-typedef struct _CoglPathNode CoglPathNode;
+typedef struct _floatVec2 floatVec2;
+typedef struct _CoglBezQuad CoglBezQuad;
+typedef struct _CoglBezCubic CoglBezCubic;
+typedef struct _CoglPathNode CoglPathNode;
struct _floatVec2
{
@@ -39,7 +39,7 @@ struct _CoglPathNode
{
float x;
float y;
- guint path_size;
+ unsigned int path_size;
};
struct _CoglBezQuad
@@ -57,6 +57,7 @@ struct _CoglBezCubic
floatVec2 p4;
};
-void _cogl_journal_flush (void);
+void
+_cogl_journal_flush (void);
#endif /* __COGL_PRIMITIVES_H */
diff --git a/cogl/cogl-shader.h b/cogl/cogl-shader.h
index f92b85fa..b36e93e5 100644
--- a/cogl/cogl-shader.h
+++ b/cogl/cogl-shader.h
@@ -66,7 +66,8 @@ typedef enum {
*
* Returns: a new shader handle.
*/
-CoglHandle cogl_create_shader (CoglShaderType shader_type);
+CoglHandle
+cogl_create_shader (CoglShaderType shader_type);
/**
* cogl_shader_ref:
@@ -76,7 +77,8 @@ CoglHandle cogl_create_shader (CoglShaderType shader_type);
*
* Returns: @handle
*/
-CoglHandle cogl_shader_ref (CoglHandle handle);
+CoglHandle
+cogl_shader_ref (CoglHandle handle);
/**
* cogl_shader_unref:
@@ -85,7 +87,8 @@ CoglHandle cogl_shader_ref (CoglHandle handle);
* Removes a reference to a shader. If it was the last reference the
* shader object will be destroyed.
*/
-void cogl_shader_unref (CoglHandle handle);
+void
+cogl_shader_unref (CoglHandle handle);
/**
* cogl_is_shader:
@@ -96,7 +99,7 @@ void cogl_shader_unref (CoglHandle handle);
* Returns: %TRUE if the handle references a shader,
* %FALSE otherwise
*/
-gboolean cogl_is_shader (CoglHandle handle);
+gboolean cogl_is_shader (CoglHandle handle);
/**
* cogl_shader_source:
@@ -106,8 +109,9 @@ gboolean cogl_is_shader (CoglHandle handle);
* Replaces the current GLSL source associated with a shader with a new
* one.
*/
-void cogl_shader_source (CoglHandle shader,
- const gchar *source);
+void
+cogl_shader_source (CoglHandle shader,
+ const char *source);
/**
* cogl_shader_compile:
* @handle: #CoglHandle for a shader.
@@ -115,7 +119,8 @@ void cogl_shader_source (CoglHandle shader,
* Compiles the shader, no return value, but the shader is now ready for
* linking into a program.
*/
-void cogl_shader_compile (CoglHandle handle);
+void
+cogl_shader_compile (CoglHandle handle);
/**
* cogl_shader_get_info_log:
@@ -129,7 +134,8 @@ void cogl_shader_compile (CoglHandle handle);
* Return value: a newly allocated string containing the info log. Use
* g_free() to free it
*/
-gchar * cogl_shader_get_info_log (CoglHandle handle);
+char *
+cogl_shader_get_info_log (CoglHandle handle);
/**
* cogl_shader_get_type:
@@ -140,7 +146,8 @@ gchar * cogl_shader_get_info_log (CoglHandle handle);
* Return value: %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor
* or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
*/
-CoglShaderType cogl_shader_get_type (CoglHandle handle);
+CoglShaderType
+cogl_shader_get_type (CoglHandle handle);
/**
* cogl_shader_is_compiled:
@@ -150,7 +157,8 @@ CoglShaderType cogl_shader_get_type (CoglHandle handle);
*
* Return value: %TRUE if the shader object has sucessfully be compiled
*/
-gboolean cogl_shader_is_compiled (CoglHandle handle);
+gboolean
+cogl_shader_is_compiled (CoglHandle handle);
/**
* cogl_create_program:
@@ -160,7 +168,8 @@ gboolean cogl_shader_is_compiled (CoglHandle handle);
*
* Returns: a new cogl program.
*/
-CoglHandle cogl_create_program (void);
+CoglHandle
+cogl_create_program (void);
/**
* cogl_program_ref:
@@ -170,7 +179,8 @@ CoglHandle cogl_create_program (void);
*
* Returns: @handle
*/
-CoglHandle cogl_program_ref (CoglHandle handle);
+CoglHandle
+cogl_program_ref (CoglHandle handle);
/**
* cogl_program_unref:
@@ -179,7 +189,8 @@ CoglHandle cogl_program_ref (CoglHandle handle);
* Removes a reference to a program. If it was the last reference the
* program object will be destroyed.
*/
-void cogl_program_unref (CoglHandle handle);
+void
+cogl_program_unref (CoglHandle handle);
/**
* cogl_is_program:
@@ -190,7 +201,8 @@ void cogl_program_unref (CoglHandle handle);
* Returns: %TRUE if the handle references a program,
* %FALSE otherwise
*/
-gboolean cogl_is_program (CoglHandle handle);
+gboolean
+cogl_is_program (CoglHandle handle);
/**
* cogl_program_attach_shader:
@@ -200,8 +212,9 @@ gboolean cogl_is_program (CoglHandle handle);
* Attaches a shader to a program object, a program can have one vertex shader
* and one fragment shader attached.
*/
-void cogl_program_attach_shader (CoglHandle program_handle,
- CoglHandle shader_handle);
+void
+cogl_program_attach_shader (CoglHandle program_handle,
+ CoglHandle shader_handle);
/**
@@ -210,7 +223,8 @@ void cogl_program_attach_shader (CoglHandle program_handle,
*
* Links a program making it ready for use.
*/
-void cogl_program_link (CoglHandle handle);
+void
+cogl_program_link (CoglHandle handle);
/**
* cogl_program_use:
@@ -220,7 +234,8 @@ void cogl_program_link (CoglHandle handle);
* rendering pipeline, if passed in %COGL_INVALID_HANDLE the default
* behavior of GL is reinstated.
*/
-void cogl_program_use (CoglHandle handle);
+void
+cogl_program_use (CoglHandle handle);
/**
* cogl_program_get_uniform_location:
@@ -235,9 +250,9 @@ void cogl_program_use (CoglHandle handle);
* This uniform can be set using cogl_program_uniform_1f() when the
* program is in use.
*/
-int cogl_program_get_uniform_location
- (CoglHandle handle,
- const char *uniform_name);
+int
+cogl_program_get_uniform_location (CoglHandle handle,
+ const char *uniform_name);
/**
* cogl_program_uniform_1f:
@@ -247,8 +262,9 @@ int cogl_program_get_uniform_location
* Changes the value of a floating point uniform in the currently
* used (see cogl_program_use()) shader program.
*/
-void cogl_program_uniform_1f (int uniform_no,
- float value);
+void
+cogl_program_uniform_1f (int uniform_no,
+ float value);
/**
* cogl_program_uniform_1i:
@@ -258,8 +274,9 @@ void cogl_program_uniform_1f (int uniform_no,
* Changes the value of an integer uniform in the currently
* used (see cogl_program_use()) shader program.
*/
-void cogl_program_uniform_1i (int uniform_no,
- int value);
+void
+cogl_program_uniform_1i (int uniform_no,
+ int value);
/**
* cogl_program_uniform_float:
@@ -271,10 +288,11 @@ void cogl_program_uniform_1i (int uniform_no,
* Changes the value of a float vector uniform, or uniform array in the
* currently used (see cogl_program_use()) shader program.
*/
-void cogl_program_uniform_float (int uniform_no,
- int size,
- int count,
- const GLfloat *value);
+void
+cogl_program_uniform_float (int uniform_no,
+ int size,
+ int count,
+ const GLfloat *value);
/**
* cogl_program_uniform_int:
@@ -286,10 +304,11 @@ void cogl_program_uniform_float (int uniform_no,
* Changes the value of a int vector uniform, or uniform array in the
* currently used (see cogl_program_use()) shader program.
*/
-void cogl_program_uniform_int (int uniform_no,
- int size,
- int count,
- const int *value);
+void
+cogl_program_uniform_int (int uniform_no,
+ int size,
+ int count,
+ const int *value);
/**
* cogl_program_uniform_matrix:
@@ -303,11 +322,12 @@ void cogl_program_uniform_int (int uniform_no,
* currently used (see cogl_program_use()) shader program. The @size
* parameter is used to determine the square size of the matrix.
*/
-void cogl_program_uniform_matrix (int uniform_no,
- int size,
- int count,
- gboolean transpose,
- const float *value);
+void
+cogl_program_uniform_matrix (int uniform_no,
+ int size,
+ int count,
+ gboolean transpose,
+ const float *value);
G_END_DECLS
diff --git a/cogl/cogl-sub-texture-private.h b/cogl/cogl-sub-texture-private.h
index c8fa4bbc..16513425 100644
--- a/cogl/cogl-sub-texture-private.h
+++ b/cogl/cogl-sub-texture-private.h
@@ -38,10 +38,10 @@ struct _CoglSubTexture
CoglHandle full_texture;
/* The region represented by this sub-texture */
- gint sub_x;
- gint sub_y;
- gint sub_width;
- gint sub_height;
+ int sub_x;
+ int sub_y;
+ int sub_width;
+ int sub_height;
};
GQuark
@@ -49,7 +49,9 @@ _cogl_handle_sub_texture_get_type (void);
CoglHandle
_cogl_sub_texture_new (CoglHandle full_texture,
- gint sub_x, gint sub_y,
- gint sub_width, gint sub_height);
+ int sub_x,
+ int sub_y,
+ int sub_width,
+ int sub_height);
#endif /* __COGL_SUB_TEXTURE_H */
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index 31828239..d28bcf85 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2009 Intel Corporation.
+ * Copyright (C) 2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -47,12 +47,12 @@ COGL_HANDLE_DEFINE (SubTexture, sub_texture);
static const CoglTextureVtable cogl_sub_texture_vtable;
static void
-_cogl_sub_texture_map_range (gfloat *t1, gfloat *t2,
- gint sub_offset,
- gint sub_size,
- gint full_size)
+_cogl_sub_texture_map_range (float *t1, float *t2,
+ int sub_offset,
+ int sub_size,
+ int full_size)
{
- gfloat t1_frac, t1_int, t2_frac, t2_int;
+ float t1_frac, t1_int, t2_frac, t2_int;
t1_frac = modff (*t1, &t1_int);
t2_frac = modff (*t2, &t2_int);
@@ -98,10 +98,10 @@ _cogl_sub_texture_map_range (gfloat *t1, gfloat *t2,
static void
_cogl_sub_texture_map_quad (CoglSubTexture *sub_tex,
- gfloat *coords)
+ float *coords)
{
- guint full_width = cogl_texture_get_width (sub_tex->full_texture);
- guint full_height = cogl_texture_get_height (sub_tex->full_texture);
+ unsigned int full_width = cogl_texture_get_width (sub_tex->full_texture);
+ unsigned int full_height = cogl_texture_get_height (sub_tex->full_texture);
_cogl_sub_texture_map_range (coords + 0, coords + 2,
sub_tex->sub_x, sub_tex->sub_width,
@@ -113,13 +113,13 @@ _cogl_sub_texture_map_quad (CoglSubTexture *sub_tex,
/* Maps from the texture coordinates of the full texture to the
texture coordinates of the sub texture */
-static gfloat
-_cogl_sub_texture_unmap_coord (gfloat t,
- gint sub_offset,
- gint sub_size,
- gint full_size)
+static float
+_cogl_sub_texture_unmap_coord (float t,
+ int sub_offset,
+ int sub_size,
+ int full_size)
{
- gfloat frac_part, int_part;
+ float frac_part, int_part;
/* Convert the fractional part leaving the integer part in tact */
frac_part = modff (t, &int_part);
@@ -135,11 +135,11 @@ _cogl_sub_texture_unmap_coord (gfloat t,
static void
_cogl_sub_texture_unmap_coords (CoglSubTexture *sub_tex,
- gfloat *s,
- gfloat *t)
+ float *s,
+ float *t)
{
- guint full_width = cogl_texture_get_width (sub_tex->full_texture);
- guint full_height = cogl_texture_get_height (sub_tex->full_texture);
+ unsigned int full_width = cogl_texture_get_width (sub_tex->full_texture);
+ unsigned int full_height = cogl_texture_get_height (sub_tex->full_texture);
*s = _cogl_sub_texture_unmap_coord (*s, sub_tex->sub_x, sub_tex->sub_width,
full_width);
@@ -242,12 +242,12 @@ _cogl_sub_texture_free (CoglSubTexture *sub_tex)
CoglHandle
_cogl_sub_texture_new (CoglHandle full_texture,
- gint sub_x, gint sub_y,
- gint sub_width, gint sub_height)
+ int sub_x, int sub_y,
+ int sub_width, int sub_height)
{
CoglSubTexture *sub_tex;
CoglTexture *tex;
- guint full_width, full_height;
+ unsigned int full_width, full_height;
full_width = cogl_texture_get_width (full_texture);
full_height = cogl_texture_get_height (full_texture);
@@ -273,7 +273,7 @@ _cogl_sub_texture_new (CoglHandle full_texture,
return _cogl_sub_texture_handle_new (sub_tex);
}
-static gint
+static int
_cogl_sub_texture_get_max_waste (CoglTexture *tex)
{
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
@@ -403,14 +403,14 @@ _cogl_sub_texture_set_region (CoglTexture *tex,
}
static void
-_cogl_sub_texture_copy_region (guchar *dst,
- const guchar *src,
- gint dst_x, gint dst_y,
- gint src_x, gint src_y,
- gint width, gint height,
- gint dst_rowstride,
- gint src_rowstride,
- gint bpp)
+_cogl_sub_texture_copy_region (guint8 *dst,
+ const guint8 *src,
+ int dst_x, int dst_y,
+ int src_x, int src_y,
+ int width, int height,
+ int dst_rowstride,
+ int src_rowstride,
+ int bpp)
{
int y;
@@ -435,8 +435,8 @@ _cogl_sub_texture_get_data (CoglTexture *tex,
unsigned int full_rowstride;
guint8 *full_data;
int byte_size, full_size;
- gint bpp;
- gint full_tex_width, full_tex_height;
+ int bpp;
+ int full_tex_width, full_tex_height;
/* FIXME: This gets the full data from the full texture and then
copies a subregion of that. It would be better if there was a
@@ -500,7 +500,7 @@ _cogl_sub_texture_get_gl_format (CoglTexture *tex)
return _cogl_texture_get_gl_format (sub_tex->full_texture);
}
-static gint
+static int
_cogl_sub_texture_get_width (CoglTexture *tex)
{
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
@@ -508,7 +508,7 @@ _cogl_sub_texture_get_width (CoglTexture *tex)
return sub_tex->sub_width;
}
-static gint
+static int
_cogl_sub_texture_get_height (CoglTexture *tex)
{
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
diff --git a/cogl/cogl-texture-2d-private.h b/cogl/cogl-texture-2d-private.h
index 69910db6..7d79b4b0 100644
--- a/cogl/cogl-texture-2d-private.h
+++ b/cogl/cogl-texture-2d-private.h
@@ -43,8 +43,8 @@ struct _CoglTexture2D
GLenum gl_format;
/* The texture object number */
GLuint gl_texture;
- gint width;
- gint height;
+ int width;
+ int height;
GLenum min_filter;
GLenum mag_filter;
GLint wrap_mode;
diff --git a/cogl/cogl-texture-2d-sliced-private.h b/cogl/cogl-texture-2d-sliced-private.h
index dfde144a..8e1d3f7a 100644
--- a/cogl/cogl-texture-2d-sliced-private.h
+++ b/cogl/cogl-texture-2d-sliced-private.h
@@ -52,7 +52,7 @@ struct _CoglTexture2DSliced
GArray *slice_x_spans;
GArray *slice_y_spans;
GArray *slice_gl_handles;
- gint max_waste;
+ int max_waste;
/* The internal format of the GL texture represented as a
CoglPixelFormat */
@@ -60,8 +60,8 @@ struct _CoglTexture2DSliced
/* The internal format of the GL texture represented as a GL enum */
GLenum gl_format;
GLenum gl_target;
- gint width;
- gint height;
+ int width;
+ int height;
GLenum min_filter;
GLenum mag_filter;
gboolean is_foreign;
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index b7a7bd7a..1ba3f4cb 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -181,13 +181,13 @@ _cogl_texture_2d_sliced_foreach_sub_texture_in_region (
}
}
-static guchar *
+static guint8 *
_cogl_texture_2d_sliced_allocate_waste_buffer (CoglTexture2DSliced *tex_2ds,
CoglPixelFormat format)
{
CoglSpan *last_x_span;
CoglSpan *last_y_span;
- guchar *waste_buf = NULL;
+ guint8 *waste_buf = NULL;
/* If the texture has any waste then allocate a buffer big enough to
fill the gaps */
@@ -197,13 +197,13 @@ _cogl_texture_2d_sliced_allocate_waste_buffer (CoglTexture2DSliced *tex_2ds,
tex_2ds->slice_y_spans->len - 1);
if (last_x_span->waste > 0 || last_y_span->waste > 0)
{
- gint bpp = _cogl_get_format_bpp (format);
+ int bpp = _cogl_get_format_bpp (format);
CoglSpan *first_x_span
= &g_array_index (tex_2ds->slice_x_spans, CoglSpan, 0);
CoglSpan *first_y_span
= &g_array_index (tex_2ds->slice_y_spans, CoglSpan, 0);
- guint right_size = first_y_span->size * last_x_span->waste;
- guint bottom_size = first_x_span->size * last_y_span->waste;
+ unsigned int right_size = first_y_span->size * last_x_span->waste;
+ unsigned int bottom_size = first_x_span->size * last_y_span->waste;
waste_buf = g_malloc (MAX (right_size, bottom_size) * bpp);
}
@@ -220,10 +220,10 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
{
CoglSpan *x_span;
CoglSpan *y_span;
- GLuint gl_handle;
- gint bpp;
- gint x,y;
- guchar *waste_buf;
+ GLuint gl_handle;
+ int bpp;
+ int x, y;
+ guint8 *waste_buf;
bpp = _cogl_get_format_bpp (bmp->format);
@@ -238,7 +238,7 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
/* Iterate horizontal slices */
for (x = 0; x < tex_2ds->slice_x_spans->len; ++x)
{
- gint slice_num = y * tex_2ds->slice_x_spans->len + x;
+ int slice_num = y * tex_2ds->slice_x_spans->len + x;
x_span = &g_array_index (tex_2ds->slice_x_spans, CoglSpan, x);
@@ -272,11 +272,11 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
/* Fill the waste with a copies of the rightmost pixels */
if (x_span->waste > 0)
{
- const guchar *src = bmp->data
+ const guint8 *src = bmp->data
+ y_span->start * bmp->rowstride
+ (x_span->start + x_span->size - x_span->waste - 1) * bpp;
- guchar *dst = waste_buf;
- guint wx, wy;
+ guint8 *dst = waste_buf;
+ unsigned int wx, wy;
for (wy = 0; wy < y_span->size - y_span->waste; wy++)
{
@@ -303,12 +303,12 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
if (y_span->waste > 0)
{
- const guchar *src = bmp->data
+ const guint8 *src = bmp->data
+ ((y_span->start + y_span->size - y_span->waste - 1)
* bmp->rowstride)
+ x_span->start * bpp;
- guchar *dst = waste_buf;
- guint wy, wx;
+ guint8 *dst = waste_buf;
+ unsigned int wy, wx;
for (wy = 0; wy < y_span->waste; wy++)
{
@@ -347,26 +347,26 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
static gboolean
_cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
- gint src_x,
- gint src_y,
- gint dst_x,
- gint dst_y,
- gint width,
- gint height,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ int width,
+ int height,
CoglBitmap *source_bmp,
GLuint source_gl_format,
GLuint source_gl_type)
{
CoglSpan *x_span;
CoglSpan *y_span;
- gint bpp;
+ int bpp;
CoglSpanIter x_iter;
CoglSpanIter y_iter;
GLuint gl_handle;
- gint source_x = 0, source_y = 0;
- gint inter_w = 0, inter_h = 0;
- gint local_x = 0, local_y = 0;
- guchar *waste_buf;
+ int source_x = 0, source_y = 0;
+ int inter_w = 0, inter_h = 0;
+ int local_x = 0, local_y = 0;
+ guint8 *waste_buf;
bpp = _cogl_get_format_bpp (source_bmp->format);
@@ -409,7 +409,7 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
_cogl_span_iter_next (&x_iter),
source_x += inter_w )
{
- gint slice_num;
+ int slice_num;
/* Discard slices out of the subregion early */
if (!x_iter.intersects)
@@ -464,9 +464,9 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
&& local_x < x_span->size - x_span->waste
&& local_x + inter_w >= x_span->size - x_span->waste)
{
- const guchar *src;
- guchar *dst;
- guint wx, wy;
+ const guint8 *src;
+ guint8 *dst;
+ unsigned int wx, wy;
src = source_bmp->data
+ (src_y + ((int)y_iter.intersect_start)
@@ -507,10 +507,10 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
&& local_y < y_span->size - y_span->waste
&& local_y + inter_h >= y_span->size - y_span->waste)
{
- const guchar *src;
- guchar *dst;
- guint wy, wx;
- guint copy_width;
+ const guint8 *src;
+ guint8 *dst;
+ unsigned int wy, wx;
+ unsigned int copy_width;
src = source_bmp->data
+ (src_x + ((int)x_iter.intersect_start)
@@ -563,13 +563,13 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
return TRUE;
}
-static gint
+static int
_cogl_rect_slices_for_size (int size_to_fill,
int max_span_size,
int max_waste,
GArray *out_spans)
{
- int n_spans = 0;
+ int n_spans = 0;
CoglSpan span;
/* Init first slice span */
@@ -600,13 +600,13 @@ _cogl_rect_slices_for_size (int size_to_fill,
return n_spans;
}
-static gint
-_cogl_pot_slices_for_size (gint size_to_fill,
- gint max_span_size,
- gint max_waste,
+static int
+_cogl_pot_slices_for_size (int size_to_fill,
+ int max_span_size,
+ int max_waste,
GArray *out_spans)
{
- gint n_spans = 0;
+ int n_spans = 0;
CoglSpan span;
/* Init first slice span */
@@ -686,23 +686,23 @@ _cogl_texture_2d_sliced_set_wrap_mode_parameter (CoglTexture *tex,
static gboolean
_cogl_texture_2d_sliced_slices_create (CoglTexture2DSliced *tex_2ds,
- gint width, gint height,
+ int width, int height,
GLenum gl_intformat,
GLenum gl_format,
GLenum gl_type)
{
- gint max_width;
- gint max_height;
- GLuint *gl_handles;
- gint n_x_slices;
- gint n_y_slices;
- gint n_slices;
- gint x, y;
+ int max_width;
+ int max_height;
+ GLuint *gl_handles;
+ int n_x_slices;
+ int n_y_slices;
+ int n_slices;
+ int x, y;
CoglSpan *x_span;
CoglSpan *y_span;
- const GLfloat transparent_color[4] = { 0x00, 0x00, 0x00, 0x00 };
+ const GLfloat transparent_color[4] = { 0x00, 0x00, 0x00, 0x00 };
- gint (*slices_for_size) (gint, gint, gint, GArray*);
+ int (*slices_for_size) (int, int, int, GArray*);
/* Initialize size of largest slice according to supported features */
if (cogl_features_available (COGL_FEATURE_TEXTURE_NPOT))
@@ -1096,8 +1096,8 @@ _cogl_texture_2d_sliced_new_from_foreign (GLuint gl_handle,
GLint gl_gen_mipmap;
CoglTexture2DSliced *tex_2ds;
CoglTexture *tex;
- CoglSpan x_span;
- CoglSpan y_span;
+ CoglSpan x_span;
+ CoglSpan y_span;
if (!_cogl_texture_driver_allows_foreign_gl_target (gl_target))
return COGL_INVALID_HANDLE;
@@ -1228,7 +1228,7 @@ _cogl_texture_2d_sliced_new_from_foreign (GLuint gl_handle,
return _cogl_texture_2d_sliced_handle_new (tex_2ds);
}
-static gint
+static int
_cogl_texture_2d_sliced_get_max_waste (CoglTexture *tex)
{
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
@@ -1427,7 +1427,7 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
const guint8 *data)
{
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
- gint bpp;
+ int bpp;
CoglBitmap source_bmp;
CoglBitmap tmp_bmp;
gboolean tmp_bmp_owner = FALSE;
@@ -1446,7 +1446,7 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
source_bmp.width = width;
source_bmp.height = height;
source_bmp.format = format;
- source_bmp.data = (guchar*)data;
+ source_bmp.data = (guint8 *)data;
/* Rowstride from width if none specified */
bpp = _cogl_get_format_bpp (format);
@@ -1489,10 +1489,10 @@ _cogl_texture_2d_sliced_download_from_gl (
{
CoglSpan *x_span;
CoglSpan *y_span;
- GLuint gl_handle;
- gint bpp;
- gint x,y;
- CoglBitmap slice_bmp;
+ GLuint gl_handle;
+ int bpp;
+ int x, y;
+ CoglBitmap slice_bmp;
bpp = _cogl_get_format_bpp (target_bmp->format);
@@ -1521,8 +1521,8 @@ _cogl_texture_2d_sliced_download_from_gl (
slice_bmp.width = x_span->size;
slice_bmp.height = y_span->size;
slice_bmp.rowstride = bpp * slice_bmp.width;
- slice_bmp.data = (guchar*) g_malloc (slice_bmp.rowstride *
- slice_bmp.height);
+ slice_bmp.data = g_malloc (slice_bmp.rowstride *
+ slice_bmp.height);
/* Setup gl alignment to 0,0 top-left corner */
_cogl_texture_driver_prep_gl_for_pixels_download (
@@ -1587,18 +1587,18 @@ _cogl_texture_2d_sliced_get_data (CoglTexture *tex,
guint8 *data)
{
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
- gint bpp;
- gint byte_size;
- CoglPixelFormat closest_format;
- gint closest_bpp;
- GLenum closest_gl_format;
- GLenum closest_gl_type;
- CoglBitmap target_bmp;
- CoglBitmap new_bmp;
- gboolean success;
- guchar *src;
- guchar *dst;
- gint y;
+ int bpp;
+ int byte_size;
+ CoglPixelFormat closest_format;
+ int closest_bpp;
+ GLenum closest_gl_format;
+ GLenum closest_gl_type;
+ CoglBitmap target_bmp;
+ CoglBitmap new_bmp;
+ gboolean success;
+ guint8 *src;
+ guint8 *dst;
+ int y;
/* Default to internal format if none specified */
if (format == COGL_PIXEL_FORMAT_ANY)
@@ -1606,11 +1606,13 @@ _cogl_texture_2d_sliced_get_data (CoglTexture *tex,
/* Rowstride from texture width if none specified */
bpp = _cogl_get_format_bpp (format);
- if (rowstride == 0) rowstride = tex_2ds->width * bpp;
+ if (rowstride == 0)
+ rowstride = tex_2ds->width * bpp;
/* Return byte size if only that requested */
byte_size = tex_2ds->height * rowstride;
- if (data == NULL) return byte_size;
+ if (data == NULL)
+ return byte_size;
closest_format =
_cogl_texture_driver_find_best_gl_get_data_format (format,
@@ -1634,8 +1636,7 @@ _cogl_texture_2d_sliced_get_data (CoglTexture *tex,
/* Target intermediate buffer */
target_bmp.format = closest_format;
target_bmp.rowstride = target_bmp.width * closest_bpp;
- target_bmp.data = (guchar*) g_malloc (target_bmp.height
- * target_bmp.rowstride);
+ target_bmp.data = g_malloc (target_bmp.height * target_bmp.rowstride);
}
/* Retrieve data from slices */
@@ -1691,13 +1692,13 @@ _cogl_texture_2d_sliced_get_gl_format (CoglTexture *tex)
return COGL_TEXTURE_2D_SLICED (tex)->gl_format;
}
-static gint
+static int
_cogl_texture_2d_sliced_get_width (CoglTexture *tex)
{
return COGL_TEXTURE_2D_SLICED (tex)->width;
}
-static gint
+static int
_cogl_texture_2d_sliced_get_height (CoglTexture *tex)
{
return COGL_TEXTURE_2D_SLICED (tex)->height;
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index 40f7b3f7..4c5ffdaf 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -316,7 +316,7 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle,
return _cogl_texture_2d_handle_new (tex_2d);
}
-static gint
+static int
_cogl_texture_2d_get_max_waste (CoglTexture *tex)
{
return -1;
@@ -430,7 +430,7 @@ _cogl_texture_2d_set_region (CoglTexture *tex,
const guint8 *data)
{
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
- gint bpp;
+ int bpp;
CoglBitmap source_bmp;
CoglBitmap tmp_bmp;
gboolean tmp_bmp_owner = FALSE;
@@ -449,7 +449,7 @@ _cogl_texture_2d_set_region (CoglTexture *tex,
source_bmp.width = width;
source_bmp.height = height;
source_bmp.format = format;
- source_bmp.data = (guchar*) data;
+ source_bmp.data = (guint8 *)data;
/* Rowstride from width if none specified */
bpp = _cogl_get_format_bpp (format);
@@ -490,18 +490,18 @@ _cogl_texture_2d_get_data (CoglTexture *tex,
guint8 *data)
{
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
- gint bpp;
- gint byte_size;
+ int bpp;
+ int byte_size;
CoglPixelFormat closest_format;
- gint closest_bpp;
+ int closest_bpp;
GLenum closest_gl_format;
GLenum closest_gl_type;
CoglBitmap target_bmp;
CoglBitmap new_bmp;
gboolean success;
- guchar *src;
- guchar *dst;
- gint y;
+ guint8 *src;
+ guint8 *dst;
+ int y;
/* Default to internal format if none specified */
if (format == COGL_PIXEL_FORMAT_ANY)
@@ -509,11 +509,13 @@ _cogl_texture_2d_get_data (CoglTexture *tex,
/* Rowstride from texture width if none specified */
bpp = _cogl_get_format_bpp (format);
- if (rowstride == 0) rowstride = tex_2d->width * bpp;
+ if (rowstride == 0)
+ rowstride = tex_2d->width * bpp;
/* Return byte size if only that requested */
byte_size = tex_2d->height * rowstride;
- if (data == NULL) return byte_size;
+ if (data == NULL)
+ return byte_size;
closest_format =
_cogl_texture_driver_find_best_gl_get_data_format (format,
@@ -537,8 +539,7 @@ _cogl_texture_2d_get_data (CoglTexture *tex,
/* Target intermediate buffer */
target_bmp.format = closest_format;
target_bmp.rowstride = target_bmp.width * closest_bpp;
- target_bmp.data = (guchar*) g_malloc (target_bmp.height
- * target_bmp.rowstride);
+ target_bmp.data = g_malloc (target_bmp.height * target_bmp.rowstride);
}
GE( glBindTexture (GL_TEXTURE_2D, tex_2d->gl_texture) );
@@ -566,7 +567,8 @@ _cogl_texture_2d_get_data (CoglTexture *tex,
/* Free intermediate data and return if failed */
g_free (target_bmp.data);
- if (!success) return 0;
+ if (!success)
+ return 0;
/* Copy to user buffer */
for (y = 0; y < new_bmp.height; ++y)
@@ -595,13 +597,13 @@ _cogl_texture_2d_get_gl_format (CoglTexture *tex)
return COGL_TEXTURE_2D (tex)->gl_format;
}
-static gint
+static int
_cogl_texture_2d_get_width (CoglTexture *tex)
{
return COGL_TEXTURE_2D (tex)->width;
}
-static gint
+static int
_cogl_texture_2d_get_height (CoglTexture *tex)
{
return COGL_TEXTURE_2D (tex)->height;
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h
index 92061852..a34572ac 100644
--- a/cogl/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
@@ -74,7 +74,7 @@ struct _CoglTextureVtable
CoglTextureSliceCallback callback,
void *user_data);
- gint (* get_max_waste) (CoglTexture *tex);
+ int (* get_max_waste) (CoglTexture *tex);
gboolean (* is_sliced) (CoglTexture *tex);
@@ -102,8 +102,8 @@ struct _CoglTextureVtable
CoglPixelFormat (* get_format) (CoglTexture *tex);
GLenum (* get_gl_format) (CoglTexture *tex);
- gint (* get_width) (CoglTexture *tex);
- gint (* get_height) (CoglTexture *tex);
+ int (* get_width) (CoglTexture *tex);
+ int (* get_height) (CoglTexture *tex);
};
struct _CoglTexture
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 77005eb9..e94aaf0e 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -224,15 +224,15 @@ _cogl_texture_set_wrap_mode_parameter (CoglHandle handle,
effectively assumes there is only one span from 0.0 to 1.0 */
typedef struct _CoglTextureIter
{
- gfloat pos, end, next_pos;
+ float pos, end, next_pos;
gboolean flipped;
- gfloat t_1, t_2;
+ float t_1, t_2;
} CoglTextureIter;
static void
_cogl_texture_iter_update (CoglTextureIter *iter)
{
- gfloat t_2;
+ float t_2;
float frac_part;
frac_part = modff (iter->pos, &iter->next_pos);
@@ -261,7 +261,7 @@ _cogl_texture_iter_update (CoglTextureIter *iter)
static void
_cogl_texture_iter_begin (CoglTextureIter *iter,
- gfloat t_1, gfloat t_2)
+ float t_1, float t_2)
{
if (t_1 <= t_2)
{
@@ -316,8 +316,8 @@ _cogl_texture_iterate_manual_repeats (CoglTextureManualRepeatCallback callback,
}
CoglHandle
-cogl_texture_new_with_size (guint width,
- guint height,
+cogl_texture_new_with_size (unsigned int width,
+ unsigned int height,
CoglTextureFlags flags,
CoglPixelFormat internal_format)
{
@@ -337,13 +337,13 @@ cogl_texture_new_with_size (guint width,
}
CoglHandle
-cogl_texture_new_from_data (guint width,
- guint height,
+cogl_texture_new_from_data (unsigned int width,
+ unsigned int height,
CoglTextureFlags flags,
CoglPixelFormat format,
CoglPixelFormat internal_format,
- guint rowstride,
- const guchar *data)
+ unsigned int rowstride,
+ const guint8 *data)
{
CoglBitmap bitmap;
@@ -360,7 +360,7 @@ cogl_texture_new_from_data (guint width,
/* Wrap the data into a bitmap */
bitmap.width = width;
bitmap.height = height;
- bitmap.data = (guchar *) data;
+ bitmap.data = (guint8 *) data;
bitmap.format = format;
bitmap.rowstride = rowstride;
@@ -393,7 +393,7 @@ cogl_texture_new_from_bitmap (CoglHandle bmp_handle,
}
CoglHandle
-cogl_texture_new_from_file (const gchar *filename,
+cogl_texture_new_from_file (const char *filename,
CoglTextureFlags flags,
CoglPixelFormat internal_format,
GError **error)
@@ -445,24 +445,24 @@ cogl_texture_new_from_foreign (GLuint gl_handle,
CoglHandle
cogl_texture_new_from_sub_texture (CoglHandle full_texture,
- gint sub_x,
- gint sub_y,
- gint sub_width,
- gint sub_height)
+ int sub_x,
+ int sub_y,
+ int sub_width,
+ int sub_height)
{
return _cogl_sub_texture_new (full_texture, sub_x, sub_y,
sub_width, sub_height);
}
CoglHandle
-cogl_texture_new_from_buffer_EXP (CoglHandle buffer,
- guint width,
- guint height,
- CoglTextureFlags flags,
- CoglPixelFormat format,
- CoglPixelFormat internal_format,
- guint rowstride,
- const guint offset)
+cogl_texture_new_from_buffer_EXP (CoglHandle buffer,
+ unsigned int width,
+ unsigned int height,
+ CoglTextureFlags flags,
+ CoglPixelFormat format,
+ CoglPixelFormat internal_format,
+ unsigned int rowstride,
+ const unsigned int offset)
{
CoglHandle texture;
CoglBuffer *cogl_buffer;
@@ -526,7 +526,7 @@ cogl_texture_new_from_buffer_EXP (CoglHandle buffer,
return texture;
}
-guint
+unsigned int
cogl_texture_get_width (CoglHandle handle)
{
CoglTexture *tex;
@@ -539,7 +539,7 @@ cogl_texture_get_width (CoglHandle handle)
return tex->vtable->get_width (tex);
}
-guint
+unsigned int
cogl_texture_get_height (CoglHandle handle)
{
CoglTexture *tex;
@@ -565,7 +565,7 @@ cogl_texture_get_format (CoglHandle handle)
return tex->vtable->get_format (tex);
}
-guint
+unsigned int
cogl_texture_get_rowstride (CoglHandle handle)
{
CoglTexture *tex;
@@ -584,7 +584,7 @@ cogl_texture_get_rowstride (CoglHandle handle)
* cogl_texture_get_width (tex));
}
-gint
+int
cogl_texture_get_max_waste (CoglHandle handle)
{
CoglTexture *tex;
@@ -739,17 +739,17 @@ _cogl_texture_ensure_non_quad_rendering (CoglHandle handle)
gboolean
cogl_texture_set_region (CoglHandle handle,
- gint src_x,
- gint src_y,
- gint dst_x,
- gint dst_y,
- guint dst_width,
- guint dst_height,
- gint width,
- gint height,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ unsigned int dst_width,
+ unsigned int dst_height,
+ int width,
+ int height,
CoglPixelFormat format,
- guint rowstride,
- const guchar *data)
+ unsigned int rowstride,
+ const guint8 *data)
{
CoglTexture *tex;
@@ -786,14 +786,14 @@ do_texture_draw_and_read (CoglHandle handle,
CoglBitmap *target_bmp,
GLint *viewport)
{
- gint bpp;
+ int bpp;
float rx1, ry1;
float rx2, ry2;
float tx1, ty1;
float tx2, ty2;
int bw, bh;
CoglBitmap rect_bmp;
- guint tex_width, tex_height;
+ unsigned int tex_width, tex_height;
bpp = _cogl_get_format_bpp (COGL_PIXEL_FORMAT_RGBA_8888);
@@ -840,8 +840,8 @@ do_texture_draw_and_read (CoglHandle handle,
rect_bmp.width = rx2 - rx1;
rect_bmp.height = ry2 - ry1;
rect_bmp.rowstride = bpp * rect_bmp.width;
- rect_bmp.data = (guchar*) g_malloc (rect_bmp.rowstride *
- rect_bmp.height);
+ rect_bmp.data = g_malloc (rect_bmp.rowstride *
+ rect_bmp.height);
_cogl_texture_driver_prep_gl_for_pixels_download (rect_bmp.rowstride,
bpp);
@@ -877,7 +877,7 @@ _cogl_texture_draw_and_read (CoglHandle handle,
GLuint target_gl_format,
GLuint target_gl_type)
{
- gint bpp;
+ int bpp;
CoglHandle framebuffer;
int viewport[4];
CoglBitmap alpha_bmp;
@@ -951,19 +951,19 @@ _cogl_texture_draw_and_read (CoglHandle handle,
printf ("A bits: %d\n", a_bits); */
if ((cogl_texture_get_format (handle) & COGL_A_BIT)/* && a_bits == 0*/)
{
- guchar *srcdata;
- guchar *dstdata;
- guchar *srcpixel;
- guchar *dstpixel;
- gint x,y;
+ guint8 *srcdata;
+ guint8 *dstdata;
+ guint8 *srcpixel;
+ guint8 *dstpixel;
+ int x,y;
/* Create temp bitmap for alpha values */
alpha_bmp.format = COGL_PIXEL_FORMAT_RGBA_8888;
alpha_bmp.width = target_bmp->width;
alpha_bmp.height = target_bmp->height;
alpha_bmp.rowstride = bpp * alpha_bmp.width;
- alpha_bmp.data = (guchar*) g_malloc (alpha_bmp.rowstride *
- alpha_bmp.height);
+ alpha_bmp.data = g_malloc (alpha_bmp.rowstride *
+ alpha_bmp.height);
/* Draw alpha values into RGB channels */
cogl_material_set_layer_combine (ctx->texture_download_material,
@@ -1003,11 +1003,11 @@ _cogl_texture_draw_and_read (CoglHandle handle,
return TRUE;
}
-gint
+int
cogl_texture_get_data (CoglHandle handle,
CoglPixelFormat format,
- guint rowstride,
- guchar *data)
+ unsigned int rowstride,
+ guint8 *data)
{
CoglTexture *tex;
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 15aad682..b62f3b5d 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2007,2008,2009 Intel Corporation.
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -59,10 +59,11 @@ G_BEGIN_DECLS
*
* Since: 0.8
*/
-CoglHandle cogl_texture_new_with_size (guint width,
- guint height,
- CoglTextureFlags flags,
- CoglPixelFormat internal_format);
+CoglHandle
+cogl_texture_new_with_size (unsigned int width,
+ unsigned int height,
+ CoglTextureFlags flags,
+ CoglPixelFormat internal_format);
/**
* cogl_texture_new_from_file:
@@ -85,10 +86,11 @@ CoglHandle cogl_texture_new_with_size (guint width,
*
* Since: 0.8
*/
-CoglHandle cogl_texture_new_from_file (const gchar *filename,
- CoglTextureFlags flags,
- CoglPixelFormat internal_format,
- GError **error);
+CoglHandle
+cogl_texture_new_from_file (const char *filename,
+ CoglTextureFlags flags,
+ CoglPixelFormat internal_format,
+ GError **error);
/**
* cogl_texture_new_from_data:
@@ -115,13 +117,14 @@ CoglHandle cogl_texture_new_from_file (const gchar *filename,
*
* Since: 0.8
*/
-CoglHandle cogl_texture_new_from_data (guint width,
- guint height,
- CoglTextureFlags flags,
- CoglPixelFormat format,
- CoglPixelFormat internal_format,
- guint rowstride,
- const guchar *data);
+CoglHandle
+cogl_texture_new_from_data (unsigned int width,
+ unsigned int height,
+ CoglTextureFlags flags,
+ CoglPixelFormat format,
+ CoglPixelFormat internal_format,
+ unsigned int rowstride,
+ const guint8 *data);
/**
* cogl_texture_new_from_foreign:
@@ -142,13 +145,14 @@ CoglHandle cogl_texture_new_from_data (guint width,
*
* Since: 0.8
*/
-CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle,
- GLenum gl_target,
- GLuint width,
- GLuint height,
- GLuint x_pot_waste,
- GLuint y_pot_waste,
- CoglPixelFormat format);
+CoglHandle
+cogl_texture_new_from_foreign (GLuint gl_handle,
+ GLenum gl_target,
+ GLuint width,
+ GLuint height,
+ GLuint x_pot_waste,
+ GLuint y_pot_waste,
+ CoglPixelFormat format);
/**
* cogl_texture_new_from_bitmap:
@@ -164,9 +168,10 @@ CoglHandle cogl_texture_new_from_foreign (GLuint gl_handle,
*
* Since: 1.0
*/
-CoglHandle cogl_texture_new_from_bitmap (CoglHandle bmp_handle,
- CoglTextureFlags flags,
- CoglPixelFormat internal_format);
+CoglHandle
+cogl_texture_new_from_bitmap (CoglHandle bmp_handle,
+ CoglTextureFlags flags,
+ CoglPixelFormat internal_format);
/**
* cogl_is_texture:
@@ -177,7 +182,8 @@ CoglHandle cogl_texture_new_from_bitmap (CoglHandle bmp_handle,
* Return value: %TRUE if the handle references a texture, and
* %FALSE otherwise
*/
-gboolean cogl_is_texture (CoglHandle handle);
+gboolean
+cogl_is_texture (CoglHandle handle);
/**
* cogl_texture_get_width:
@@ -187,7 +193,8 @@ gboolean cogl_is_texture (CoglHandle handle);
*
* Return value: the width of the GPU side texture in pixels
*/
-guint cogl_texture_get_width (CoglHandle handle);
+unsigned int
+cogl_texture_get_width (CoglHandle handle);
/**
* cogl_texture_get_height:
@@ -197,7 +204,8 @@ guint cogl_texture_get_width (CoglHandle handle);
*
* Return value: the height of the GPU side texture in pixels
*/
-guint cogl_texture_get_height (CoglHandle handle);
+unsigned int
+cogl_texture_get_height (CoglHandle handle);
/**
* cogl_texture_get_format:
@@ -207,7 +215,8 @@ guint cogl_texture_get_height (CoglHandle handle);
*
* Return value: the #CoglPixelFormat of the GPU side texture
*/
-CoglPixelFormat cogl_texture_get_format (CoglHandle handle);
+CoglPixelFormat
+cogl_texture_get_format (CoglHandle handle);
/**
@@ -218,7 +227,8 @@ CoglPixelFormat cogl_texture_get_format (CoglHandle handle);
*
* Return value: the offset in bytes between each consequetive row of pixels
*/
-guint cogl_texture_get_rowstride (CoglHandle handle);
+unsigned int
+cogl_texture_get_rowstride (CoglHandle handle);
/**
* cogl_texture_get_max_waste:
@@ -229,7 +239,8 @@ guint cogl_texture_get_rowstride (CoglHandle handle);
*
* Return value: the maximum waste
*/
-gint cogl_texture_get_max_waste (CoglHandle handle);
+int
+cogl_texture_get_max_waste (CoglHandle handle);
/**
* cogl_texture_is_sliced:
@@ -241,7 +252,8 @@ gint cogl_texture_get_max_waste (CoglHandle handle);
* Return value: %TRUE if the texture is sliced, %FALSE if the texture
* is stored as a single GPU texture
*/
-gboolean cogl_texture_is_sliced (CoglHandle handle);
+gboolean
+cogl_texture_is_sliced (CoglHandle handle);
/**
* cogl_texture_get_gl_texture:
@@ -259,9 +271,10 @@ gboolean cogl_texture_is_sliced (CoglHandle handle);
* Return value: %TRUE if the handle was successfully retrieved, %FALSE
* if the handle was invalid
*/
-gboolean cogl_texture_get_gl_texture (CoglHandle handle,
- GLuint *out_gl_handle,
- GLenum *out_gl_target);
+gboolean
+cogl_texture_get_gl_texture (CoglHandle handle,
+ GLuint *out_gl_handle,
+ GLenum *out_gl_target);
/**
* cogl_texture_get_data:
@@ -277,10 +290,11 @@ gboolean cogl_texture_get_gl_texture (CoglHandle handle,
* Return value: the size of the texture data in bytes, or 0 if the texture
* is not valid
*/
-gint cogl_texture_get_data (CoglHandle handle,
- CoglPixelFormat format,
- guint rowstride,
- guchar *data);
+int
+cogl_texture_get_data (CoglHandle handle,
+ CoglPixelFormat format,
+ unsigned int rowstride,
+ guint8 *data);
/**
* cogl_texture_set_region:
@@ -304,18 +318,19 @@ gint cogl_texture_get_data (CoglHandle handle,
* Return value: %TRUE if the subregion upload was successful, and
* %FALSE otherwise
*/
-gboolean cogl_texture_set_region (CoglHandle handle,
- gint src_x,
- gint src_y,
- gint dst_x,
- gint dst_y,
- guint dst_width,
- guint dst_height,
- gint width,
- gint height,
- CoglPixelFormat format,
- guint rowstride,
- const guchar *data);
+gboolean
+cogl_texture_set_region (CoglHandle handle,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ unsigned int dst_width,
+ unsigned int dst_height,
+ int width,
+ int height,
+ CoglPixelFormat format,
+ unsigned int rowstride,
+ const guint8 *data);
/**
* cogl_texture_new_from_sub_texture:
@@ -337,12 +352,12 @@ gboolean cogl_texture_set_region (CoglHandle handle,
*
* Since: 1.2
*/
-CoglHandle cogl_texture_new_from_sub_texture
- (CoglHandle full_texture,
- gint sub_x,
- gint sub_y,
- gint sub_width,
- gint sub_height);
+CoglHandle
+cogl_texture_new_from_sub_texture (CoglHandle full_texture,
+ int sub_x,
+ int sub_y,
+ int sub_width,
+ int sub_height);
#if defined (COGL_ENABLE_EXPERIMENTAL_API)
@@ -376,29 +391,30 @@ CoglHandle cogl_texture_new_from_sub_texture
* Since: 1.2
* Stability: Unstable
*/
-CoglHandle cogl_texture_new_from_buffer (CoglHandle buffer,
- guint width,
- guint height,
- CoglTextureFlags flags,
- CoglPixelFormat format,
- CoglPixelFormat internal_format,
- guint rowstride,
- guint offset);
+CoglHandle
+cogl_texture_new_from_buffer (CoglHandle buffer,
+ unsigned int width,
+ unsigned int height,
+ CoglTextureFlags flags,
+ CoglPixelFormat format,
+ CoglPixelFormat internal_format,
+ unsigned int rowstride,
+ unsigned int offset);
/* the function above is experimental, the actual symbol is suffixed by _EXP so
* we can ensure ABI compatibility and leave the cogl_buffer namespace free for
* future use. A bunch of defines translates the symbols documented above into
* the real symbols */
-CoglHandle cogl_texture_new_from_buffer_EXP
- (CoglHandle buffer,
- guint width,
- guint height,
- CoglTextureFlags flags,
- CoglPixelFormat format,
- CoglPixelFormat internal_format,
- guint rowstride,
- guint offset);
+CoglHandle
+cogl_texture_new_from_buffer_EXP (CoglHandle buffer,
+ unsigned int width,
+ unsigned int height,
+ CoglTextureFlags flags,
+ CoglPixelFormat format,
+ CoglPixelFormat internal_format,
+ unsigned int rowstride,
+ unsigned int offset);
#define cogl_texture_new_from_buffer cogl_texture_new_from_buffer_EXP
@@ -416,7 +432,8 @@ CoglHandle cogl_texture_new_from_buffer_EXP
*
* Return value: the @handle.
*/
-CoglHandle cogl_texture_ref (CoglHandle handle);
+CoglHandle
+cogl_texture_ref (CoglHandle handle);
/**
* cogl_texture_unref:
@@ -426,7 +443,8 @@ CoglHandle cogl_texture_ref (CoglHandle handle);
*
* Deprecated: 1.2: Use cogl_handle_unref() instead
*/
-void cogl_texture_unref (CoglHandle handle);
+void
+cogl_texture_unref (CoglHandle handle);
#endif /* COGL_DISABLE_DEPRECATED */
@@ -447,14 +465,15 @@ void cogl_texture_unref (CoglHandle handle);
*
* Since: 1.0
*/
-void cogl_rectangle_with_texture_coords (float x1,
- float y1,
- float x2,
- float y2,
- float tx1,
- float ty1,
- float tx2,
- float ty2);
+void
+cogl_rectangle_with_texture_coords (float x1,
+ float y1,
+ float x2,
+ float y2,
+ float tx1,
+ float ty1,
+ float tx2,
+ float ty2);
/**
* cogl_rectangle_with_multitexture_coords:
@@ -483,12 +502,13 @@ void cogl_rectangle_with_texture_coords (float x1,
*
* Since: 1.0
*/
-void cogl_rectangle_with_multitexture_coords (float x1,
- float y1,
- float x2,
- float y2,
- const float *tex_coords,
- gint tex_coords_len);
+void
+cogl_rectangle_with_multitexture_coords (float x1,
+ float y1,
+ float x2,
+ float y2,
+ const float *tex_coords,
+ int tex_coords_len);
/**
* cogl_rectangles_with_texture_coords:
@@ -507,8 +527,9 @@ void cogl_rectangle_with_multitexture_coords (float x1,
*
* Since: 0.8.6
*/
-void cogl_rectangles_with_texture_coords (const float *verts,
- guint n_rects);
+void
+cogl_rectangles_with_texture_coords (const float *verts,
+ unsigned int n_rects);
/**
* cogl_rectangles:
@@ -527,9 +548,9 @@ void cogl_rectangles_with_texture_coords (const float *verts,
*
* Since: 1.0
*/
-void cogl_rectangles (const float *verts,
- guint n_rects);
-
+void
+cogl_rectangles (const float *verts,
+ unsigned int n_rects);
/**
* cogl_polygon:
@@ -555,9 +576,10 @@ void cogl_rectangles (const float *verts,
*
* Since: 1.0
*/
-void cogl_polygon (const CoglTextureVertex *vertices,
- guint n_vertices,
- gboolean use_color);
+void
+cogl_polygon (const CoglTextureVertex *vertices,
+ unsigned int n_vertices,
+ gboolean use_color);
G_END_DECLS
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index 2bc68650..88d6cd8a 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -49,7 +49,8 @@ typedef gpointer CoglHandle;
#define COGL_INVALID_HANDLE NULL
#define COGL_TYPE_HANDLE (cogl_handle_get_type ())
-GType cogl_handle_get_type (void) G_GNUC_CONST;
+GType
+cogl_handle_get_type (void) G_GNUC_CONST;
/**
* cogl_handle_ref:
@@ -59,7 +60,8 @@ GType cogl_handle_get_type (void) G_GNUC_CONST;
*
* Returns: the handle, with its reference count increased
*/
-CoglHandle cogl_handle_ref (CoglHandle handle);
+CoglHandle
+cogl_handle_ref (CoglHandle handle);
/**
* cogl_handle_unref:
@@ -68,7 +70,8 @@ CoglHandle cogl_handle_ref (CoglHandle handle);
* Drecreases the reference count of @handle by 1; if the reference
* count reaches 0, the resources allocated by @handle will be freed
*/
-void cogl_handle_unref (CoglHandle Handle);
+void
+cogl_handle_unref (CoglHandle Handle);
/**
* CoglFuncPtr:
@@ -87,7 +90,8 @@ typedef void (* CoglFuncPtr) (void);
typedef gint32 CoglFixed;
#define COGL_TYPE_FIXED (cogl_fixed_get_type ())
-GType cogl_fixed_get_type (void) G_GNUC_CONST;
+GType
+cogl_fixed_get_type (void) G_GNUC_CONST;
/**
* CoglAngle:
@@ -361,7 +365,8 @@ typedef enum { /*< prefix=COGL_BLEND_STRING_ERROR >*/
COGL_BLEND_STRING_ERROR_GPU_UNSUPPORTED_ERROR
} CoglBlendStringError;
-GQuark cogl_blend_string_error_quark (void);
+GQuark
+cogl_blend_string_error_quark (void);
G_END_DECLS
diff --git a/cogl/cogl-util.c b/cogl/cogl-util.c
index 96fa4c9d..add7f8b9 100644
--- a/cogl/cogl-util.c
+++ b/cogl/cogl-util.c
@@ -3,7 +3,7 @@
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
- * Copyright (C) 2007,2008,2009 Intel Corporation.
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -129,27 +129,27 @@ cogl_value_init_fixed (GValue *value)
static void
cogl_value_copy_fixed (const GValue *src,
- GValue *dest)
+ GValue *dest)
{
dest->data[0].v_int = src->data[0].v_int;
}
-static gchar *
-cogl_value_collect_fixed (GValue *value,
- guint n_collect_values,
- GTypeCValue *collect_values,
- guint collect_flags)
+static char *
+cogl_value_collect_fixed (GValue *value,
+ unsigned int n_collect_values,
+ GTypeCValue *collect_values,
+ unsigned int collect_flags)
{
value->data[0].v_int = collect_values[0].v_int;
return NULL;
}
-static gchar *
+static char *
cogl_value_lcopy_fixed (const GValue *value,
- guint n_collect_values,
- GTypeCValue *collect_values,
- guint collect_flags)
+ unsigned int n_collect_values,
+ GTypeCValue *collect_values,
+ unsigned int collect_flags)
{
gint32 *fixed_p = collect_values[0].v_pointer;
@@ -178,28 +178,28 @@ cogl_value_transform_fixed_double (const GValue *src,
static void
cogl_value_transform_fixed_float (const GValue *src,
- GValue *dest)
+ GValue *dest)
{
dest->data[0].v_float = COGL_FIXED_TO_FLOAT (src->data[0].v_int);
}
static void
cogl_value_transform_int_fixed (const GValue *src,
- GValue *dest)
+ GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_INT (src->data[0].v_int);
}
static void
cogl_value_transform_double_fixed (const GValue *src,
- GValue *dest)
+ GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_DOUBLE (src->data[0].v_double);
}
static void
cogl_value_transform_float_fixed (const GValue *src,
- GValue *dest)
+ GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_FLOAT (src->data[0].v_float);
}
diff --git a/cogl/cogl-vertex-buffer-private.h b/cogl/cogl-vertex-buffer-private.h
index 55876530..6b56d82e 100644
--- a/cogl/cogl-vertex-buffer-private.h
+++ b/cogl/cogl-vertex-buffer-private.h
@@ -133,7 +133,7 @@ typedef struct _CoglVertexBufferVBO
* a GLuint VBO name, but when the driver doesn't support VBOs then
* this simply points to an malloc'd buffer. */
void *vbo_name; /*!< The name of the corresponding buffer object */
- size_t vbo_bytes; /*!< The lengh of the allocated buffer object in bytes */
+ gsize vbo_bytes; /*!< The lengh of the allocated buffer object in bytes */
GList *attributes;
} CoglVertexBufferVBO;
diff --git a/cogl/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c
index 80699104..f289dfac 100644
--- a/cogl/cogl-vertex-buffer.c
+++ b/cogl/cogl-vertex-buffer.c
@@ -210,7 +210,7 @@ COGL_HANDLE_DEFINE (VertexBuffer, vertex_buffer);
COGL_HANDLE_DEFINE (VertexBufferIndices, vertex_buffer_indices);
CoglHandle
-cogl_vertex_buffer_new (guint n_vertices)
+cogl_vertex_buffer_new (unsigned int n_vertices)
{
CoglVertexBuffer *buffer = g_slice_alloc (sizeof (CoglVertexBuffer));
@@ -223,7 +223,7 @@ cogl_vertex_buffer_new (guint n_vertices)
return _cogl_vertex_buffer_handle_new (buffer);
}
-guint
+unsigned int
cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
{
CoglVertexBuffer *buffer;
@@ -958,7 +958,7 @@ upload_multipack_vbo_via_map_buffer (CoglVertexBufferVBO *cogl_vbo)
{
#if HAVE_COGL_GL
GList *tmp;
- guint offset = 0;
+ unsigned int offset = 0;
char *buf;
gboolean fallback =
(cogl_get_features () & COGL_FEATURE_VBOS) ? FALSE : TRUE;
@@ -1004,7 +1004,7 @@ static void
upload_multipack_vbo_via_buffer_sub_data (CoglVertexBufferVBO *cogl_vbo)
{
GList *tmp;
- guint offset = 0;
+ unsigned int offset = 0;
gboolean fallback =
(cogl_get_features () & COGL_FEATURE_VBOS) ? FALSE : TRUE;
@@ -1511,8 +1511,8 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
#ifdef MAY_HAVE_PROGRAMABLE_GL
GLuint generic_index = 0;
#endif
- gulong enable_flags = 0;
- gint max_texcoord_attrib_unit = -1;
+ unsigned long enable_flags = 0;
+ int max_texcoord_attrib_unit = -1;
const GList *layers;
guint32 fallback_layers = 0;
guint32 disable_layers = ~0;
@@ -1797,7 +1797,7 @@ cogl_vertex_buffer_indices_new (CoglIndicesType indices_type,
{
gboolean fallback =
(cogl_get_features () & COGL_FEATURE_VBOS) ? FALSE : TRUE;
- size_t indices_bytes;
+ gsize indices_bytes;
CoglVertexBufferIndices *indices;
_COGL_GET_CONTEXT (ctx, 0);
@@ -1885,7 +1885,7 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
CoglVertexBuffer *buffer;
gboolean fallback =
(cogl_get_features () & COGL_FEATURE_VBOS) ? FALSE : TRUE;
- size_t byte_offset;
+ gsize byte_offset;
CoglVertexBufferIndices *indices = NULL;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -1936,7 +1936,7 @@ _cogl_vertex_buffer_free (CoglVertexBuffer *buffer)
}
CoglHandle
-cogl_vertex_buffer_indices_get_for_quads (guint n_indices)
+cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
{
_COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
diff --git a/cogl/cogl-vertex-buffer.h b/cogl/cogl-vertex-buffer.h
index 1a4823e5..787f333e 100644
--- a/cogl/cogl-vertex-buffer.h
+++ b/cogl/cogl-vertex-buffer.h
@@ -83,7 +83,7 @@ G_BEGIN_DECLS
* Return value: a new #CoglHandle
*/
CoglHandle
-cogl_vertex_buffer_new (guint n_vertices);
+cogl_vertex_buffer_new (unsigned int n_vertices);
/**
* cogl_vertex_buffer_get_n_vertices:
@@ -93,7 +93,7 @@ cogl_vertex_buffer_new (guint n_vertices);
*
* Return value: the number of vertices
*/
-guint
+unsigned int
cogl_vertex_buffer_get_n_vertices (CoglHandle handle);
/**
@@ -439,7 +439,7 @@ cogl_vertex_buffer_unref (CoglHandle handle);
* owned by Cogl and should not be modified or unref'd.
*/
CoglHandle
-cogl_vertex_buffer_indices_get_for_quads (guint n_indices);
+cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices);
/**
* cogl_is_vertex_buffer:
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 15812b92..b4f97485 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -54,7 +54,7 @@
/* GL error to string conversion */
static const struct {
GLuint error_code;
- const gchar *error_string;
+ const char *error_string;
} gl_errors[] = {
{ GL_NO_ERROR, "No error" },
{ GL_INVALID_ENUM, "Invalid enumeration value" },
@@ -69,12 +69,12 @@ static const struct {
#endif
};
-static const guint n_gl_errors = G_N_ELEMENTS (gl_errors);
+static const unsigned int n_gl_errors = G_N_ELEMENTS (gl_errors);
-const gchar *
+const char *
cogl_gl_error_to_string (GLenum error_code)
{
- gint i;
+ int i;
for (i = 0; i < n_gl_errors; i++)
{
@@ -87,7 +87,7 @@ cogl_gl_error_to_string (GLenum error_code)
#endif /* COGL_GL_DEBUG */
CoglFuncPtr
-cogl_get_proc_address (const gchar* name)
+cogl_get_proc_address (const char* name)
{
void *address;
static GModule *module = NULL;
@@ -113,15 +113,15 @@ cogl_get_proc_address (const gchar* name)
}
gboolean
-_cogl_check_extension (const gchar *name, const gchar *ext)
+_cogl_check_extension (const char *name, const gchar *ext)
{
- gchar *end;
- gint name_len, n;
+ char *end;
+ int name_len, n;
if (name == NULL || ext == NULL)
return FALSE;
- end = (gchar*)(ext + strlen(ext));
+ end = (char*)(ext + strlen(ext));
name_len = strlen(name);
@@ -145,7 +145,7 @@ cogl_check_extension (const char *name, const char *ext)
}
void
-cogl_clear (const CoglColor *color, gulong buffers)
+cogl_clear (const CoglColor *color, unsigned long buffers)
{
GLbitfield gl_buffers = 0;
@@ -203,8 +203,8 @@ cogl_clear (const CoglColor *color, gulong buffers)
static inline gboolean
cogl_toggle_flag (CoglContext *ctx,
- gulong new_flags,
- gulong flag,
+ unsigned long new_flags,
+ unsigned long flag,
GLenum gl_flag)
{
/* Toggles and caches a single enable flag on or off
@@ -230,8 +230,8 @@ cogl_toggle_flag (CoglContext *ctx,
static inline gboolean
cogl_toggle_client_flag (CoglContext *ctx,
- gulong new_flags,
- gulong flag,
+ unsigned long new_flags,
+ unsigned long flag,
GLenum gl_flag)
{
/* Toggles and caches a single client-side enable flag
@@ -256,7 +256,7 @@ cogl_toggle_client_flag (CoglContext *ctx,
}
void
-cogl_enable (gulong flags)
+cogl_enable (unsigned long flags)
{
/* This function essentially caches glEnable state() in the
* hope of lessening number GL traffic.
@@ -280,7 +280,7 @@ cogl_enable (gulong flags)
GL_COLOR_ARRAY);
}
-gulong
+unsigned long
cogl_get_enable ()
{
_COGL_GET_CONTEXT (ctx, 0);
@@ -402,15 +402,15 @@ cogl_set_viewport (int x,
/* XXX: This should be deprecated, and we should expose a way to also
* specify an x and y viewport offset */
void
-cogl_viewport (guint width,
- guint height)
+cogl_viewport (unsigned int width,
+ unsigned int height)
{
cogl_set_viewport (0, 0, width, height);
}
void
-_cogl_setup_viewport (guint width,
- guint height,
+_cogl_setup_viewport (unsigned int width,
+ unsigned int height,
float fovy,
float aspect,
float z_near,
@@ -525,10 +525,10 @@ cogl_get_viewport (float v[4])
}
void
-cogl_get_bitmasks (gint *red,
- gint *green,
- gint *blue,
- gint *alpha)
+cogl_get_bitmasks (int *red,
+ int *green,
+ int *blue,
+ int *alpha)
{
GLint value;
@@ -698,7 +698,7 @@ void
cogl_begin_gl (void)
{
CoglMaterialFlushOptions options;
- gulong enable_flags = 0;
+ unsigned long enable_flags = 0;
int i;
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -851,7 +851,7 @@ _cogl_destroy_texture_units (void)
* Note that, for now, we use GL_MAX_TEXTURE_UNITS as we are exposing the
* fixed function pipeline.
*/
-guint
+unsigned int
_cogl_get_max_texture_image_units (void)
{
GLint nb_texture_image_units;
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 1fb5567a..d4d9d0f4 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -73,7 +73,8 @@ G_BEGIN_DECLS
*
* Since: 1.0
*/
-GOptionGroup * cogl_get_option_group (void);
+GOptionGroup *
+cogl_get_option_group (void);
/* Misc */
/**
@@ -85,7 +86,8 @@ GOptionGroup * cogl_get_option_group (void);
*
* Since: 0.8
*/
-CoglFeatureFlags cogl_get_features (void);
+CoglFeatureFlags
+cogl_get_features (void);
/**
* cogl_features_available:
@@ -98,7 +100,8 @@ CoglFeatureFlags cogl_get_features (void);
*
* Return value: %TRUE if the features are available, %FALSE otherwise.
*/
-gboolean cogl_features_available (CoglFeatureFlags features);
+gboolean
+cogl_features_available (CoglFeatureFlags features);
/**
* cogl_get_proc_address:
@@ -111,7 +114,8 @@ gboolean cogl_features_available (CoglFeatureFlags features);
* Return value: a pointer to the requested function or %NULL if the
* function is not available.
*/
-CoglFuncPtr cogl_get_proc_address (const gchar *name);
+CoglFuncPtr
+cogl_get_proc_address (const char *name);
#ifndef COGL_DISABLE_DEPRECATED
@@ -128,8 +132,9 @@ CoglFuncPtr cogl_get_proc_address (const gchar *name);
* appropriate to expose OpenGL extensions through the Cogl
* API.
*/
-gboolean cogl_check_extension (const gchar *name,
- const gchar *ext) G_GNUC_DEPRECATED;
+gboolean
+cogl_check_extension (const char *name,
+ const char *ext) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -144,10 +149,11 @@ gboolean cogl_check_extension (const gchar *name,
* in the color buffer. Pass %NULL for any of the arguments if the
* value is not required.
*/
-void cogl_get_bitmasks (gint *red,
- gint *green,
- gint *blue,
- gint *alpha);
+void
+cogl_get_bitmasks (int *red,
+ int *green,
+ int *blue,
+ int *alpha);
/**
* cogl_perspective:
@@ -159,10 +165,11 @@ void cogl_get_bitmasks (gint *red,
* Replaces the current projection matrix with a perspective matrix
* based on the provided values.
*/
-void cogl_perspective (float fovy,
- float aspect,
- float z_near,
- float z_far);
+void
+cogl_perspective (float fovy,
+ float aspect,
+ float z_near,
+ float z_far);
/**
* cogl_frustum:
@@ -178,12 +185,13 @@ void cogl_perspective (float fovy,
*
* Since: 0.8.2
*/
-void cogl_frustum (float left,
- float right,
- float bottom,
- float top,
- float z_near,
- float z_far);
+void
+cogl_frustum (float left,
+ float right,
+ float bottom,
+ float top,
+ float z_near,
+ float z_far);
/**
* cogl_ortho:
@@ -201,12 +209,13 @@ void cogl_frustum (float left,
*
* Since: 1.0
*/
-void cogl_ortho (float left,
- float right,
- float bottom,
- float top,
- float near,
- float far);
+void
+cogl_ortho (float left,
+ float right,
+ float bottom,
+ float top,
+ float near,
+ float far);
/*
* _cogl_setup_viewport:
@@ -226,12 +235,13 @@ void cogl_ortho (float left,
*
* This function is used only by Clutter.
*/
-void _cogl_setup_viewport (guint width,
- guint height,
- float fovy,
- float aspect,
- float z_near,
- float z_far);
+void
+_cogl_setup_viewport (unsigned int width,
+ unsigned int height,
+ float fovy,
+ float aspect,
+ float z_near,
+ float z_far);
#ifndef COGL_DISABLE_DEPRECATED
@@ -246,8 +256,9 @@ void _cogl_setup_viewport (guint width,
*
* Deprecated: 1.2: Use cogl_set_viewport() instead
*/
-void cogl_viewport (guint width,
- guint height) G_GNUC_DEPRECATED;
+void
+cogl_viewport (unsigned int width,
+ unsigned int height) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -262,10 +273,11 @@ void cogl_viewport (guint width,
*
* Since: 1.2
*/
-void cogl_set_viewport (int x,
- int y,
- int width,
- int height);
+void
+cogl_set_viewport (int x,
+ int y,
+ int width,
+ int height);
/**
* cogl_push_matrix:
@@ -273,14 +285,16 @@ void cogl_set_viewport (int x,
* Stores the current model-view matrix on the matrix stack. The matrix
* can later be restored with cogl_pop_matrix().
*/
-void cogl_push_matrix (void);
+void
+cogl_push_matrix (void);
/**
* cogl_pop_matrix:
*
* Restores the current model-view matrix from the matrix stack.
*/
-void cogl_pop_matrix (void);
+void
+cogl_pop_matrix (void);
/**
* cogl_scale:
@@ -291,9 +305,10 @@ void cogl_pop_matrix (void);
* Multiplies the current model-view matrix by one that scales the x,
* y and z axes by the given values.
*/
-void cogl_scale (float x,
- float y,
- float z);
+void
+cogl_scale (float x,
+ float y,
+ float z);
/**
* cogl_translate:
@@ -304,9 +319,10 @@ void cogl_scale (float x,
* Multiplies the current model-view matrix by one that translates the
* model along all three axes according to the given values.
*/
-void cogl_translate (float x,
- float y,
- float z);
+void
+cogl_translate (float x,
+ float y,
+ float z);
/**
* cogl_rotate:
@@ -321,10 +337,11 @@ void cogl_translate (float x,
* degrees about the vertex (0, 0, 1) causes a small counter-clockwise
* rotation.
*/
-void cogl_rotate (float angle,
- float x,
- float y,
- float z);
+void
+cogl_rotate (float angle,
+ float x,
+ float y,
+ float z);
/**
* cogl_get_modelview_matrix:
@@ -332,7 +349,8 @@ void cogl_rotate (float angle,
*
* Stores the current model-view matrix in @matrix.
*/
-void cogl_get_modelview_matrix (CoglMatrix *matrix);
+void
+cogl_get_modelview_matrix (CoglMatrix *matrix);
/**
* cogl_set_modelview_matrix:
@@ -340,7 +358,8 @@ void cogl_get_modelview_matrix (CoglMatrix *matrix);
*
* Loads @matrix as the new model-view matrix.
*/
-void cogl_set_modelview_matrix (CoglMatrix *matrix);
+void
+cogl_set_modelview_matrix (CoglMatrix *matrix);
/**
* cogl_get_projection_matrix:
@@ -348,7 +367,8 @@ void cogl_set_modelview_matrix (CoglMatrix *matrix);
*
* Stores the current projection matrix in @matrix.
*/
-void cogl_get_projection_matrix (CoglMatrix *matrix);
+void
+cogl_get_projection_matrix (CoglMatrix *matrix);
/**
* cogl_set_projection_matrix:
@@ -356,7 +376,8 @@ void cogl_get_projection_matrix (CoglMatrix *matrix);
*
* Loads matrix as the new projection matrix.
*/
-void cogl_set_projection_matrix (CoglMatrix *matrix);
+void
+cogl_set_projection_matrix (CoglMatrix *matrix);
/**
* cogl_get_viewport:
@@ -367,7 +388,8 @@ void cogl_set_projection_matrix (CoglMatrix *matrix);
* position of the viewport and @v[2] and @v[3] get the width and
* height.
*/
-void cogl_get_viewport (float v[4]);
+void
+cogl_get_viewport (float v[4]);
/**
* cogl_set_depth_test_enabled:
@@ -379,7 +401,8 @@ void cogl_get_viewport (float v[4]);
* clutter_actor_lower(), otherwise it will also take into account the
* actor's depth. Depth testing is disabled by default.
*/
-void cogl_set_depth_test_enabled (gboolean setting);
+void
+cogl_set_depth_test_enabled (gboolean setting);
/**
* cogl_get_depth_test_enabled:
@@ -388,7 +411,8 @@ void cogl_set_depth_test_enabled (gboolean setting);
*
* Return value: %TRUE if depth testing is enabled, and %FALSE otherwise
*/
-gboolean cogl_get_depth_test_enabled (void);
+gboolean
+cogl_get_depth_test_enabled (void);
/**
* cogl_set_backface_culling_enabled:
@@ -400,7 +424,8 @@ gboolean cogl_get_depth_test_enabled (void);
* only affects calls to the cogl_rectangle* family of functions and
* cogl_vertex_buffer_draw*. Backface culling is disabled by default.
*/
-void cogl_set_backface_culling_enabled (gboolean setting);
+void
+cogl_set_backface_culling_enabled (gboolean setting);
/**
* cogl_get_backface_culling_enabled:
@@ -410,7 +435,8 @@ void cogl_set_backface_culling_enabled (gboolean setting);
*
* Return value: %TRUE if backface culling is enabled, and %FALSE otherwise
*/
-gboolean cogl_get_backface_culling_enabled (void);
+gboolean
+cogl_get_backface_culling_enabled (void);
/**
* cogl_set_fog:
@@ -437,11 +463,12 @@ gboolean cogl_get_backface_culling_enabled (void);
* opaque primitives. This might improve in the future when we can depend
* on fragment shaders.</note>
*/
-void cogl_set_fog (const CoglColor *fog_color,
- CoglFogMode mode,
- float density,
- float z_near,
- float z_far);
+void
+cogl_set_fog (const CoglColor *fog_color,
+ CoglFogMode mode,
+ float density,
+ float z_near,
+ float z_far);
/**
* cogl_disable_fog:
@@ -449,7 +476,8 @@ void cogl_set_fog (const CoglColor *fog_color,
* This function disables fogging, so primitives drawn afterwards will not be
* blended with any previously set fog color.
*/
-void cogl_disable_fog (void);
+void
+cogl_disable_fog (void);
/**
* CoglBufferBit:
@@ -476,8 +504,9 @@ typedef enum {
* Clears all the auxiliary buffers identified in the @buffers mask, and if
* that includes the color buffer then the specified @color is used.
*/
-void cogl_clear (const CoglColor *color,
- gulong buffers);
+void
+cogl_clear (const CoglColor *color,
+ unsigned long buffers);
/**
* cogl_set_source:
@@ -492,7 +521,8 @@ void cogl_clear (const CoglColor *color,
*
* Since: 1.0
*/
-void cogl_set_source (CoglHandle material);
+void
+cogl_set_source (CoglHandle material);
/**
* cogl_set_source_color:
@@ -511,7 +541,8 @@ void cogl_set_source (CoglHandle material);
*
* Since: 1.0
*/
-void cogl_set_source_color (const CoglColor *color);
+void
+cogl_set_source_color (const CoglColor *color);
/**
* cogl_set_source_color4ub:
@@ -529,10 +560,11 @@ void cogl_set_source_color (const CoglColor *color);
*
* Since: 1.0
*/
-void cogl_set_source_color4ub (guint8 red,
- guint8 green,
- guint8 blue,
- guint8 alpha);
+void
+cogl_set_source_color4ub (guint8 red,
+ guint8 green,
+ guint8 blue,
+ guint8 alpha);
/**
* cogl_set_source_color4f:
@@ -551,10 +583,11 @@ void cogl_set_source_color4ub (guint8 red,
*
* Since: 1.0
*/
-void cogl_set_source_color4f (float red,
- float green,
- float blue,
- float alpha);
+void
+cogl_set_source_color4f (float red,
+ float green,
+ float blue,
+ float alpha);
/**
* cogl_set_source_texture:
@@ -576,7 +609,8 @@ void cogl_set_source_color4f (float red,
*
* Since: 1.0
*/
-void cogl_set_source_texture (CoglHandle texture_handle);
+void
+cogl_set_source_texture (CoglHandle texture_handle);
/**
* SECTION:cogl-clipping
@@ -607,10 +641,11 @@ void cogl_set_source_texture (CoglHandle texture_handle);
*
* Deprecated: 1.2: Use cogl_clip_push_window_rectangle() instead
*/
-void cogl_clip_push_window_rect (float x_offset,
- float y_offset,
- float width,
- float height) G_GNUC_DEPRECATED;
+void
+cogl_clip_push_window_rect (float x_offset,
+ float y_offset,
+ float width,
+ float height) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -632,10 +667,11 @@ void cogl_clip_push_window_rect (float x_offset,
*
* Since: 1.2
*/
-void cogl_clip_push_window_rectangle (int x_offset,
- int y_offset,
- int width,
- int height);
+void
+cogl_clip_push_window_rectangle (int x_offset,
+ int y_offset,
+ int width,
+ int height);
#ifndef COGL_DISABLE_DEPRECATED
@@ -661,10 +697,11 @@ void cogl_clip_push_window_rectangle (int x_offset,
* extending up, it's awkward to use. Please use cogl_clip_push_rectangle()
* instead
*/
-void cogl_clip_push (float x_offset,
- float y_offset,
- float width,
- float height) G_GNUC_DEPRECATED;
+void
+cogl_clip_push (float x_offset,
+ float y_offset,
+ float width,
+ float height) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -686,10 +723,11 @@ void cogl_clip_push (float x_offset,
*
* Since: 1.2
*/
-void cogl_clip_push_rectangle (float x0,
- float y0,
- float x1,
- float y1);
+void
+cogl_clip_push_rectangle (float x0,
+ float y0,
+ float x1,
+ float y1);
/**
* cogl_clip_push_from_path:
@@ -701,7 +739,8 @@ void cogl_clip_push_rectangle (float x0,
*
* Since: 1.0
*/
-void cogl_clip_push_from_path (void);
+void
+cogl_clip_push_from_path (void);
/**
* cogl_clip_push_from_path_preserve:
@@ -713,7 +752,8 @@ void cogl_clip_push_from_path (void);
*
* Since: 1.0
*/
-void cogl_clip_push_from_path_preserve (void);
+void
+cogl_clip_push_from_path_preserve (void);
/**
* cogl_clip_pop:
@@ -721,7 +761,8 @@ void cogl_clip_push_from_path_preserve (void);
* Reverts the clipping region to the state before the last call to
* cogl_clip_push().
*/
-void cogl_clip_pop (void);
+void
+cogl_clip_pop (void);
#ifndef COGL_DISABLE_DEPRECATED
@@ -737,7 +778,8 @@ void cogl_clip_pop (void);
*
* Since: 1.0
*/
-void cogl_clip_ensure (void) G_GNUC_DEPRECATED;
+void
+cogl_clip_ensure (void) G_GNUC_DEPRECATED;
/**
* cogl_clip_stack_save:
@@ -756,7 +798,8 @@ void cogl_clip_ensure (void) G_GNUC_DEPRECATED;
*
* Since: 0.8.2
*/
-void cogl_clip_stack_save (void) G_GNUC_DEPRECATED;
+void
+cogl_clip_stack_save (void) G_GNUC_DEPRECATED;
/**
* cogl_clip_stack_restore:
@@ -772,7 +815,8 @@ void cogl_clip_stack_save (void) G_GNUC_DEPRECATED;
*
* Since: 0.8.2
*/
-void cogl_clip_stack_restore (void) G_GNUC_DEPRECATED;
+void
+cogl_clip_stack_restore (void) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -788,7 +832,8 @@ void cogl_clip_stack_restore (void) G_GNUC_DEPRECATED;
*
* Since: 1.2
*/
-void cogl_set_framebuffer (CoglHandle buffer);
+void
+cogl_set_framebuffer (CoglHandle buffer);
/**
* cogl_push_framebuffer:
@@ -804,7 +849,8 @@ void cogl_set_framebuffer (CoglHandle buffer);
*
* Since: 1.2
*/
-void cogl_push_framebuffer (CoglHandle buffer);
+void
+cogl_push_framebuffer (CoglHandle buffer);
/**
* cogl_pop_framebuffer:
@@ -814,7 +860,8 @@ void cogl_push_framebuffer (CoglHandle buffer);
*
* Since: 1.2
*/
-void cogl_pop_framebuffer (void);
+void
+cogl_pop_framebuffer (void);
#ifndef COGL_DISABLE_DEPRECATED
@@ -833,8 +880,9 @@ void cogl_pop_framebuffer (void);
* Deprecated: 1.2: The target argument was redundant since we could look at
* the type of CoglHandle given instead.
*/
-void cogl_set_draw_buffer (CoglBufferTarget target,
- CoglHandle offscreen) G_GNUC_DEPRECATED;
+void
+cogl_set_draw_buffer (CoglBufferTarget target,
+ CoglHandle offscreen) G_GNUC_DEPRECATED;
/**
* cogl_push_draw_buffer:
@@ -843,7 +891,8 @@ void cogl_set_draw_buffer (CoglBufferTarget target,
*
* Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API
*/
-void cogl_push_draw_buffer (void) G_GNUC_DEPRECATED;
+void
+cogl_push_draw_buffer (void) G_GNUC_DEPRECATED;
/**
* cogl_pop_draw_buffer:
@@ -852,7 +901,8 @@ void cogl_push_draw_buffer (void) G_GNUC_DEPRECATED;
*
* Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API
*/
-void cogl_pop_draw_buffer (void) G_GNUC_DEPRECATED;
+void
+cogl_pop_draw_buffer (void) G_GNUC_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
@@ -884,13 +934,14 @@ typedef enum { /*< prefix=COGL_READ_PIXELS >*/
* position (0, 0) is the top left. The pixel at (x, y) is the first
* read, and the data is returned with a rowstride of (width * 4)
*/
-void cogl_read_pixels (int x,
- int y,
- int width,
- int height,
- CoglReadPixelsFlags source,
- CoglPixelFormat format,
- guint8 *pixels);
+void
+cogl_read_pixels (int x,
+ int y,
+ int width,
+ int height,
+ CoglReadPixelsFlags source,
+ CoglPixelFormat format,
+ guint8 *pixels);
/**
* cogl_flush:
@@ -918,7 +969,8 @@ void cogl_read_pixels (int x,
*
* Since: 1.0
*/
-void cogl_flush (void);
+void
+cogl_flush (void);
/**
* cogl_begin_gl:
@@ -993,7 +1045,8 @@ void cogl_flush (void);
*
* Since: 1.0
*/
-void cogl_begin_gl (void);
+void
+cogl_begin_gl (void);
/**
* cogl_end_gl:
@@ -1003,7 +1056,8 @@ void cogl_begin_gl (void);
*
* Since: 1.0
*/
-void cogl_end_gl (void);
+void
+cogl_end_gl (void);
/*
* Internal API available only to Clutter.
@@ -1014,7 +1068,8 @@ void cogl_end_gl (void);
* move down into Cogl and these functions will be removed.
*/
-void _cogl_destroy_context (void);
+void
+_cogl_destroy_context (void);
/*< private >*/
#define COGL_DRIVER_ERROR (_cogl_driver_error_quark ())
@@ -1024,11 +1079,20 @@ typedef enum { /*< prefix=COGL_DRIVER_ERROR >*/
COGL_DRIVER_ERROR_INVALID_VERSION
} CoglDriverError;
-gboolean _cogl_check_extension (const char *name, const char *ext);
-void _cogl_set_indirect_context (gboolean indirect);
-void _cogl_set_viewport (int x, int y, int width, int height);
-gboolean _cogl_check_driver_valid (GError **error);
-GQuark _cogl_driver_error_quark (void);
+gboolean
+_cogl_check_extension (const char *name, const char *ext);
+
+void
+_cogl_set_indirect_context (gboolean indirect);
+
+void
+_cogl_set_viewport (int x, int y, int width, int height);
+
+gboolean
+_cogl_check_driver_valid (GError **error);
+
+GQuark
+_cogl_driver_error_quark (void);
void
_cogl_onscreen_clutter_backend_set_size (int width, int height);
diff --git a/cogl/driver/gl/cogl-program.c b/cogl/driver/gl/cogl-program.c
index 3cd48ecf..39b096a4 100644
--- a/cogl/driver/gl/cogl-program.c
+++ b/cogl/driver/gl/cogl-program.c
@@ -145,7 +145,7 @@ cogl_program_use (CoglHandle handle)
int
cogl_program_get_uniform_location (CoglHandle handle,
- const gchar *uniform_name)
+ const char *uniform_name)
{
CoglProgram *program;
_COGL_GET_CONTEXT (ctx, 0);
@@ -160,7 +160,7 @@ cogl_program_get_uniform_location (CoglHandle handle,
void
cogl_program_uniform_1f (int uniform_no,
- gfloat value)
+ float value)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
glUniform1f (uniform_no, value);
@@ -168,7 +168,7 @@ cogl_program_uniform_1f (int uniform_no,
void
cogl_program_uniform_1i (int uniform_no,
- gint value)
+ int value)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
glUniform1i (uniform_no, value);
@@ -176,8 +176,8 @@ cogl_program_uniform_1i (int uniform_no,
void
cogl_program_uniform_float (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const GLfloat *value)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -203,8 +203,8 @@ cogl_program_uniform_float (int uniform_no,
void
cogl_program_uniform_int (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const int *value)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -230,8 +230,8 @@ cogl_program_uniform_int (int uniform_no,
void
cogl_program_uniform_matrix (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
gboolean transpose,
const GLfloat *value)
{
diff --git a/cogl/driver/gl/cogl-shader.c b/cogl/driver/gl/cogl-shader.c
index f02f2131..7c2abdcd 100644
--- a/cogl/driver/gl/cogl-shader.c
+++ b/cogl/driver/gl/cogl-shader.c
@@ -107,7 +107,7 @@ cogl_shader_compile (CoglHandle handle)
glCompileShader (shader->gl_handle);
}
-gchar *
+char *
cogl_shader_get_info_log (CoglHandle handle)
{
CoglShader *shader;
diff --git a/cogl/driver/gl/cogl-texture-driver.c b/cogl/driver/gl/cogl-texture-driver.c
index 5d7c9f86..46e50a9a 100644
--- a/cogl/driver/gl/cogl-texture-driver.c
+++ b/cogl/driver/gl/cogl-texture-driver.c
@@ -52,7 +52,7 @@ _cogl_texture_driver_gen (GLenum gl_target,
GLsizei n,
GLuint *textures)
{
- guint i;
+ unsigned int i;
GE (glGenTextures (n, textures));
diff --git a/cogl/driver/gl/cogl.c b/cogl/driver/gl/cogl.c
index f6a3b5c4..72c7b160 100644
--- a/cogl/driver/gl/cogl.c
+++ b/cogl/driver/gl/cogl.c
@@ -98,7 +98,7 @@ gboolean
_cogl_check_driver_valid (GError **error)
{
int major, minor;
- const gchar *gl_extensions;
+ const char *gl_extensions;
if (!_cogl_get_gl_version (&major, &minor))
{
@@ -113,7 +113,7 @@ _cogl_check_driver_valid (GError **error)
if (COGL_CHECK_GL_VERSION (major, minor, 1, 3))
return TRUE;
- gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS);
+ gl_extensions = (const char*) glGetString (GL_EXTENSIONS);
/* OpenGL 1.2 is only supported if we have the multitexturing
extension */
@@ -175,7 +175,7 @@ void
_cogl_features_init (void)
{
CoglFeatureFlags flags = 0;
- const gchar *gl_extensions;
+ const char *gl_extensions;
GLint max_clip_planes = 0;
GLint num_stencil_bits = 0;
int gl_major = 0, gl_minor = 0;
@@ -187,7 +187,7 @@ _cogl_features_init (void)
flags = COGL_FEATURE_TEXTURE_READ_PIXELS;
- gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS);
+ gl_extensions = (const char*) glGetString (GL_EXTENSIONS);
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) ||
_cogl_check_extension ("GL_ARB_texture_non_power_of_two", gl_extensions))
diff --git a/cogl/driver/gles/cogl-gles2-wrapper.c b/cogl/driver/gles/cogl-gles2-wrapper.c
index 65d29956..f3a9e83b 100644
--- a/cogl/driver/gles/cogl-gles2-wrapper.c
+++ b/cogl/driver/gles/cogl-gles2-wrapper.c
@@ -788,7 +788,7 @@ cogl_gles2_do_set_uniform (GLint location, CoglBoxedValue *value)
case COGL_BOXED_INT:
{
- gint *ptr;
+ int *ptr;
if (value->count == 1)
ptr = value->v.int_value;
@@ -807,7 +807,7 @@ cogl_gles2_do_set_uniform (GLint location, CoglBoxedValue *value)
case COGL_BOXED_FLOAT:
{
- gfloat *ptr;
+ float *ptr;
if (value->count == 1)
ptr = value->v.float_value;
@@ -826,7 +826,7 @@ cogl_gles2_do_set_uniform (GLint location, CoglBoxedValue *value)
case COGL_BOXED_MATRIX:
{
- gfloat *ptr;
+ float *ptr;
if (value->count == 1)
ptr = value->v.matrix;
diff --git a/cogl/driver/gles/cogl-gles2-wrapper.h b/cogl/driver/gles/cogl-gles2-wrapper.h
index 52b81238..33287e01 100644
--- a/cogl/driver/gles/cogl-gles2-wrapper.h
+++ b/cogl/driver/gles/cogl-gles2-wrapper.h
@@ -128,8 +128,8 @@ struct _CoglGles2WrapperSettings
/* The current in-use user program */
CoglHandle user_program;
- guint alpha_test_enabled:1;
- guint fog_enabled:1;
+ unsigned int alpha_test_enabled:1;
+ unsigned int fog_enabled:1;
};
struct _CoglGles2WrapperTextureUnit
@@ -141,8 +141,8 @@ struct _CoglGles2WrapperTextureUnit
GLsizei texture_coords_stride;
const void *texture_coords_pointer;
- guint texture_coords_enabled:1;
- guint dirty_matrix:1; /*!< shader uniform needs updating */
+ unsigned int texture_coords_enabled:1;
+ unsigned int dirty_matrix:1; /*!< shader uniform needs updating */
};
struct _CoglGles2Wrapper
@@ -150,8 +150,8 @@ struct _CoglGles2Wrapper
GLuint matrix_mode;
CoglMatrix modelview_matrix;
CoglMatrix projection_matrix;
- guint active_texture_unit;
- guint active_client_texture_unit;
+ unsigned int active_texture_unit;
+ unsigned int active_client_texture_unit;
CoglGles2WrapperTextureUnit texture_units[COGL_GLES2_MAX_TEXTURE_UNITS];
diff --git a/cogl/driver/gles/cogl-program.c b/cogl/driver/gles/cogl-program.c
index 088cecfe..8fc372b9 100644
--- a/cogl/driver/gles/cogl-program.c
+++ b/cogl/driver/gles/cogl-program.c
@@ -124,7 +124,7 @@ cogl_program_use (CoglHandle handle)
int
cogl_program_get_uniform_location (CoglHandle handle,
- const gchar *uniform_name)
+ const char *uniform_name)
{
int i;
CoglProgram *program;
@@ -156,24 +156,24 @@ cogl_program_get_uniform_location (CoglHandle handle,
void
cogl_program_uniform_1f (int uniform_no,
- gfloat value)
+ float value)
{
cogl_program_uniform_float (uniform_no, 1, 1, &value);
}
void
cogl_program_uniform_1i (int uniform_no,
- gint value)
+ int value)
{
cogl_program_uniform_int (uniform_no, 1, 1, &value);
}
static void
cogl_program_uniform_x (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
CoglBoxedType type,
- size_t value_size,
+ gsize value_size,
gconstpointer value)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -216,8 +216,8 @@ cogl_program_uniform_x (int uniform_no,
void
cogl_program_uniform_float (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const GLfloat *value)
{
cogl_program_uniform_x (uniform_no, size, count, COGL_BOXED_FLOAT,
@@ -226,18 +226,18 @@ cogl_program_uniform_float (int uniform_no,
void
cogl_program_uniform_int (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const GLint *value)
{
cogl_program_uniform_x (uniform_no, size, count, COGL_BOXED_INT,
- sizeof (gint) * size, value);
+ sizeof (int) * size, value);
}
void
cogl_program_uniform_matrix (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
gboolean transpose,
const GLfloat *value)
{
@@ -298,37 +298,37 @@ cogl_program_use (CoglHandle program_handle)
int
cogl_program_get_uniform_location (CoglHandle program_handle,
- const gchar *uniform_name)
+ const char *uniform_name)
{
return 0;
}
void
cogl_program_uniform_1f (int uniform_no,
- gfloat value)
+ float value)
{
}
void
cogl_program_uniform_float (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const GLfloat *value)
{
}
void
cogl_program_uniform_int (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
const int *value)
{
}
void
cogl_program_uniform_matrix (int uniform_no,
- gint size,
- gint count,
+ int size,
+ int count,
gboolean transpose,
const GLfloat *value)
{
diff --git a/cogl/driver/gles/cogl-shader.c b/cogl/driver/gles/cogl-shader.c
index 23109be3..ae4d6b31 100644
--- a/cogl/driver/gles/cogl-shader.c
+++ b/cogl/driver/gles/cogl-shader.c
@@ -99,7 +99,7 @@ cogl_shader_compile (CoglHandle handle)
glCompileShader (shader->gl_handle);
}
-gchar *
+char *
cogl_shader_get_info_log (CoglHandle handle)
{
CoglShader *shader;
@@ -200,7 +200,7 @@ cogl_shader_compile (CoglHandle shader_handle)
{
}
-gchar *
+char *
cogl_shader_get_info_log (CoglHandle handle)
{
return NULL;
diff --git a/cogl/driver/gles/cogl-texture-driver.c b/cogl/driver/gles/cogl-texture-driver.c
index 41cc9a82..0fc6744c 100644
--- a/cogl/driver/gles/cogl-texture-driver.c
+++ b/cogl/driver/gles/cogl-texture-driver.c
@@ -52,7 +52,7 @@ _cogl_texture_driver_gen (GLenum gl_target,
GLsizei n,
GLuint *textures)
{
- guint i;
+ unsigned int i;
GE (glGenTextures (n, textures));
@@ -125,7 +125,7 @@ _cogl_texture_driver_upload_subregion_to_gl (GLenum gl_target,
slice_bmp.width = width;
slice_bmp.height = height;
slice_bmp.rowstride = bpp * slice_bmp.width;
- slice_bmp.data = (guchar*) g_malloc (slice_bmp.rowstride * slice_bmp.height);
+ slice_bmp.data = g_malloc (slice_bmp.rowstride * slice_bmp.height);
/* Setup gl alignment to match rowstride and top-left corner */
_cogl_texture_driver_prep_gl_for_pixels_upload (slice_bmp.rowstride,
diff --git a/doc/CODING_STYLE b/doc/CODING_STYLE
new file mode 100644
index 00000000..748b915b
--- /dev/null
+++ b/doc/CODING_STYLE
@@ -0,0 +1,49 @@
+Cogl Coding Style
+--------------------
+
+This document is intended to be a short description of the preferred
+coding style to be used for the Cogl source code.
+
+Coding style is a matter of consistency, readability and maintainance;
+coding style is also completely arbitrary and a matter of taste. This
+document will use examples at the very least to provide authoritative
+and consistent answers to common questions regarding the coding style,
+and will also try to identify the allowed exceptions.
+
+The Cogl coding style is currently defined relative to the Clutter
+coding style, so please first read clutter/docs/CODING_STYLE.
+
+Differences to the Clutter coding style:
+
++ Headers
+
+Cogl headers are not exempt from the 80 characters limit as they are in
+Clutter. Function prototypes should not be arranged into vertical
+columns but should instead follow the "+ Functions" section of the
+Clutter CODING_STYLE like:
+
+void
+my_function (CoglType type,
+ CoglType *a_pointer,
+ CoglType another_type);
+
++ Types
+
+Avoid the use of redundant glib typedefs and wherever possible simply
+use ANSI C types.
+
+The following types should not be used:
+ gint, guint, gfloat, gdouble, glong, gulong, gchar and guchar
+Instead use:
+ int, unsigned int, float, double, long, unsigned long, char, and
+ guint8/unsigned char
+
+The glib types that we continue to use for portability are gboolean,
+gint{8,16,32,64}, guint{8,16,32,64} and gsize. When ever you need a
+byte size type for dealing with pixel data then guint8 should be used.
+
+The general intention is that Cogl should look palatable to the widest
+range of C programmers including those outside the Gnome community so
+- especially for the public API - we want to minimize the number of
+foreign looking typedefs.
+