Commit Graph

4 Commits

Author SHA1 Message Date
Neil Roberts
ec080f2db0 cogl-primitive: Add the missing cogl_primitive_new_p2 function
There was a struct defined for CoglP2Vertex but there was no
constructor function to use it.
2010-11-04 17:59:28 +00:00
Robert Bragg
18e302c5cd primitive: fix prototypes and start adding docs
This fixes the prototypes for the cogl_primitive_new_xyz functions and
also adds documentation with examples for each one.
2010-11-04 17:57:05 +00:00
Robert Bragg
a03a5814e7 primitive: Adds convenience constructors
This adds convenience primitive constructors named like:
  cogl_primitive_new_p3 or
  cogl_primitive_new_p3c4 or
  cogl_primitive_new_p3t2c4
where the letters correspond to the interleved vertex attributes layouts
such as CoglP3Vertex which is a struct with 3 float x,y,z members for
the [p]osition, or CoglP3T2C4Vertex which is a struct with 3 float x,y,z
members for the [p]osition, 2 float s,t members for the [t]exture
coordinates and 4 unsigned byte r,g,b,a members for the [c]olor.

The hope is that people will find these convenient enough to replace
cogl_polygon.
2010-11-03 18:04:31 +00:00
Robert Bragg
9498d505dd cogl: Adds experimental CoglPrimitive API
A CoglPrimitive is a retainable object for drawing a single primitive,
such as a triangle strip, fan or list.

CoglPrimitives build on CoglVertexAttributes and CoglIndices which
themselves build on CoglVertexArrays and CoglIndexArrays respectively.

A CoglPrimitive encapsulates enough information such that it can be
retained in a queue (e.g. the Cogl Journal, or renderlists in the
future) and drawn at some later time.
2010-11-03 18:04:31 +00:00