summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2009-05-26 16:55:11 +0100
committerRobert Bragg <robert@linux.intel.com>2009-05-28 02:43:36 +0100
commit2f0bda49fc4ba19fc2d853f79f48a8bb2e095bac (patch)
tree8b2361bba1c674bb8442147aeec457d12dbff63e
parent18193e5322500b9cd3f372223b33581558758312 (diff)
downloadcogl-2f0bda49fc4ba19fc2d853f79f48a8bb2e095bac.tar.gz
[cogl] renamed cogl_enable_* to cogl_set_*_enabled + added getters
cogl_enable_depth_test and cogl_enable_backface_culling have been renamed and now have corresponding getters, the new functions are: cogl_set_depth_test_enabled cogl_get_depth_test_enabled cogl_set_backface_culling_enabled cogl_get_backface_culling_enabled
-rw-r--r--cogl-deprecated.h1
-rw-r--r--cogl.h.in27
-rw-r--r--common/cogl.c25
-rw-r--r--doc/reference/cogl/cogl-sections.txt6
4 files changed, 45 insertions, 14 deletions
diff --git a/cogl-deprecated.h b/cogl-deprecated.h
index 2111e48b..41e77b3d 100644
--- a/cogl-deprecated.h
+++ b/cogl-deprecated.h
@@ -24,5 +24,6 @@
#ifndef COGL_DEPRECATED_H
#define cogl_color cogl_color_REPLACED_BY_cogl_set_source_color
+#define cogl_enable_depth_test cogl_enable_depth_test_RENAMED_TO_cogl_set_depth_test_enabled
#endif
diff --git a/cogl.h.in b/cogl.h.in
index e66cbc39..188af09c 100644
--- a/cogl.h.in
+++ b/cogl.h.in
@@ -331,7 +331,7 @@ void cogl_set_projection_matrix (CoglMatrix *matrix);
void cogl_get_viewport (float v[4]);
/**
- * cogl_enable_depth_test:
+ * cogl_set_depth_test_enable:
* @setting: %TRUE to enable depth testing or %FALSE to disable.
*
* Sets whether depth testing is enabled. If it is disabled then the
@@ -340,10 +340,19 @@ 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_enable_depth_test (gboolean setting);
+void cogl_set_depth_test_enable (gboolean setting);
/**
- * cogl_enable_backface_culling:
+ * cogl_get_depth_test_enable:
+ *
+ * Queries if depth testing has been enabled via cogl_set_depth_test_enable()
+ *
+ * Returns: TRUE if depth testing is enabled else FALSE
+ */
+gboolean cogl_get_depth_test_enable (void);
+
+/**
+ * cogl_set_backface_culling_enabled:
* @setting: %TRUE to enable backface culling or %FALSE to disable.
*
* Sets whether textures positioned so that their backface is showing
@@ -352,7 +361,17 @@ void cogl_enable_depth_test (gboolean setting);
* only affects calls to the cogl_rectangle* family of functions and
* cogl_vertex_buffer_draw*. Backface culling is disabled by default.
*/
-void cogl_enable_backface_culling (gboolean setting);
+void cogl_set_backface_culling_enabled (gboolean setting);
+
+/**
+ * cogl_get_backface_culling_enabled:
+ *
+ * Queries if backface culling has been enabled via
+ * cogl_set_backface_culling_enabled()
+ *
+ * Returns: TRUE if backface culling is enabled else FALSE
+ */
+gboolean cogl_get_backface_culling_enabled (void);
/**
* cogl_set_fog:
diff --git a/common/cogl.c b/common/cogl.c
index 81c43bd5..adeb479d 100644
--- a/common/cogl.c
+++ b/common/cogl.c
@@ -214,30 +214,39 @@ cogl_get_enable ()
}
void
-cogl_enable_depth_test (gboolean setting)
+cogl_set_depth_test_enabled (gboolean setting)
{
if (setting)
{
glEnable (GL_DEPTH_TEST);
- glEnable (GL_ALPHA_TEST);
glDepthFunc (GL_LEQUAL);
- glAlphaFunc (GL_GREATER, 0.1);
}
else
- {
- glDisable (GL_DEPTH_TEST);
- glDisable (GL_ALPHA_TEST);
- }
+ glDisable (GL_DEPTH_TEST);
+}
+
+gboolean
+cogl_get_depth_test_enabled (void)
+{
+ return glIsEnabled (GL_DEPTH_TEST) == GL_TRUE ? TRUE : FALSE;
}
void
-cogl_enable_backface_culling (gboolean setting)
+cogl_set_backface_culling_enabled (gboolean setting)
{
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
ctx->enable_backface_culling = setting;
}
+gboolean
+cogl_get_backface_culling_enabled (void)
+{
+ _COGL_GET_CONTEXT (ctx, FALSE);
+
+ return ctx->enable_backface_culling;
+}
+
void
cogl_set_source_color (const CoglColor *color)
{
diff --git a/doc/reference/cogl/cogl-sections.txt b/doc/reference/cogl/cogl-sections.txt
index 5855a90b..c34585ff 100644
--- a/doc/reference/cogl/cogl-sections.txt
+++ b/doc/reference/cogl/cogl-sections.txt
@@ -40,8 +40,10 @@ cogl_get_viewport
<SUBSECTION>
cogl_clear
cogl_get_bitmasks
-cogl_enable_depth_test
-cogl_enable_backface_culling
+cogl_set_depth_test_enabled
+cogl_get_depth_test_enabled
+cogl_set_backface_culling_enabled
+cogl_get_backface_culling_enabled
<SUBSECTION>
CoglFogMode
cogl_set_fog