2010-11-05 00:00:25 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* A Low Level GPU Graphics and Utilities API
|
2010-11-05 00:00:25 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Intel Corporation.
|
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person
|
|
|
|
* obtaining a copy of this software and associated documentation
|
|
|
|
* files (the "Software"), to deal in the Software without
|
|
|
|
* restriction, including without limitation the rights to use, copy,
|
|
|
|
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
|
|
* of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2010-11-05 00:00:25 +00:00
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
2010-11-05 00:00:25 +00:00
|
|
|
*
|
2014-02-22 01:28:54 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
|
|
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2010-11-05 00:00:25 +00:00
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Robert Bragg <robert@linux.intel.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-06-20 17:49:08 +00:00
|
|
|
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
|
2010-11-05 00:00:25 +00:00
|
|
|
#error "Only <cogl/cogl.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __COGL_CONTEXT_H__
|
|
|
|
#define __COGL_CONTEXT_H__
|
|
|
|
|
2012-02-17 21:46:39 +00:00
|
|
|
/* We forward declare the CoglContext type here to avoid some circular
|
|
|
|
* dependency issues with the following headers.
|
|
|
|
*/
|
|
|
|
typedef struct _CoglContext CoglContext;
|
|
|
|
|
2011-05-13 07:04:47 +00:00
|
|
|
#include <cogl/cogl-defines.h>
|
2010-11-05 00:00:25 +00:00
|
|
|
#include <cogl/cogl-display.h>
|
2012-02-17 21:46:39 +00:00
|
|
|
#include <cogl/cogl-primitive.h>
|
2011-05-16 15:43:30 +00:00
|
|
|
#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
|
|
|
|
#include <android/native_window.h>
|
|
|
|
#endif
|
2010-11-05 00:00:25 +00:00
|
|
|
|
2012-11-22 18:01:10 +00:00
|
|
|
COGL_BEGIN_DECLS
|
2010-11-05 00:00:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:cogl-context
|
|
|
|
* @short_description: The top level application context.
|
|
|
|
*
|
2011-12-16 15:07:25 +00:00
|
|
|
* A #CoglContext is the top most sandbox of Cogl state for an
|
|
|
|
* application or toolkit. Its main purpose is to act as a sandbox
|
|
|
|
* for the memory management of state objects. Normally an application
|
|
|
|
* will only create a single context since there is no way to share
|
|
|
|
* resources between contexts.
|
|
|
|
*
|
|
|
|
* For those familiar with OpenGL or perhaps Cairo it should be
|
|
|
|
* understood that unlike these APIs a Cogl context isn't a rendering
|
|
|
|
* context as such. In other words Cogl doesn't aim to provide a state
|
|
|
|
* machine style model for configuring rendering parameters. Most
|
|
|
|
* rendering state in Cogl is directly associated with user managed
|
|
|
|
* objects called pipelines and geometry is drawn with a specific
|
|
|
|
* pipeline object to a framebuffer object and those 3 things fully
|
|
|
|
* define the state for drawing. This is an important part of Cogl's
|
|
|
|
* design since it helps you write orthogonal rendering components
|
|
|
|
* that can all access the same GPU without having to worry about
|
|
|
|
* what state other components have left you with.
|
2012-09-10 10:26:17 +00:00
|
|
|
*
|
2012-12-29 20:12:13 +00:00
|
|
|
* <note><para>Cogl does not maintain internal references to the context for
|
2012-09-10 10:26:17 +00:00
|
|
|
* resources that depend on the context so applications. This is to
|
|
|
|
* help applications control the lifetime a context without us needing to
|
|
|
|
* introduce special api to handle the breakup of internal circular
|
|
|
|
* references due to internal resources and caches associated with the
|
|
|
|
* context.
|
|
|
|
*
|
|
|
|
* One a context has been destroyed then all directly or indirectly
|
|
|
|
* dependant resources will be in an inconsistent state and should not
|
|
|
|
* be manipulated or queried in any way.
|
|
|
|
*
|
|
|
|
* For applications that rely on the operating system to clean up
|
|
|
|
* resources this policy shouldn't affect them, but for applications
|
|
|
|
* that need to carefully destroy and re-create Cogl contexts multiple
|
|
|
|
* times throughout their lifetime (such as Android applications) they
|
|
|
|
* should be careful to destroy all context dependant resources, such as
|
|
|
|
* framebuffers or textures etc before unrefing and destroying the
|
2012-12-29 20:12:13 +00:00
|
|
|
* context.</para></note>
|
2010-11-05 00:00:25 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 21:46:39 +00:00
|
|
|
#ifdef COGL_ENABLE_EXPERIMENTAL_API
|
2010-11-05 00:00:25 +00:00
|
|
|
|
|
|
|
#define COGL_CONTEXT(OBJECT) ((CoglContext *)OBJECT)
|
|
|
|
|
2011-12-16 15:07:25 +00:00
|
|
|
/**
|
2013-09-03 19:56:12 +00:00
|
|
|
* cogl_context_new: (constructor)
|
|
|
|
* @display: (allow-none): A #CoglDisplay pointer
|
2012-08-31 18:28:27 +00:00
|
|
|
* @error: A CoglError return location.
|
2011-12-16 15:07:25 +00:00
|
|
|
*
|
|
|
|
* Creates a new #CoglContext which acts as an application sandbox
|
|
|
|
* for any state objects that are allocated.
|
|
|
|
*
|
|
|
|
* Return value: (transfer full): A newly allocated #CoglContext
|
|
|
|
* Since: 1.8
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
2010-11-05 00:00:25 +00:00
|
|
|
CoglContext *
|
2010-11-05 12:28:33 +00:00
|
|
|
cogl_context_new (CoglDisplay *display,
|
2012-08-31 18:28:27 +00:00
|
|
|
CoglError **error);
|
2010-11-05 12:28:33 +00:00
|
|
|
|
2011-12-16 15:07:25 +00:00
|
|
|
/**
|
|
|
|
* cogl_context_get_display:
|
|
|
|
* @context: A #CoglContext pointer
|
|
|
|
*
|
|
|
|
* Retrieves the #CoglDisplay that is internally associated with the
|
|
|
|
* given @context. This will return the same #CoglDisplay that was
|
|
|
|
* passed to cogl_context_new() or if %NULL was passed to
|
|
|
|
* cogl_context_new() then this function returns a pointer to the
|
|
|
|
* display that was automatically setup internally.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): The #CoglDisplay associated with the
|
|
|
|
* given @context.
|
|
|
|
* Since: 1.8
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
2011-08-25 16:39:35 +00:00
|
|
|
CoglDisplay *
|
|
|
|
cogl_context_get_display (CoglContext *context);
|
|
|
|
|
2013-04-16 22:46:03 +00:00
|
|
|
/**
|
|
|
|
* cogl_context_get_renderer:
|
|
|
|
* @context: A #CoglContext pointer
|
|
|
|
*
|
|
|
|
* Retrieves the #CoglRenderer that is internally associated with the
|
|
|
|
* given @context. This will return the same #CoglRenderer that was
|
|
|
|
* passed to cogl_display_new() or if %NULL was passed to
|
|
|
|
* cogl_display_new() or cogl_context_new() then this function returns
|
|
|
|
* a pointer to the renderer that was automatically connected
|
|
|
|
* internally.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): The #CoglRenderer associated with the
|
|
|
|
* given @context.
|
|
|
|
* Since: 1.16
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
CoglRenderer *
|
|
|
|
cogl_context_get_renderer (CoglContext *context);
|
|
|
|
|
2011-05-16 15:43:30 +00:00
|
|
|
#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
|
2011-12-16 15:07:25 +00:00
|
|
|
/**
|
|
|
|
* cogl_android_set_native_window:
|
|
|
|
* @window: A native Android window
|
|
|
|
*
|
|
|
|
* Allows Android applications to inform Cogl of the native window
|
|
|
|
* that they have been given which Cogl can render too. On Android
|
|
|
|
* this API must be used before creating a #CoglRenderer, #CoglDisplay
|
|
|
|
* and #CoglContext.
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
2011-05-16 15:43:30 +00:00
|
|
|
void
|
|
|
|
cogl_android_set_native_window (ANativeWindow *window);
|
|
|
|
#endif
|
|
|
|
|
2012-01-04 16:55:25 +00:00
|
|
|
/**
|
|
|
|
* cogl_is_context:
|
|
|
|
* @object: An object or %NULL
|
|
|
|
*
|
|
|
|
* Gets whether the given object references an existing context object.
|
|
|
|
*
|
2012-04-16 13:14:10 +00:00
|
|
|
* Return value: %TRUE if the @object references a #CoglContext,
|
2012-01-04 16:55:25 +00:00
|
|
|
* %FALSE otherwise
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
* Stability: Unstable
|
|
|
|
*/
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
CoglBool
|
2012-01-04 16:55:25 +00:00
|
|
|
cogl_is_context (void *object);
|
|
|
|
|
2012-02-17 21:46:39 +00:00
|
|
|
#endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
|
|
|
|
|
2012-03-12 17:06:46 +00:00
|
|
|
/* XXX: not guarded by the EXPERIMENTAL_API defines to avoid
|
2012-02-17 21:46:39 +00:00
|
|
|
* upsetting glib-mkenums, but this can still be considered implicitly
|
|
|
|
* experimental since it's only useable with experimental API... */
|
|
|
|
/**
|
|
|
|
* CoglFeatureID:
|
|
|
|
* @COGL_FEATURE_ID_TEXTURE_NPOT_BASIC: The hardware supports non power
|
|
|
|
* of two textures, but you also need to check the
|
|
|
|
* %COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP and %COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT
|
|
|
|
* features to know if the hardware supports npot texture mipmaps
|
|
|
|
* or repeat modes other than
|
2012-12-31 23:26:11 +00:00
|
|
|
* %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE respectively.
|
2012-02-17 21:46:39 +00:00
|
|
|
* @COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP: Mipmapping is supported in
|
|
|
|
* conjuntion with non power of two textures.
|
|
|
|
* @COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT: Repeat modes other than
|
2012-12-31 23:26:11 +00:00
|
|
|
* %COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE are supported by the
|
2012-02-17 21:46:39 +00:00
|
|
|
* hardware.
|
|
|
|
* @COGL_FEATURE_ID_TEXTURE_NPOT: Non power of two textures are supported
|
|
|
|
* by the hardware. This is a equivalent to the
|
|
|
|
* %COGL_FEATURE_ID_TEXTURE_NPOT_BASIC, %COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP
|
|
|
|
* and %COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT features combined.
|
|
|
|
* @COGL_FEATURE_ID_TEXTURE_RECTANGLE: Support for rectangular
|
|
|
|
* textures with non-normalized texture coordinates.
|
2014-01-14 15:52:45 +00:00
|
|
|
* @COGL_FEATURE_ID_TEXTURE_RG: Support for
|
|
|
|
* %COGL_TEXTURE_COMPONENTS_RG as the internal components of a
|
|
|
|
* texture.
|
2012-02-17 21:46:39 +00:00
|
|
|
* @COGL_FEATURE_ID_TEXTURE_3D: 3D texture support
|
|
|
|
* @COGL_FEATURE_ID_OFFSCREEN: Offscreen rendering support
|
|
|
|
* @COGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE: Multisample support for
|
|
|
|
* offscreen framebuffers
|
|
|
|
* @COGL_FEATURE_ID_ONSCREEN_MULTIPLE: Multiple onscreen framebuffers
|
|
|
|
* supported.
|
|
|
|
* @COGL_FEATURE_ID_GLSL: GLSL support
|
|
|
|
* @COGL_FEATURE_ID_ARBFP: ARBFP support
|
|
|
|
* @COGL_FEATURE_ID_UNSIGNED_INT_INDICES: Set if
|
2012-12-31 23:26:11 +00:00
|
|
|
* %COGL_INDICES_TYPE_UNSIGNED_INT is supported in
|
2012-02-17 21:46:39 +00:00
|
|
|
* cogl_indices_new().
|
|
|
|
* @COGL_FEATURE_ID_DEPTH_RANGE: cogl_pipeline_set_depth_range() support
|
|
|
|
* @COGL_FEATURE_ID_POINT_SPRITE: Whether
|
|
|
|
* cogl_pipeline_set_layer_point_sprite_coords_enabled() is supported.
|
2012-11-08 16:56:02 +00:00
|
|
|
* @COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE: Whether cogl_point_size_in
|
|
|
|
* can be used as an attribute to set a per-vertex point size.
|
2012-02-17 21:46:39 +00:00
|
|
|
* @COGL_FEATURE_ID_MAP_BUFFER_FOR_READ: Whether cogl_buffer_map() is
|
|
|
|
* supported with CoglBufferAccess including read support.
|
|
|
|
* @COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE: Whether cogl_buffer_map() is
|
|
|
|
* supported with CoglBufferAccess including write support.
|
|
|
|
* @COGL_FEATURE_ID_MIRRORED_REPEAT: Whether
|
|
|
|
* %COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT is supported.
|
|
|
|
* @COGL_FEATURE_ID_SWAP_BUFFERS_EVENT:
|
|
|
|
* Available if the window system supports reporting an event
|
|
|
|
* for swap buffer completions.
|
2014-03-14 15:06:39 +00:00
|
|
|
* @COGL_FEATURE_ID_BUFFER_AGE: Available if the age of #CoglOnscreen back
|
|
|
|
* buffers are tracked and so cogl_onscreen_get_buffer_age() can be
|
|
|
|
* expected to return age values other than 0.
|
2012-03-06 03:21:30 +00:00
|
|
|
* @COGL_FEATURE_ID_GLES2_CONTEXT: Whether creating new GLES2 contexts is
|
|
|
|
* suported.
|
2012-05-23 17:19:29 +00:00
|
|
|
* @COGL_FEATURE_ID_DEPTH_TEXTURE: Whether #CoglFramebuffer support rendering
|
|
|
|
* the depth buffer to a texture.
|
2012-11-12 16:58:10 +00:00
|
|
|
* @COGL_FEATURE_ID_PRESENTATION_TIME: Whether frame presentation
|
|
|
|
* time stamps will be recorded in #CoglFrameInfo objects.
|
2012-02-17 21:46:39 +00:00
|
|
|
*
|
|
|
|
* All the capabilities that can vary between different GPUs supported
|
|
|
|
* by Cogl. Applications that depend on any of these features should explicitly
|
|
|
|
* check for them using cogl_has_feature() or cogl_has_features().
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
|
|
|
typedef enum _CoglFeatureID
|
|
|
|
{
|
|
|
|
COGL_FEATURE_ID_TEXTURE_NPOT_BASIC = 1,
|
|
|
|
COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP,
|
|
|
|
COGL_FEATURE_ID_TEXTURE_NPOT_REPEAT,
|
|
|
|
COGL_FEATURE_ID_TEXTURE_NPOT,
|
|
|
|
COGL_FEATURE_ID_TEXTURE_RECTANGLE,
|
|
|
|
COGL_FEATURE_ID_TEXTURE_3D,
|
|
|
|
COGL_FEATURE_ID_GLSL,
|
|
|
|
COGL_FEATURE_ID_ARBFP,
|
|
|
|
COGL_FEATURE_ID_OFFSCREEN,
|
|
|
|
COGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE,
|
|
|
|
COGL_FEATURE_ID_ONSCREEN_MULTIPLE,
|
|
|
|
COGL_FEATURE_ID_UNSIGNED_INT_INDICES,
|
|
|
|
COGL_FEATURE_ID_DEPTH_RANGE,
|
|
|
|
COGL_FEATURE_ID_POINT_SPRITE,
|
|
|
|
COGL_FEATURE_ID_MAP_BUFFER_FOR_READ,
|
|
|
|
COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE,
|
|
|
|
COGL_FEATURE_ID_MIRRORED_REPEAT,
|
|
|
|
COGL_FEATURE_ID_SWAP_BUFFERS_EVENT,
|
2012-03-06 03:21:30 +00:00
|
|
|
COGL_FEATURE_ID_GLES2_CONTEXT,
|
2012-05-23 17:19:29 +00:00
|
|
|
COGL_FEATURE_ID_DEPTH_TEXTURE,
|
2012-11-12 16:58:10 +00:00
|
|
|
COGL_FEATURE_ID_PRESENTATION_TIME,
|
2013-01-11 01:13:34 +00:00
|
|
|
COGL_FEATURE_ID_FENCE,
|
2012-11-08 16:56:02 +00:00
|
|
|
COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE,
|
2014-01-14 15:52:45 +00:00
|
|
|
COGL_FEATURE_ID_TEXTURE_RG,
|
2014-03-14 15:06:39 +00:00
|
|
|
COGL_FEATURE_ID_BUFFER_AGE,
|
2012-02-17 21:46:39 +00:00
|
|
|
|
2012-10-08 14:04:33 +00:00
|
|
|
/*< private >*/
|
2012-10-06 00:25:27 +00:00
|
|
|
_COGL_N_FEATURE_IDS /*< skip >*/
|
2012-02-17 21:46:39 +00:00
|
|
|
} CoglFeatureID;
|
|
|
|
|
|
|
|
|
2012-03-12 17:06:46 +00:00
|
|
|
#ifdef COGL_ENABLE_EXPERIMENTAL_API
|
2012-02-17 21:46:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_has_feature:
|
|
|
|
* @context: A #CoglContext pointer
|
|
|
|
* @feature: A #CoglFeatureID
|
|
|
|
*
|
|
|
|
* Checks if a given @feature is currently available
|
|
|
|
*
|
|
|
|
* Cogl does not aim to be a lowest common denominator API, it aims to
|
|
|
|
* expose all the interesting features of GPUs to application which
|
|
|
|
* means applications have some responsibility to explicitly check
|
|
|
|
* that certain features are available before depending on them.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the @feature is currently supported or %FALSE if
|
|
|
|
* not.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
CoglBool
|
2012-02-17 21:46:39 +00:00
|
|
|
cogl_has_feature (CoglContext *context, CoglFeatureID feature);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_has_features:
|
|
|
|
* @context: A #CoglContext pointer
|
|
|
|
* @...: A 0 terminated list of CoglFeatureID<!-- -->s
|
|
|
|
*
|
|
|
|
* Checks if a list of features are all currently available.
|
|
|
|
*
|
|
|
|
* This checks all of the listed features using cogl_has_feature() and
|
|
|
|
* returns %TRUE if all the features are available or %FALSE
|
|
|
|
* otherwise.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if all the features are available, %FALSE
|
|
|
|
* otherwise.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
Switch use of primitive glib types to c99 equivalents
The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.
Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.
Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.
So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.
Instead of gsize we now use size_t
For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
2012-04-16 20:56:40 +00:00
|
|
|
CoglBool
|
2012-02-17 21:46:39 +00:00
|
|
|
cogl_has_features (CoglContext *context, ...);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CoglFeatureCallback:
|
|
|
|
* @feature: A single feature currently supported by Cogl
|
|
|
|
* @user_data: A private pointer passed to cogl_foreach_feature().
|
|
|
|
*
|
|
|
|
* A callback used with cogl_foreach_feature() for enumerating all
|
|
|
|
* context level features supported by Cogl.
|
|
|
|
*
|
|
|
|
* Since: 0.10
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
typedef void (*CoglFeatureCallback) (CoglFeatureID feature, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_foreach_feature:
|
|
|
|
* @context: A #CoglContext pointer
|
2013-09-03 20:59:41 +00:00
|
|
|
* @callback: (scope call): A #CoglFeatureCallback called for each
|
|
|
|
* supported feature
|
|
|
|
* @user_data: (closure): Private data to pass to the callback
|
2012-02-17 21:46:39 +00:00
|
|
|
*
|
|
|
|
* Iterates through all the context level features currently supported
|
|
|
|
* for a given @context and for each feature @callback is called.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_foreach_feature (CoglContext *context,
|
|
|
|
CoglFeatureCallback callback,
|
|
|
|
void *user_data);
|
|
|
|
|
2013-01-28 17:22:57 +00:00
|
|
|
/**
|
|
|
|
* cogl_get_clock_time:
|
|
|
|
* @context: a #CoglContext pointer
|
|
|
|
*
|
|
|
|
* Returns the current time value from Cogl's internal clock. This
|
|
|
|
* clock is used for measuring times such as the presentation time
|
|
|
|
* in a #CoglFrameInfo.
|
|
|
|
*
|
|
|
|
* This method is meant for converting timestamps retrieved from Cogl
|
|
|
|
* to other time systems, and is not meant to be used as a standalone
|
|
|
|
* timing system. For that reason, if this function is called without
|
|
|
|
* having retrieved a valid (non-zero) timestamp from Cogl first, it
|
|
|
|
* may return 0 to indicate that Cogl has no active internal clock.
|
|
|
|
*
|
|
|
|
* Return value: the time value for the Cogl clock, in nanoseconds
|
|
|
|
* from an arbitrary point in time, or 0 if Cogl doesn't have an
|
|
|
|
* active internal clock.
|
|
|
|
* Since: 1.14
|
|
|
|
* Stability: unstable
|
|
|
|
*/
|
|
|
|
int64_t
|
|
|
|
cogl_get_clock_time (CoglContext *context);
|
|
|
|
|
2012-03-12 17:06:46 +00:00
|
|
|
#endif /* COGL_ENABLE_EXPERIMENTAL_API */
|
2012-02-17 21:46:39 +00:00
|
|
|
|
2012-11-22 18:01:10 +00:00
|
|
|
COGL_END_DECLS
|
2010-11-05 00:00:25 +00:00
|
|
|
|
|
|
|
#endif /* __COGL_CONTEXT_H__ */
|
|
|
|
|