For VBOs, we don't need to check for the extension if the GL version
is greater than 1.5. Non-power-of-two textures are given in 2.0.
We could also assume shader support in GL 2.0 except that the function
names are different from those in the extension so it wouldn't work
well with the current mechanism.
Previously if you need to depend on a new GL feature you had to:
- Add typedefs for all of the functions in cogl-defines.h.in
- Add function pointers for each of the functions in
cogl-context-driver.h
- Add an initializer for the function pointers in
cogl-context-driver.c
- Add a check for the extension and all of the functions in
cogl_features_init. If the extension is available under multiple
names then you have to duplicate the checks.
This is quite tedious and error prone. This patch moves all of the
features and their functions into a list of macro invocations in
cogl-feature-functions.h. The macros can be redefined to implement all
of the above tasks from the same header.
The features are described in a struct with a pointer to a table of
functions. A new function takes the feature description from this
struct and checks for its availability. The feature can take a list of
extension names with a list of alternate namespaces (such as "EXT" or
"ARB"). It can also detect the feature from a particular version of
GL.
The typedefs are now gone and instead the function pointer in the Cogl
context just directly contains the type.
Some of the functions in the context were previously declared with the
'ARB' extension. This has been removed so that now all the functions
have no suffix. This makes more sense when the extension could
potentially be merged into GL core as well.
There is a new internal Cogl function called _cogl_check_driver_valid
which looks at the value of the GL_VERSION string to determine whether
the driver is supported. Clutter now calls this after the stage is
realized. If it fails then the stage is marked as unrealized and a
warning is shown.
_cogl_features_init now also checks the version number before getting
the function pointers for glBlendFuncSeparate and
glBlendEquationSeparate. It is not safe to just check for the presence
of the functions because some drivers may define the function without
fully implementing the spec.
The GLES version of _cogl_check_driver_valid just always returns TRUE
because there are no version requirements yet.
Eventually the function could also check for mandatory extensions if
there were any.
http://bugzilla.openedhand.com/show_bug.cgi?id=1875
We can not process events for a stage that has been destroyed so we
should make sure that the events for the stage are removed from the
global event queue during dispose.
http://bugzilla.openedhand.com/show_bug.cgi?id=1882
Both ClutterAlpha:mode and ClutterAnimation:mode can be defined using:
• an integer id
• the "nick" field of the AnimationMode GEnumValue
• a custom, tweener-like string
All these methods should be documented.
Like in ClutterAlpha, ClutterAnimation:mode must be overridden when
parsing a Script definition, as we accept both a numeric id and the
string id for easing modes.
When _cogl_add_path_to_stencil_buffer is used to draw a path we don't
need to clear the entire stencil buffer. Instead it can clear just the
bounding box of the path. This adds an extra parameter called
'need_clear' which is only set if the stencil buffer is being used for
clipping.
http://bugzilla.openedhand.com/show_bug.cgi?id=1829
These changes caused the test to try to load redhand.png but this no
longer works since the TESTS_DATADIR changes in 0b4899ef23. The only
use of the hand is commented out anyway so it looks like the changes
were intended for temporary debugging.
With this, if one changes the underlying template files, we run
glib-mkenums again to generate updated glib_enum_[ch] files.
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This fixes a warning about an uninitialised value. It could also
potentially fix some crashes for example if the enable_flags value
happened to include a bit for enabling a vertex array if no vertex
buffer pointer was set.
While loading a JPEG from disk (with clutter_texture_new_from_file),
I got the following:
<Error>: CGBitmapContextCreate: unsupported parameter combination: 8
integer bits/component; 24 bits/pixel; 3-component colorspace;
kCGImageAlphaNone; 3072 bytes/row.
<Error>: CGContextDrawImage: invalid context
Looking around, I found that CGBitmapContextCreate can't make 24bpp
offscreen pixmaps without an alpha channel...
This fixes the bug, and seems to not break other things...
http://bugzilla.openedhand.com/show_bug.cgi?id=1159
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* josh-osx-fixes:
osx: Fix a warning on Snow Leopard
docs: Fix OS X docs to install Ports in correct order
osx: Implement the updated ClutterStageWindow interface
Apple where nice and changed API between releases. This patch checks the
version of the compilation environment and tries to use the right parameter
type.
http://bugzilla.openedhand.com/show_bug.cgi?id=1866
The order in which the MacPorts are installed is important otherwise we open
the user up to a world of pain.
This patch also tweaks the OS X docs to follow the formatting of the rest of
the docs and to discuss the option of GtkDoc.
http://bugzilla.openedhand.com/show_bug.cgi?id=1865
In the new Clutter world backend stage implementations should be lightweight
objects implementing the ClutterStageWindow interface and not ClutterActor
subclasses.
This patch performs various cut-n-pastes to acheive that for the OSX backend
http://bugzilla.openedhand.com/show_bug.cgi?id=1864
ClutterBehaviour should implement the Scriptable interface
and parse ClutterAlpha when implicitly defined, instead of
having this ad hoc code inside ClutterScriptParser itself.
After all, only ClutterBehaviour supports Alpha defined
implicitly.
The ClutterScriptParser should do most of the heavy-lifting for
parsing a JSON object member defining another JSON object into
a GObject property defined using a GParamSpecObject.
cogl_clip_push, and cogl_clip_push_window_rect which are now deprecated were
used in various places internally so this just switches to using the
replacement functions.
cogl_clip_push() which accepts a rectangle in model space shouldn't have
been defined to take x,y,width,height arguments because this isn't consistant
with other Cogl API dealing with model space rectangles. If you are using a
coordinate system with the origin at the center and the y+ extending up,
then x,y,width,height isn't as natural as (x0,y0)(x1,y1). This API has
now been replace with cogl_clip_push_rectangle()
(As a general note: the Cogl API should only use the x,y,width,height style
when the appropriate coordinate space is defined by Cogl to have a top left
origin. E.g. window coordinates, or potentially texture coordinates)
cogl_clip_push_window_rect() shouldn't have been defined to take float
arguments since we only clip with integral pixel precision. We also
shouldn't have abbreviated "rectangle". This API has been replaced with
cogl_clip_push_window_rectangle()
cogl_clip_ensure() wasn't documented at all in Clutter 1.0 and probably
no one even knew it existed. This API isn't useful, and so it's now
deprecated. If no one complains we may remove the API altogether for
Clutter 1.2.
cogl_clip_stack_save() and cogl_clip_stack_restore() were originally added
to allow us to save/restore the clip when switching to/from offscreen
rendering. Now that offscreen draw buffers are defined to own their clip
state and the state will be automatically saved and restored this API is now
redundant and so deprecated.
For a long time now the GLES driver for Cogl has supported a fallback
scanline rasterizer for filling paths when no stencil buffer is available,
but now that we build the same cogl-primitives code for GL and GLES I
thought it may sometimes be useful for debugging to force Cogl to use the
scanline rasterizer instead of the current stencil buffer approach.
The build for interactive tests creates symbolic links for the data
under tests/data; it also uses symbolic links for creating "binaries"
for each interactive test. This is less than ideal, though.
Instead, the tests should build a path to the data files by using
a pre-processor define like TESTS_DATADIR; both g_build_filename() and
pre-processor string concatenation can be used to generate a valid
file name with the full path to the files.
The build system should also create wrapper scripts, just like we
do inside the conformance test suite, to be able to launch single
tests.
In order to know if a layout property exists and retrieve its
description in form of a GParamSpec, we need a wrapper API inside
ClutterLayoutManager. This allows introspecting a LayoutManager
sub-class and eventually serialize and deserialize it.