[cogl-vertex-buffer] fix n_components validation for GL's builtin attributes
authorRobert Bragg <robert@linux.intel.com>
Thu, 24 Sep 2009 16:34:26 +0000 (17:34 +0100)
committerRobert Bragg <robert@linux.intel.com>
Thu, 24 Sep 2009 20:41:50 +0000 (21:41 +0100)
commit904c495c6d3c59b34148c9a4834e4803b488997b
tree60c4fbbf8f7fdbf087d5b68ba06591ff075d35d1
parentdae569b468c286ea23aa0e74e910232e025932db
[cogl-vertex-buffer] fix n_components validation for GL's builtin attributes

glVertexPointer expects positions with 2, 3 or 4 components, glColorPointer
expects colors with 3 or 4 components and glNormalPointer expects normals
with three components so when adding vertex buffer atributes with the names
"gl_Vertex", "gl_Color" or "gl_Normal" we assert these constraints and print
an explanation to the developer if not met.

This also fixes the previosly incorrect constraint that gl_Normal attributes
must have n_components == 1; thanks to Cat Sidhe for reporting this:

Bug: http://bugzilla.openedhand.com/show_bug.cgi?id=1819
clutter/cogl/common/cogl-vertex-buffer.c