1
0
Fork 0
Commit graph

4 commits

Author SHA1 Message Date
Neil Roberts
5dc1b2fb8f cogl-primitive: Fix the ref-counting for the convenience constuctors
The convenience constructors for the builtin vertex structs were
creating the primitive and then immediately destroying it and
returning the pointer. I think the intention was to unref the
attributes instead. This adds an internal wrapper around the
new_with_attributes_array constructor which unrefs the attributes
instead of the primitive. The convenience constructors now use that.
2010-11-04 17:57:09 +00:00
Robert Bragg
b03f905094 primitive: adds immutable ref/unref mechanism
This adds a way to mark that a primitive is in use so that modifications
will generate a warning. The plan is to use this mechanism when batching
primitives in the journal to warn users that mid-scene modifications of
primitives is not allowed.
2010-11-03 18:04:31 +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