[cogl] Use clockwise face winding for offscreen buffers with culling enabled

Because Cogl defines the origin for texture as top left and offscreen draw
buffers can be used to render to textures, we (internally) force all
offscreen rendering to be upside down. (because OpenGL defines the origin
to be bottom left)

By forcing the users scene to be rendered upside down though we also reverse
the winding order of all the drawn triangles which may interfere with the
users use of backface culling.  This patch ensures that we reverse the
winding order for a front face (if culling is in use) while rendering
offscreen so we don't conflict with the users back face culling.
This commit is contained in:
Robert Bragg
2009-10-22 19:01:52 +01:00
parent 1acf5cc36f
commit 181bf92086
7 changed files with 48 additions and 0 deletions

View File

@ -1683,6 +1683,7 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags);
_cogl_flush_face_winding ();
}
static void