diff options
author | Robert Bragg <robert@linux.intel.com> | 2012-04-16 21:56:40 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2012-08-06 14:27:39 +0100 |
commit | 54735dec849a0f687d71288f458ab1050b7dd806 (patch) | |
tree | 2a856c2b482f121d25b6d9393ae81b79a64b669e /cogl/cogl-context-private.h | |
parent | 09642a83b5f036756c7625ade7cf57358396baec (diff) | |
download | cogl-54735dec849a0f687d71288f458ab1050b7dd806.tar.gz |
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
Diffstat (limited to 'cogl/cogl-context-private.h')
-rw-r--r-- | cogl/cogl-context-private.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h index b4a24904..35ee0900 100644 --- a/cogl/cogl-context-private.h +++ b/cogl/cogl-context-private.h @@ -100,7 +100,7 @@ struct _CoglContext CoglBitmask enable_custom_attributes_tmp; CoglBitmask changed_bits_tmp; - gboolean legacy_backface_culling_enabled; + CoglBool legacy_backface_culling_enabled; /* A few handy matrix constants */ CoglMatrix identity_matrix; @@ -154,18 +154,18 @@ struct _CoglContext /* Some simple caching, to minimize state changes... */ CoglPipeline *current_pipeline; unsigned long current_pipeline_changes_since_flush; - gboolean current_pipeline_skip_gl_color; + CoglBool current_pipeline_skip_gl_color; unsigned long current_pipeline_age; - gboolean gl_blend_enable_cache; + CoglBool gl_blend_enable_cache; - gboolean depth_test_enabled_cache; + CoglBool depth_test_enabled_cache; CoglDepthTestFunction depth_test_function_cache; - gboolean depth_writing_enabled_cache; + CoglBool depth_writing_enabled_cache; float depth_range_near_cache; float depth_range_far_cache; - gboolean legacy_depth_test_enabled; + CoglBool legacy_depth_test_enabled; CoglBuffer *current_buffer[COGL_BUFFER_BIND_TARGET_COUNT]; @@ -191,7 +191,7 @@ struct _CoglContext CoglIndices *rectangle_short_indices; int rectangle_short_indices_len; - gboolean in_begin_gl_block; + CoglBool in_begin_gl_block; CoglPipeline *texture_download_pipeline; CoglPipeline *blit_texture_pipeline; @@ -203,7 +203,7 @@ struct _CoglContext displaying the quad batches. It needs to be global so that it can be reset by cogl_clear. It needs to be reset to increase the chances of getting the same colour during an animation */ - guint8 journal_rectangles_color; + uint8_t journal_rectangles_color; /* Cached values for GL_MAX_TEXTURE_[IMAGE_]UNITS to avoid calling glGetInteger too often */ @@ -218,7 +218,7 @@ struct _CoglContext CoglPipelineProgramType current_vertex_program_type; GLuint current_gl_program; - gboolean current_gl_dither_enabled; + CoglBool current_gl_dither_enabled; CoglColorMask current_gl_color_mask; /* List of types that will be considered a subclass of CoglTexture in @@ -237,7 +237,7 @@ struct _CoglContext doesn't need to be a valid pointer. We can't just use NULL in current_clip_stack to mark a dirty state because NULL is a valid stack (meaning no clipping) */ - gboolean current_clip_stack_valid; + CoglBool current_clip_stack_valid; /* The clip state that was flushed. This isn't intended to be used as a stack to push and pop new entries. Instead the current stack that the user wants is part of the framebuffer state. This is @@ -249,13 +249,13 @@ struct _CoglContext state. If TRUE then any further use of the stencil buffer (such as for drawing paths) would need to be merged with the existing stencil buffer */ - gboolean current_clip_stack_uses_stencil; + CoglBool current_clip_stack_uses_stencil; /* This is used as a temporary buffer to fill a CoglBuffer when cogl_buffer_map fails and we only want to map to fill it with new data */ GByteArray *buffer_map_fallback_array; - gboolean buffer_map_fallback_in_use; + CoglBool buffer_map_fallback_in_use; CoglWinsysRectangleState rectangle_state; @@ -324,7 +324,7 @@ _cogl_context_get_winsys (CoglContext *context); * to know when to re-query the GL extensions. The backend should also * check whether the GL context is supported by Cogl. If not it should * return FALSE and set @error */ -gboolean +CoglBool _cogl_context_update_features (CoglContext *context, GError **error); |