Commit Graph

12 Commits

Author SHA1 Message Date
Neil Roberts
6027aa04a4 cogl-buffer: Use void* instead of guint8* for map and set_data
Unless the CoglBuffer is being used for texture data then it's
relatively unlikely that the data will contain an array of bytes. For
example if it's used as a vertex array then it's more likely to be
floats or some vertex struct. In that case it's much more convenient
if set_data and map use void* pointers so that we can avoid a cast.
2010-11-04 18:04:03 +00:00
Emmanuele Bassi
71f62ca500 Enumeration value should be on the same line
The glib-mkenums script is not clever enough to deal with

  FLAGS_VALUE = FLAGS_A |
                FLAGS_B

And since this breaks the enumeration GType and the introspection data,
we cannot really wait for it to be fixed.

See: https://bugzilla.gnome.org/show_bug.cgi?id=629741

http://bugzilla.clutter-project.org/show_bug.cgi?id=2238
2010-09-15 11:56:59 +01:00
Robert Bragg
f8d58446a8 cogl-buffer: consider it an error to free a mapped buffer
Explicitly warn if we detect that a CoglBuffer is being freed while it
is still mapped. Previously we silently unmapped the buffer, but it's
not something we want to encourage.
2010-07-07 14:08:11 +01:00
Robert Bragg
92d0322766 pixel-array: Allow passing of hints to cogl_buffer_map
This allows you to tell Cogl that you are planning to replace all the
buffer's data once it is mapped with cogl_buffer_map. This means if the
buffer is currently being accessed by the GPU then the driver doesn't
have to stall and wait for it to finish before it can access it from the
CPU and can instead potentially allocate a new buffer with undefined
data and map that.
2010-07-06 12:07:28 +01:00
Robert Bragg
cafeb02531 cogl-buffer: make the COGL_BUFFER_USAGE_HINT private
The usage hint should be implied by the CoglBuffer subclass type so the
public getter and setter APIs for manually changing the usage hint of a
CoglBuffer have now been removed.
2010-07-05 15:20:04 +01:00
Robert Bragg
1000c80444 cogl: declare experimental symbols consistently
We had several different ways of exposing experimental API, in one case
the symbols had no special suffix, in two other ways the symbols were
given an _EXP suffix but in different ways.

This makes all experimental API have an _EXP suffix which is handled
using #defines in the header so the prototypes in the .c and .h files
don't have the suffix.

The documented reason for the suffix is so that anyone watching Cogl for
ABI changes who sees symbols disappear will hopefully understand what's
going on.
2010-06-30 18:51:31 +01:00
Robert Bragg
3aaef72e50 buffer: Remove use of CoglHandle in the CoglBuffer API
This replaces the use of CoglHandle with strongly type CoglBuffer *
pointers instead. The only function not converted for now is
cogl_is_buffer which will be done in a later commit.
2010-05-28 18:42:33 +01:00
Emmanuele Bassi
72f4ddf532 Remove mentions of the FSF address
Since using addresses that might change is something that finally
the FSF acknowledge as a plausible scenario (after changing address
twice), the license blurb in the source files should use the URI
for getting the license in case the library did not come with it.

Not that URIs cannot possibly change, but at least it's easier to
set up a redirection at the same place.

As a side note: this commit closes the oldes bug in Clutter's bug
report tool.

http://bugzilla.openedhand.com/show_bug.cgi?id=521
2010-03-01 12:56:10 +00:00
Robert Bragg
0f5f4e8645 cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.

There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.

The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:

 return_type
 cogl_function_name (CoglType arg0,
                     CoglType arg1);

Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.

The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.

The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.

The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-12 14:05:00 +00:00
Emmanuele Bassi
2674a1ead2 docs: Fixes for Cogl API reference
98% symbol docs coverage.
  335 symbols documented.
  0 symbols incomplete.
  8 not documented.

Not bad, if I may say so.
2010-02-09 14:41:37 +00:00
Damien Lespiau
23717452bf cogl-buffer: Use TEXTURE as the only value for CoglBufferUsageHint
We should try to use more explicit defines than GL for our hints. For
now we only support using a CoglBuffer to generate textures.
2010-02-08 17:14:49 +00:00
Damien Lespiau
40b73a8c0c cogl-buffer: add an abstract class around openGL's buffer objects
Buffer objects are cool! This abstracts the buffer API first introduced
by GL_ARB_vertex_buffer_object and then extended to other objects.

The coglBuffer abstract class is intended to be the base class of all
the buffer objects, letting the user map() buffers. If the underlying
implementation does not support buffer objects (or only support VBO but
not FBO for instance), fallback paths should be provided.
2010-02-08 17:14:49 +00:00