2012-02-17 16:46:39 -05:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
2014-02-21 20:28:54 -05:00
|
|
|
* A Low Level GPU Graphics and Utilities API
|
2012-02-17 16:46:39 -05:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Intel Corporation.
|
|
|
|
*
|
2014-02-21 20:28:54 -05: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:
|
2012-02-17 16:46:39 -05:00
|
|
|
*
|
2014-02-21 20:28:54 -05:00
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
2012-02-17 16:46:39 -05:00
|
|
|
*
|
2014-02-21 20:28:54 -05: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.
|
2012-02-17 16:46:39 -05:00
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Robert Bragg <robert@linux.intel.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-06-20 13:49:08 -04:00
|
|
|
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
|
2012-02-17 16:46:39 -05:00
|
|
|
#error "Only <cogl/cogl.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __COGL_1_CONTEXT_H__
|
|
|
|
#define __COGL_1_CONTEXT_H__
|
|
|
|
|
|
|
|
#include <cogl/cogl-types.h>
|
|
|
|
#include <cogl/cogl-texture.h>
|
|
|
|
#include <cogl/cogl-framebuffer.h>
|
2013-03-22 17:18:53 -04:00
|
|
|
#include <cogl/cogl-macros.h>
|
2012-02-17 16:46:39 -05:00
|
|
|
|
2012-11-22 13:01:10 -05:00
|
|
|
COGL_BEGIN_DECLS
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_option_group:
|
|
|
|
*
|
|
|
|
* Retrieves the #GOptionGroup used by Cogl to parse the command
|
|
|
|
* line options. Clutter uses this to handle the Cogl command line
|
|
|
|
* options during its initialization process.
|
|
|
|
*
|
|
|
|
* Return value: a #GOptionGroup
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Not replaced
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
GOptionGroup *
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_option_group (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/* Misc */
|
|
|
|
/**
|
|
|
|
* cogl_get_features:
|
|
|
|
*
|
|
|
|
* Returns all of the features supported by COGL.
|
|
|
|
*
|
|
|
|
* Return value: A logical OR of all the supported COGL features.
|
|
|
|
*
|
|
|
|
* Since: 0.8
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.10: Use cogl_foreach_feature() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_foreach_feature)
|
2012-02-17 16:46:39 -05:00
|
|
|
CoglFeatureFlags
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_features (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_features_available:
|
|
|
|
* @features: A bitmask of features to check for
|
|
|
|
*
|
|
|
|
* Checks whether the given COGL features are available. Multiple
|
|
|
|
* features can be checked for by or-ing them together with the '|'
|
|
|
|
* operator. %TRUE is only returned if all of the requested features
|
|
|
|
* are available.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the features are available, %FALSE otherwise.
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.10: Use cogl_has_feature() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_has_feature)
|
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 16:56:40 -04:00
|
|
|
CoglBool
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_features_available (CoglFeatureFlags features);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
2016-06-15 15:57:36 -04:00
|
|
|
* cogl_get_proc_address: (skip)
|
2012-02-17 16:46:39 -05:00
|
|
|
* @name: the name of the function.
|
|
|
|
*
|
|
|
|
* Gets a pointer to a given GL or GL ES extension function. This acts
|
|
|
|
* as a wrapper around glXGetProcAddress() or whatever is the
|
|
|
|
* appropriate function for the current backend.
|
|
|
|
*
|
2012-06-20 07:42:31 -04:00
|
|
|
* <note>This function should not be used to query core opengl API
|
|
|
|
* symbols since eglGetProcAddress for example doesn't allow this and
|
|
|
|
* and may return a junk pointer if you do.</note>
|
|
|
|
*
|
2012-02-17 16:46:39 -05:00
|
|
|
* Return value: a pointer to the requested function or %NULL if the
|
|
|
|
* function is not available.
|
|
|
|
*/
|
|
|
|
CoglFuncPtr
|
|
|
|
cogl_get_proc_address (const char *name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_check_extension:
|
|
|
|
* @name: extension to check for
|
|
|
|
* @ext: list of extensions
|
|
|
|
*
|
|
|
|
* Check whether @name occurs in list of extensions in @ext.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the extension occurs in the list, %FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Deprecated: 1.2: OpenGL is an implementation detail for Cogl and so it's
|
|
|
|
* not appropriate to expose OpenGL extensions through the Cogl API. This
|
|
|
|
* function can be replaced by the following equivalent code:
|
|
|
|
* |[
|
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 16:56:40 -04:00
|
|
|
* CoglBool retval = (strstr (ext, name) != NULL) ? TRUE : FALSE;
|
2012-02-17 16:46:39 -05:00
|
|
|
* ]|
|
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED
|
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 16:56:40 -04:00
|
|
|
CoglBool
|
2012-02-17 16:46:39 -05:00
|
|
|
cogl_check_extension (const char *name,
|
2013-07-24 05:44:56 -04:00
|
|
|
const char *ext);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_bitmasks:
|
|
|
|
* @red: (out): Return location for the number of red bits or %NULL
|
|
|
|
* @green: (out): Return location for the number of green bits or %NULL
|
|
|
|
* @blue: (out): Return location for the number of blue bits or %NULL
|
|
|
|
* @alpha: (out): Return location for the number of alpha bits or %NULL
|
|
|
|
*
|
|
|
|
* Gets the number of bitplanes used for each of the color components
|
|
|
|
* in the color buffer. Pass %NULL for any of the arguments if the
|
|
|
|
* value is not required.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.8: Use cogl_framebuffer_get_red/green/blue/alpha_bits()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_get_red_OR_green_OR_blue_OR_alpha_bits)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_get_bitmasks (int *red,
|
|
|
|
int *green,
|
|
|
|
int *blue,
|
2013-07-24 05:44:56 -04:00
|
|
|
int *alpha);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_perspective:
|
|
|
|
* @fovy: Vertical field of view angle in degrees.
|
|
|
|
* @aspect: The (width over height) aspect ratio for display
|
|
|
|
* @z_near: The distance to the near clipping plane (Must be positive)
|
|
|
|
* @z_far: The distance to the far clipping plane (Must be positive)
|
|
|
|
*
|
|
|
|
* Replaces the current projection matrix with a perspective matrix
|
|
|
|
* based on the provided values.
|
|
|
|
*
|
|
|
|
* <note>You should be careful not to have to great a @z_far / @z_near
|
|
|
|
* ratio since that will reduce the effectiveness of depth testing
|
|
|
|
* since there wont be enough precision to identify the depth of
|
|
|
|
* objects near to each other.</note>
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_perspective() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_perspective)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_perspective (float fovy,
|
|
|
|
float aspect,
|
|
|
|
float z_near,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z_far);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_frustum:
|
|
|
|
* @left: X position of the left clipping plane where it
|
|
|
|
* intersects the near clipping plane
|
|
|
|
* @right: X position of the right clipping plane where it
|
|
|
|
* intersects the near clipping plane
|
|
|
|
* @bottom: Y position of the bottom clipping plane where it
|
|
|
|
* intersects the near clipping plane
|
|
|
|
* @top: Y position of the top clipping plane where it intersects
|
|
|
|
* the near clipping plane
|
|
|
|
* @z_near: The distance to the near clipping plane (Must be positive)
|
|
|
|
* @z_far: The distance to the far clipping plane (Must be positive)
|
|
|
|
*
|
|
|
|
* Replaces the current projection matrix with a perspective matrix
|
|
|
|
* for a given viewing frustum defined by 4 side clip planes that
|
|
|
|
* all cross through the origin and 2 near and far clip planes.
|
|
|
|
*
|
|
|
|
* Since: 0.8.2
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_frustum() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_frustum)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_frustum (float left,
|
|
|
|
float right,
|
|
|
|
float bottom,
|
|
|
|
float top,
|
|
|
|
float z_near,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z_far);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_ortho:
|
|
|
|
* @left: The coordinate for the left clipping plane
|
|
|
|
* @right: The coordinate for the right clipping plane
|
|
|
|
* @bottom: The coordinate for the bottom clipping plane
|
|
|
|
* @top: The coordinate for the top clipping plane
|
|
|
|
* @near: The <emphasis>distance</emphasis> to the near clipping
|
|
|
|
* plane (negative if the plane is behind the viewer)
|
|
|
|
* @far: The <emphasis>distance</emphasis> for the far clipping
|
|
|
|
* plane (negative if the plane is behind the viewer)
|
|
|
|
*
|
|
|
|
* Replaces the current projection matrix with an orthographic projection
|
|
|
|
* matrix. See <xref linkend="cogl-ortho-matrix"/> to see how the matrix is
|
|
|
|
* calculated.
|
|
|
|
*
|
|
|
|
* <figure id="cogl-ortho-matrix">
|
|
|
|
* <title></title>
|
|
|
|
* <graphic fileref="cogl_ortho.png" format="PNG"/>
|
|
|
|
* </figure>
|
|
|
|
*
|
|
|
|
* <note>This function copies the arguments from OpenGL's glOrtho() even
|
|
|
|
* though they are unnecessarily confusing due to the z near and z far
|
|
|
|
* arguments actually being a "distance" from the origin, where
|
|
|
|
* negative values are behind the viewer, instead of coordinates for
|
|
|
|
* the z clipping planes which would have been consistent with the
|
|
|
|
* left, right bottom and top arguments.</note>
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_orthographic() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_orthographic)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_ortho (float left,
|
|
|
|
float right,
|
|
|
|
float bottom,
|
|
|
|
float top,
|
|
|
|
float near,
|
2013-07-24 05:44:56 -04:00
|
|
|
float far);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_viewport:
|
|
|
|
* @width: Width of the viewport
|
|
|
|
* @height: Height of the viewport
|
|
|
|
*
|
|
|
|
* Replace the current viewport with the given values.
|
|
|
|
*
|
|
|
|
* Since: 0.8.2
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.8: Use cogl_framebuffer_set_viewport instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_set_viewport)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_viewport (unsigned int width,
|
2013-07-24 05:44:56 -04:00
|
|
|
unsigned int height);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_viewport:
|
|
|
|
* @x: X offset of the viewport
|
|
|
|
* @y: Y offset of the viewport
|
|
|
|
* @width: Width of the viewport
|
|
|
|
* @height: Height of the viewport
|
|
|
|
*
|
|
|
|
* Replaces the current viewport with the given values.
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.8: Use cogl_framebuffer_set_viewport() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_set_viewport)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_set_viewport (int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
2013-07-24 05:44:56 -04:00
|
|
|
int height);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_push_matrix:
|
|
|
|
*
|
|
|
|
* Stores the current model-view matrix on the matrix stack. The matrix
|
|
|
|
* can later be restored with cogl_pop_matrix().
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_push_matrix() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_push_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_push_matrix (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_pop_matrix:
|
|
|
|
*
|
|
|
|
* Restores the current model-view matrix from the matrix stack.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_pop_matrix() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_push_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_pop_matrix (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_scale:
|
|
|
|
* @x: Amount to scale along the x-axis
|
|
|
|
* @y: Amount to scale along the y-axis
|
|
|
|
* @z: Amount to scale along the z-axis
|
|
|
|
*
|
|
|
|
* Multiplies the current model-view matrix by one that scales the x,
|
|
|
|
* y and z axes by the given values.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_pop_matrix() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_scale)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_scale (float x,
|
|
|
|
float y,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_translate:
|
|
|
|
* @x: Distance to translate along the x-axis
|
|
|
|
* @y: Distance to translate along the y-axis
|
|
|
|
* @z: Distance to translate along the z-axis
|
|
|
|
*
|
|
|
|
* Multiplies the current model-view matrix by one that translates the
|
|
|
|
* model along all three axes according to the given values.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_translate() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_translate)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_translate (float x,
|
|
|
|
float y,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_rotate:
|
|
|
|
* @angle: Angle in degrees to rotate.
|
|
|
|
* @x: X-component of vertex to rotate around.
|
|
|
|
* @y: Y-component of vertex to rotate around.
|
|
|
|
* @z: Z-component of vertex to rotate around.
|
|
|
|
*
|
|
|
|
* Multiplies the current model-view matrix by one that rotates the
|
|
|
|
* model around the vertex specified by @x, @y and @z. The rotation
|
|
|
|
* follows the right-hand thumb rule so for example rotating by 10
|
|
|
|
* degrees about the vertex (0, 0, 1) causes a small counter-clockwise
|
|
|
|
* rotation.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_rotate() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_rotate)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_rotate (float angle,
|
|
|
|
float x,
|
|
|
|
float y,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_transform:
|
|
|
|
* @matrix: the matrix to multiply with the current model-view
|
|
|
|
*
|
|
|
|
* Multiplies the current model-view matrix by the given matrix.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_transform() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_transform)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_transform (const CoglMatrix *matrix);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_modelview_matrix:
|
|
|
|
* @matrix: (out): return location for the model-view matrix
|
|
|
|
*
|
|
|
|
* Stores the current model-view matrix in @matrix.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_get_modelview_matrix()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_modelview_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_modelview_matrix (CoglMatrix *matrix);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_modelview_matrix:
|
|
|
|
* @matrix: the new model-view matrix
|
|
|
|
*
|
|
|
|
* Loads @matrix as the new model-view matrix.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_set_modelview_matrix()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_set_modelview_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_modelview_matrix (CoglMatrix *matrix);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_projection_matrix:
|
|
|
|
* @matrix: (out): return location for the projection matrix
|
|
|
|
*
|
|
|
|
* Stores the current projection matrix in @matrix.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_get_projection_matrix()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_projection_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_projection_matrix (CoglMatrix *matrix);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_projection_matrix:
|
|
|
|
* @matrix: the new projection matrix
|
|
|
|
*
|
|
|
|
* Loads matrix as the new projection matrix.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_set_projection_matrix()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_set_projection_matrix)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_projection_matrix (CoglMatrix *matrix);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_viewport:
|
|
|
|
* @v: (out) (array fixed-size=4): pointer to a 4 element array
|
|
|
|
* of #float<!-- -->s to receive the viewport dimensions.
|
|
|
|
*
|
|
|
|
* Stores the current viewport in @v. @v[0] and @v[1] get the x and y
|
|
|
|
* position of the viewport and @v[2] and @v[3] get the width and
|
|
|
|
* height.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.10: Use cogl_framebuffer_get_viewport4fv()
|
|
|
|
* instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_viewport4fv)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_viewport (float v[4]);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_depth_test_enabled:
|
|
|
|
* @setting: %TRUE to enable depth testing or %FALSE to disable.
|
|
|
|
*
|
|
|
|
* Sets whether depth testing is enabled. If it is disabled then the
|
|
|
|
* order that actors are layered on the screen depends solely on the
|
|
|
|
* order specified using clutter_actor_raise() and
|
|
|
|
* clutter_actor_lower(), otherwise it will also take into account the
|
|
|
|
* actor's depth. Depth testing is disabled by default.
|
|
|
|
*
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Use cogl_pipeline_set_depth_state() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_depth_state)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_depth_test_enabled (CoglBool setting);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_depth_test_enabled:
|
|
|
|
*
|
|
|
|
* Queries if depth testing has been enabled via cogl_set_depth_test_enable()
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if depth testing is enabled, and %FALSE otherwise
|
|
|
|
*
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Use cogl_pipeline_set_depth_state() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_depth_state)
|
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 16:56:40 -04:00
|
|
|
CoglBool
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_depth_test_enabled (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_backface_culling_enabled:
|
|
|
|
* @setting: %TRUE to enable backface culling or %FALSE to disable.
|
|
|
|
*
|
|
|
|
* Sets whether textures positioned so that their backface is showing
|
|
|
|
* should be hidden. This can be used to efficiently draw two-sided
|
|
|
|
* textures or fully closed cubes without enabling depth testing. This
|
|
|
|
* only affects calls to the cogl_rectangle* family of functions and
|
|
|
|
* cogl_vertex_buffer_draw*. Backface culling is disabled by default.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.16: Use cogl_pipeline_set_cull_face_mode() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_cull_face_mode)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_backface_culling_enabled (CoglBool setting);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_backface_culling_enabled:
|
|
|
|
*
|
|
|
|
* Queries if backface culling has been enabled via
|
|
|
|
* cogl_set_backface_culling_enabled()
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if backface culling is enabled, and %FALSE otherwise
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.16: Use cogl_pipeline_get_cull_face_mode() instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_cull_face_mode)
|
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 16:56:40 -04:00
|
|
|
CoglBool
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_backface_culling_enabled (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_fog:
|
|
|
|
* @fog_color: The color of the fog
|
|
|
|
* @mode: A #CoglFogMode that determines the equation used to calculate the
|
|
|
|
* fogging blend factor.
|
|
|
|
* @density: Used by %COGL_FOG_MODE_EXPONENTIAL and by
|
|
|
|
* %COGL_FOG_MODE_EXPONENTIAL_SQUARED equations.
|
|
|
|
* @z_near: Position along Z axis where no fogging should be applied
|
|
|
|
* @z_far: Position along Z axis where full fogging should be applied
|
|
|
|
*
|
|
|
|
* Enables fogging. Fogging causes vertices that are further away from the eye
|
|
|
|
* to be rendered with a different color. The color is determined according to
|
|
|
|
* the chosen fog mode; at it's simplest the color is linearly interpolated so
|
|
|
|
* that vertices at @z_near are drawn fully with their original color and
|
|
|
|
* vertices at @z_far are drawn fully with @fog_color. Fogging will remain
|
|
|
|
* enabled until you call cogl_disable_fog().
|
|
|
|
*
|
|
|
|
* <note>The fogging functions only work correctly when primitives use
|
|
|
|
* unmultiplied alpha colors. By default Cogl will premultiply textures
|
|
|
|
* and cogl_set_source_color() will premultiply colors, so unless you
|
|
|
|
* explicitly load your textures requesting an unmultiplied internal format
|
|
|
|
* and use cogl_material_set_color() you can only use fogging with fully
|
|
|
|
* opaque primitives. This might improve in the future when we can depend
|
|
|
|
* on fragment shaders.</note>
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.16: Use #CoglSnippet shader api for fog
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_API)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_set_fog (const CoglColor *fog_color,
|
|
|
|
CoglFogMode mode,
|
|
|
|
float density,
|
|
|
|
float z_near,
|
2013-07-24 05:44:56 -04:00
|
|
|
float z_far);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_disable_fog:
|
|
|
|
*
|
|
|
|
* This function disables fogging, so primitives drawn afterwards will not be
|
|
|
|
* blended with any previously set fog color.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.16: Use #CoglSnippet shader api for fog
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_API)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_disable_fog (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_clear:
|
|
|
|
* @color: Background color to clear to
|
|
|
|
* @buffers: A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary
|
|
|
|
* buffers to clear
|
|
|
|
*
|
|
|
|
* Clears all the auxiliary buffers identified in the @buffers mask, and if
|
|
|
|
* that includes the color buffer then the specified @color is used.
|
2013-03-22 17:18:53 -04:00
|
|
|
*
|
|
|
|
* Deprecated: 1.16: Use cogl_framebuffer_clear() api instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_clear)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_clear (const CoglColor *color,
|
2013-07-24 05:44:56 -04:00
|
|
|
unsigned long buffers);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_source:
|
|
|
|
* @material: A #CoglMaterial
|
|
|
|
*
|
|
|
|
* This function changes the material at the top of the source stack.
|
|
|
|
* The material at the top of this stack defines the GPU state used to
|
|
|
|
* process subsequent primitives, such as rectangles drawn with
|
|
|
|
* cogl_rectangle() or vertices drawn using cogl_vertex_buffer_draw().
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_source (void *material);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_get_source:
|
|
|
|
*
|
|
|
|
* Returns the current source material as previously set using
|
|
|
|
* cogl_set_source().
|
|
|
|
*
|
|
|
|
* <note>You should typically consider the returned material immutable
|
|
|
|
* and not try to change any of its properties unless you own a
|
|
|
|
* reference to that material. At times you may be able to get a
|
|
|
|
* reference to an internally managed materials and the result of
|
|
|
|
* modifying such materials is undefined.</note>
|
|
|
|
*
|
|
|
|
* Return value: The current source material.
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void *
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_get_source (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_push_source:
|
|
|
|
* @material: A #CoglMaterial
|
|
|
|
*
|
|
|
|
* Pushes the given @material to the top of the source stack. The
|
|
|
|
* material at the top of this stack defines the GPU state used to
|
|
|
|
* process later primitives as defined by cogl_set_source().
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_push_source (void *material);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_pop_source:
|
|
|
|
*
|
|
|
|
* Removes the material at the top of the source stack. The material
|
|
|
|
* at the top of this stack defines the GPU state used to process
|
|
|
|
* later primitives as defined by cogl_set_source().
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_pop_source (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_source_color:
|
|
|
|
* @color: a #CoglColor
|
|
|
|
*
|
|
|
|
* This is a convenience function for creating a solid fill source material
|
|
|
|
* from the given color. This color will be used for any subsequent drawing
|
|
|
|
* operation.
|
|
|
|
*
|
|
|
|
* The color will be premultiplied by Cogl, so the color should be
|
|
|
|
* non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for
|
|
|
|
* semi-transparent red.
|
|
|
|
*
|
|
|
|
* See also cogl_set_source_color4ub() and cogl_set_source_color4f()
|
|
|
|
* if you already have the color components.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_source_color (const CoglColor *color);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_source_color4ub:
|
|
|
|
* @red: value of the red channel, between 0 and 255
|
|
|
|
* @green: value of the green channel, between 0 and 255
|
|
|
|
* @blue: value of the blue channel, between 0 and 255
|
|
|
|
* @alpha: value of the alpha channel, between 0 and 255
|
|
|
|
*
|
|
|
|
* This is a convenience function for creating a solid fill source material
|
|
|
|
* from the given color using unsigned bytes for each component. This
|
|
|
|
* color will be used for any subsequent drawing operation.
|
|
|
|
*
|
|
|
|
* The value for each component is an unsigned byte in the range
|
|
|
|
* between 0 and 255.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
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 16:56:40 -04:00
|
|
|
cogl_set_source_color4ub (uint8_t red,
|
|
|
|
uint8_t green,
|
|
|
|
uint8_t blue,
|
2013-07-24 05:44:56 -04:00
|
|
|
uint8_t alpha);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_source_color4f:
|
|
|
|
* @red: value of the red channel, between 0 and %1.0
|
|
|
|
* @green: value of the green channel, between 0 and %1.0
|
|
|
|
* @blue: value of the blue channel, between 0 and %1.0
|
|
|
|
* @alpha: value of the alpha channel, between 0 and %1.0
|
|
|
|
*
|
|
|
|
* This is a convenience function for creating a solid fill source material
|
|
|
|
* from the given color using normalized values for each component. This color
|
|
|
|
* will be used for any subsequent drawing operation.
|
|
|
|
*
|
|
|
|
* The value for each component is a fixed point number in the range
|
|
|
|
* between 0 and %1.0. If the values passed in are outside that
|
|
|
|
* range, they will be clamped.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
|
|
|
cogl_set_source_color4f (float red,
|
|
|
|
float green,
|
|
|
|
float blue,
|
2013-07-24 05:44:56 -04:00
|
|
|
float alpha);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_set_source_texture:
|
|
|
|
* @texture: The #CoglTexture you want as your source
|
|
|
|
*
|
|
|
|
* This is a convenience function for creating a material with the first
|
|
|
|
* layer set to @texture and setting that material as the source with
|
|
|
|
* cogl_set_source.
|
|
|
|
*
|
|
|
|
* Note: There is no interaction between calls to cogl_set_source_color
|
|
|
|
* and cogl_set_source_texture. If you need to blend a texture with a color then
|
|
|
|
* you can create a simple material like this:
|
|
|
|
* <programlisting>
|
|
|
|
* material = cogl_material_new ();
|
|
|
|
* cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80);
|
|
|
|
* cogl_material_set_layer (material, 0, tex_handle);
|
|
|
|
* cogl_set_source (material);
|
|
|
|
* </programlisting>
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Latest drawing apis all take an explicit
|
|
|
|
* #CoglPipeline argument so this stack of
|
|
|
|
* #CoglMaterial<!-- -->s shouldn't be used.
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_set_source_texture (CoglTexture *texture);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_flush:
|
|
|
|
*
|
|
|
|
* This function should only need to be called in exceptional circumstances.
|
|
|
|
*
|
|
|
|
* As an optimization Cogl drawing functions may batch up primitives
|
|
|
|
* internally, so if you are trying to use raw GL outside of Cogl you stand a
|
|
|
|
* better chance of being successful if you ask Cogl to flush any batched
|
|
|
|
* geometry before making your state changes.
|
|
|
|
*
|
|
|
|
* It only ensure that the underlying driver is issued all the commands
|
|
|
|
* necessary to draw the batched primitives. It provides no guarantees about
|
|
|
|
* when the driver will complete the rendering.
|
|
|
|
*
|
|
|
|
* This provides no guarantees about the GL state upon returning and to avoid
|
|
|
|
* confusing Cogl you should aim to restore any changes you make before
|
|
|
|
* resuming use of Cogl.
|
|
|
|
*
|
|
|
|
* If you are making state changes with the intention of affecting Cogl drawing
|
|
|
|
* primitives you are 100% on your own since you stand a good chance of
|
|
|
|
* conflicting with Cogl internals. For example clutter-gst which currently
|
|
|
|
* uses direct GL calls to bind ARBfp programs will very likely break when Cogl
|
|
|
|
* starts to use ARBfb programs itself for the material API.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cogl_flush (void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_begin_gl:
|
|
|
|
*
|
|
|
|
* We do not advise nor reliably support the interleaving of raw GL drawing and
|
|
|
|
* Cogl drawing functions, but if you insist, cogl_begin_gl() and cogl_end_gl()
|
|
|
|
* provide a simple mechanism that may at least give you a fighting chance of
|
|
|
|
* succeeding.
|
|
|
|
*
|
|
|
|
* Note: this doesn't help you modify the behaviour of Cogl drawing functions
|
|
|
|
* through the modification of GL state; that will never be reliably supported,
|
|
|
|
* but if you are trying to do something like:
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* {
|
|
|
|
* - setup some OpenGL state.
|
|
|
|
* - draw using OpenGL (e.g. glDrawArrays() )
|
|
|
|
* - reset modified OpenGL state.
|
|
|
|
* - continue using Cogl to draw
|
|
|
|
* }
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* You should surround blocks of drawing using raw GL with cogl_begin_gl()
|
|
|
|
* and cogl_end_gl():
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* {
|
|
|
|
* cogl_begin_gl ();
|
|
|
|
* - setup some OpenGL state.
|
|
|
|
* - draw using OpenGL (e.g. glDrawArrays() )
|
|
|
|
* - reset modified OpenGL state.
|
|
|
|
* cogl_end_gl ();
|
|
|
|
* - continue using Cogl to draw
|
|
|
|
* }
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* Don't ever try and do:
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* {
|
|
|
|
* - setup some OpenGL state.
|
|
|
|
* - use Cogl to draw
|
|
|
|
* - reset modified OpenGL state.
|
|
|
|
* }
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* When the internals of Cogl evolves, this is very liable to break.
|
|
|
|
*
|
|
|
|
* This function will flush all batched primitives, and subsequently flush
|
|
|
|
* all internal Cogl state to OpenGL as if it were going to draw something
|
|
|
|
* itself.
|
|
|
|
*
|
|
|
|
* The result is that the OpenGL modelview matrix will be setup; the state
|
|
|
|
* corresponding to the current source material will be set up and other world
|
|
|
|
* state such as backface culling, depth and fogging enabledness will be sent
|
|
|
|
* to OpenGL.
|
|
|
|
*
|
|
|
|
* <note>No special material state is flushed, so if you want Cogl to setup a
|
|
|
|
* simplified material state it is your responsibility to set a simple source
|
|
|
|
* material before calling cogl_begin_gl(). E.g. by calling
|
|
|
|
* cogl_set_source_color4ub().</note>
|
|
|
|
*
|
|
|
|
* <note>It is your responsibility to restore any OpenGL state that you modify
|
|
|
|
* to how it was after calling cogl_begin_gl() if you don't do this then the
|
|
|
|
* result of further Cogl calls is undefined.</note>
|
|
|
|
*
|
|
|
|
* <note>You can not nest begin/end blocks.</note>
|
|
|
|
*
|
|
|
|
* Again we would like to stress, we do not advise the use of this API and if
|
|
|
|
* possible we would prefer to improve Cogl than have developers require raw
|
|
|
|
* OpenGL.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Use the #CoglGLES2Context api instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (CoglGLES2Context_API)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_begin_gl (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* cogl_end_gl:
|
|
|
|
*
|
|
|
|
* This is the counterpart to cogl_begin_gl() used to delimit blocks of drawing
|
|
|
|
* code using raw OpenGL. Please refer to cogl_begin_gl() for full details.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
2013-03-22 17:18:53 -04:00
|
|
|
* Deprecated: 1.16: Use the #CoglGLES2Context api instead
|
2012-02-17 16:46:39 -05:00
|
|
|
*/
|
2013-07-24 05:44:56 -04:00
|
|
|
COGL_DEPRECATED_IN_1_16_FOR (CoglGLES2Context_API)
|
2012-02-17 16:46:39 -05:00
|
|
|
void
|
2013-07-24 05:44:56 -04:00
|
|
|
cogl_end_gl (void);
|
2012-02-17 16:46:39 -05:00
|
|
|
|
2012-11-22 13:01:10 -05:00
|
|
|
COGL_END_DECLS
|
2012-02-17 16:46:39 -05:00
|
|
|
|
|
|
|
#endif /* __COGL_1_CONTEXT_H__ */
|