diff --git a/cogl.h.in b/cogl.h.in index b3b0584b0..bd3698312 100644 --- a/cogl.h.in +++ b/cogl.h.in @@ -325,9 +325,9 @@ void cogl_enable_depth_test (gboolean setting); * * Sets whether textures positioned so that their backface is showing * should be hidden. This can be used to efficiently draw two-sided - * textures or fully closed cubes without enabling depth testing. Only - * calls to cogl_texture_rectangle() and cogl_texture_polygon() are - * affected. Backface culling is disabled by default. + * textures or fully closed cubes without enabling depth testing. This + * 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); diff --git a/common/cogl-internal.h b/common/cogl-internal.h index f148c35b6..980e2a886 100644 --- a/common/cogl-internal.h +++ b/common/cogl-internal.h @@ -62,6 +62,7 @@ const gchar *cogl_gl_error_to_string (GLenum error_code); { \ g_warning ("%s: GL error (%d): %s\n", \ G_STRLOC, \ + __err, \ cogl_gl_error_to_string (__err)); \ } } G_STMT_END diff --git a/common/cogl-vertex-buffer.c b/common/cogl-vertex-buffer.c index b7e004a49..f6fa6ba89 100644 --- a/common/cogl-vertex-buffer.c +++ b/common/cogl-vertex-buffer.c @@ -1647,6 +1647,9 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer) enable_flags |= cogl_material_get_cogl_enable_flags (ctx->source_material); + if (ctx->enable_backface_culling) + enable_flags |= COGL_ENABLE_BACKFACE_CULLING; + cogl_enable (enable_flags); } @@ -1723,6 +1726,8 @@ cogl_vertex_buffer_draw (CoglHandle handle, if (!cogl_is_vertex_buffer (handle)) return; + cogl_clip_ensure (); + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); enable_state_for_drawing_buffer (buffer); @@ -1751,6 +1756,8 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle, if (!cogl_is_vertex_buffer (handle)) return; + cogl_clip_ensure (); + buffer = _cogl_vertex_buffer_pointer_from_handle (handle); enable_state_for_drawing_buffer (buffer);