Add compiler deprecation warnings

This adds compiler symbol deprecation declarations for old Cogl APIs so
that users can easily see via compiler warning when they are using these
symbols, and also see a hint for what the apis should be replaced with.

So that users of Cogl can manage when to show these warnings this
introduces a scheme borrowed from glib whereby you can declare what
version of the Cogl api you are using:

COGL_VERSION_MIN_REQUIRED can be defined to indicate the oldest Cogl api
that the application wants to use. Cogl will only warn about
deprecations for symbols that were deprecated earlier than this required
version. If this is left undefined then by default Cogl will warn about
all deprecations.

COGL_VERSION_MAX_ALLOWED can be defined to indicate the newest api
that the application uses. If the application uses symbols newer than
this then Cogl will give a warning about that.

This patch removes the need to maintain the COGL_DISABLE_DEPRECATED
guards around deprecated symbols.

This patch fixes a few uses of deprecated symbols in the examples/

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2013-03-22 21:18:53 +00:00
parent b5e57c914b
commit afbb13e1a4
26 changed files with 1021 additions and 278 deletions

View File

@ -53,7 +53,7 @@ typedef PangoCairoFontMap CoglPangoFontMap;
* *
* Return value: (transfer full): the newly created #PangoFontMap * Return value: (transfer full): the newly created #PangoFontMap
* *
* Since: 2.0 * Since: 1.14
*/ */
PangoFontMap * PangoFontMap *
cogl_pango_font_map_new (void); cogl_pango_font_map_new (void);
@ -80,7 +80,7 @@ cogl_pango_font_map_create_context (CoglPangoFontMap *font_map);
* The default value is %96, meaning that a 10 point font will be 13 * The default value is %96, meaning that a 10 point font will be 13
* units high. (10 * 96. / 72. = 13.3). * units high. (10 * 96. / 72. = 13.3).
* *
* Since: 2.0 * Since: 1.14
*/ */
void void
cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map, cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
@ -165,7 +165,7 @@ cogl_pango_font_map_get_renderer (CoglPangoFontMap *font_map);
* @y) within the @framebuffer<!-- -->'s current model-view coordinate * @y) within the @framebuffer<!-- -->'s current model-view coordinate
* space. * space.
* *
* Since: 2.0 * Since: 1.14
*/ */
void void
cogl_pango_show_layout (CoglFramebuffer *framebuffer, cogl_pango_show_layout (CoglFramebuffer *framebuffer,
@ -186,7 +186,7 @@ cogl_pango_show_layout (CoglFramebuffer *framebuffer,
* @y) within the @framebuffer<!-- -->'s current model-view coordinate * @y) within the @framebuffer<!-- -->'s current model-view coordinate
* space. * space.
* *
* Since: 2.0 * Since: 1.14
*/ */
void void
cogl_pango_show_layout_line (CoglFramebuffer *framebuffer, cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
@ -209,19 +209,51 @@ typedef struct _CoglPangoRendererClass CoglPangoRendererClass;
GType cogl_pango_renderer_get_type (void) G_GNUC_CONST; GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
/**
* cogl_pango_render_layout:
* @layout: a #PangoLayout
* @x: X coordinate (in Pango units) to render the layout at
* @y: Y coordinate (in Pango units) to render the layout at
* @color: color to use when rendering the layout
* @flags:
*
* Draws a solidly coloured @layout on the given @framebuffer at (@x,
* @y) within the @framebuffer<!-- -->'s current model-view coordinate
* space.
*
* Since: 1.0
* Deprecated: 1.16: Use cogl_pango_show_layout() instead
*/
void void
cogl_pango_render_layout_subpixel (PangoLayout *layout, cogl_pango_render_layout_subpixel (PangoLayout *layout,
int x, int x,
int y, int y,
const CoglColor *color, const CoglColor *color,
int flags); int flags)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pango_show_layout);
/**
* cogl_pango_render_layout:
* @layout: a #PangoLayout
* @x: X coordinate to render the layout at
* @y: Y coordinate to render the layout at
* @color: color to use when rendering the layout
* @flags:
*
* Draws a solidly coloured @layout on the given @framebuffer at (@x,
* @y) within the @framebuffer<!-- -->'s current model-view coordinate
* space.
*
* Since: 1.0
* Deprecated: 1.16: Use cogl_pango_show_layout() instead
*/
void void
cogl_pango_render_layout (PangoLayout *layout, cogl_pango_render_layout (PangoLayout *layout,
int x, int x,
int y, int y,
const CoglColor *color, const CoglColor *color,
int flags); int flags)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pango_show_layout);
/** /**
* cogl_pango_render_layout_line: * cogl_pango_render_layout_line:
@ -233,12 +265,14 @@ cogl_pango_render_layout (PangoLayout *layout,
* Renders @line at the given coordinates using the given color. * Renders @line at the given coordinates using the given color.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pango_show_layout() instead
*/ */
void void
cogl_pango_render_layout_line (PangoLayoutLine *line, cogl_pango_render_layout_line (PangoLayoutLine *line,
int x, int x,
int y, int y,
const CoglColor *color); const CoglColor *color)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pango_show_layout_line);
COGL_END_DECLS COGL_END_DECLS

View File

@ -132,6 +132,7 @@ cogl_experimental_h = \
$(srcdir)/cogl-pixel-buffer.h \ $(srcdir)/cogl-pixel-buffer.h \
$(srcdir)/cogl2-experimental.h \ $(srcdir)/cogl2-experimental.h \
$(srcdir)/cogl2-compatibility.h \ $(srcdir)/cogl2-compatibility.h \
$(srcdir)/cogl-macros.h \
$(srcdir)/cogl-version.h \ $(srcdir)/cogl-version.h \
$(srcdir)/cogl-error.h \ $(srcdir)/cogl-error.h \
$(NULL) $(NULL)

View File

@ -32,11 +32,13 @@ COGL_BEGIN_DECLS
#define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER #define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
CoglBool CoglBool
cogl_clutter_check_extension (const char *name, const char *ext); cogl_clutter_check_extension (const char *name, const char *ext)
COGL_DEPRECATED_IN_1_16;
#define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER #define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER
CoglBool CoglBool
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature); cogl_clutter_winsys_has_feature (CoglWinsysFeature feature)
COGL_DEPRECATED_FOR (cogl_has_feature);
#define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER #define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER
void void

View File

@ -39,6 +39,7 @@
#define __COGL_COLOR_H__ #define __COGL_COLOR_H__
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -117,7 +118,8 @@ cogl_color_set_from_4ub (CoglColor *color,
uint8_t red, uint8_t red,
uint8_t green, uint8_t green,
uint8_t blue, uint8_t blue,
uint8_t alpha); uint8_t alpha)
COGL_DEPRECATED_IN_1_4_FOR (cogl_color_init_from_4ub);
/** /**
* cogl_color_init_from_4f: * cogl_color_init_from_4f:
@ -156,7 +158,8 @@ cogl_color_set_from_4f (CoglColor *color,
float red, float red,
float green, float green,
float blue, float blue,
float alpha); float alpha)
COGL_DEPRECATED_IN_1_4_FOR (cogl_color_init_from_4f);
/** /**
* cogl_color_init_from_4fv: * cogl_color_init_from_4fv:

253
cogl/cogl-macros.h Normal file
View File

@ -0,0 +1,253 @@
/*
* Cogl.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2012 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
#error "Only <cogl/cogl.h> can be included directly."
#endif
#ifndef __COGL_MACROS_H__
#define __COGL_MACROS_H__
#include <cogl/cogl-version.h>
/* These macros are used to mark deprecated functions, and thus have
* to be exposed in a public header.
*
* They are only intended for internal use and should not be used by
* other projects.
*/
#ifdef COGL_DISABLE_DEPRECATION_WARNINGS
#define COGL_DEPRECATED
#define COGL_DEPRECATED_FOR(f)
#define COGL_UNAVAILABLE(maj,min)
#else /* COGL_DISABLE_DEPRECATION_WARNINGS */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define COGL_DEPRECATED __attribute__((__deprecated__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
#define COGL_DEPRECATED __declspec(deprecated)
#else
#define COGL_DEPRECATED
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define COGL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
#define COGL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
#else
#define COGL_DEPRECATED_FOR(f) G_DEPRECATED
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define COGL_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min)))
#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
#define COGL_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min))
#else
#define COGL_UNAVAILABLE(maj,min)
#endif
#endif /* COGL_DISABLE_DEPRECATION_WARNINGS */
/**
* COGL_VERSION_MIN_REQUIRED:
*
* A macro that should be defined by the user prior to including the
* cogl.h header.
*
* The definition should be one of the predefined Cogl version macros,
* such as: %COGL_VERSION_1_8, %COGL_VERSION_1_10, ...
*
* This macro defines the lower bound for the Cogl API to be used.
*
* If a function has been deprecated in a newer version of Cogl, it
* is possible to use this symbol to avoid the compiler warnings without
* disabling warnings for every deprecated function.
*
* Since: 1.16
*/
#ifndef COGL_VERSION_MIN_REQUIRED
# define COGL_VERSION_MIN_REQUIRED (COGL_VERSION_CURRENT_STABLE)
#endif
/**
* COGL_VERSION_MAX_ALLOWED:
*
* A macro that should be define by the user prior to including the
* cogl.h header.
*
* The definition should be one of the predefined Cogl version macros,
* such as: %COGL_VERSION_1_0, %COGL_VERSION_1_2, ...
*
* This macro defines the upper bound for the Cogl API to be used.
*
* If a function has been introduced in a newer version of Cogl, it
* is possible to use this symbol to get compiler warnings when trying
* to use that function.
*
* Since: 1.16
*/
#ifndef COGL_VERSION_MAX_ALLOWED
# if COGL_VERSION_MIN_REQUIRED > COGL_VERSION_PREVIOUS_STABLE
# define COGL_VERSION_MAX_ALLOWED COGL_VERSION_MIN_REQUIRED
# else
# define COGL_VERSION_MAX_ALLOWED COGL_VERSION_CURRENT_STABLE
# endif
#endif
/* sanity checks */
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_MIN_REQUIRED
# error "COGL_VERSION_MAX_ALLOWED must be >= COGL_VERSION_MIN_REQUIRED"
#endif
#if COGL_VERSION_MIN_REQUIRED < COGL_VERSION_1_0
# error "COGL_VERSION_MIN_REQUIRED must be >= COGL_VERSION_1_0"
#endif
/* XXX: Every new stable minor release should add a set of macros here */
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_0
# define COGL_DEPRECATED_IN_1_0 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_0_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_0
# define COGL_DEPRECATED_IN_1_0_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_0
# define COGL_AVAILABLE_IN_1_0 COGL_UNAVAILABLE(1, 0)
#else
# define COGL_AVAILABLE_IN_1_0
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_2
# define COGL_DEPRECATED_IN_1_2 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_2_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_2
# define COGL_DEPRECATED_IN_1_2_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_2
# define COGL_AVAILABLE_IN_1_2 COGL_UNAVAILABLE(1, 2)
#else
# define COGL_AVAILABLE_IN_1_2
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_4
# define COGL_DEPRECATED_IN_1_4 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_4_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_4
# define COGL_DEPRECATED_IN_1_4_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_4
# define COGL_AVAILABLE_IN_1_4 COGL_UNAVAILABLE(1, 4)
#else
# define COGL_AVAILABLE_IN_1_4
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_6
# define COGL_DEPRECATED_IN_1_6 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_6_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_6
# define COGL_DEPRECATED_IN_1_6_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_6
# define COGL_AVAILABLE_IN_1_6 COGL_UNAVAILABLE(1, 6)
#else
# define COGL_AVAILABLE_IN_1_6
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_8
# define COGL_DEPRECATED_IN_1_8 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_8_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_8
# define COGL_DEPRECATED_IN_1_8_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_8
# define COGL_AVAILABLE_IN_1_8 COGL_UNAVAILABLE(1, 8)
#else
# define COGL_AVAILABLE_IN_1_8
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_10
# define COGL_DEPRECATED_IN_1_10 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_10_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_10
# define COGL_DEPRECATED_IN_1_10_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_10
# define COGL_AVAILABLE_IN_1_10 COGL_UNAVAILABLE(1, 10)
#else
# define COGL_AVAILABLE_IN_1_10
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_12
# define COGL_DEPRECATED_IN_1_12 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_12_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_12
# define COGL_DEPRECATED_IN_1_12_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_12
# define COGL_AVAILABLE_IN_1_12 COGL_UNAVAILABLE(1, 12)
#else
# define COGL_AVAILABLE_IN_1_12
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_14
# define COGL_DEPRECATED_IN_1_14 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_14_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_14
# define COGL_DEPRECATED_IN_1_14_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_14
# define COGL_AVAILABLE_IN_1_14 COGL_UNAVAILABLE(1, 14)
#else
# define COGL_AVAILABLE_IN_1_14
#endif
#if COGL_VERSION_MIN_REQUIRED >= COGL_VERSION_1_16
# define COGL_DEPRECATED_IN_1_16 COGL_DEPRECATED
# define COGL_DEPRECATED_IN_1_16_FOR(f) COGL_DEPRECATED_FOR(f)
#else
# define COGL_DEPRECATED_IN_1_16
# define COGL_DEPRECATED_IN_1_16_FOR(f)
#endif
#if COGL_VERSION_MAX_ALLOWED < COGL_VERSION_1_16
# define COGL_AVAILABLE_IN_1_16 COGL_UNAVAILABLE(1, 16)
#else
# define COGL_AVAILABLE_IN_1_16
#endif
#endif /* __COGL_MACROS_H__ */

View File

@ -32,6 +32,7 @@
#include <cogl/cogl-matrix.h> #include <cogl/cogl-matrix.h>
#include <cogl/cogl-depth-state.h> #include <cogl/cogl-depth-state.h>
#include <cogl/cogl-error.h> #include <cogl/cogl-error.h>
#include <cogl/cogl-macros.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -134,9 +135,10 @@ typedef enum {
* Allocates and initializes a blank white material * Allocates and initializes a blank white material
* *
* Return value: a pointer to a new #CoglMaterial * Return value: a pointer to a new #CoglMaterial
* Deprecated: 1.16: Use cogl_pipeline_new() instead
*/ */
CoglMaterial * CoglMaterial *
cogl_material_new (void); cogl_material_new (void) COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_new);
/** /**
* cogl_material_copy: * cogl_material_copy:
@ -154,11 +156,11 @@ cogl_material_new (void);
* Returns: a pointer to the newly allocated #CoglMaterial * Returns: a pointer to the newly allocated #CoglMaterial
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: Use cogl_pipeline_copy() instead
*/ */
CoglMaterial * CoglMaterial *
cogl_material_copy (CoglMaterial *source); cogl_material_copy (CoglMaterial *source)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_copy);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_material_ref: * cogl_material_ref:
@ -173,7 +175,7 @@ cogl_material_copy (CoglMaterial *source);
* Deprecated: 1.2: Use cogl_object_ref() instead * Deprecated: 1.2: Use cogl_object_ref() instead
*/ */
CoglHandle CoglHandle
cogl_material_ref (CoglHandle material) G_GNUC_DEPRECATED; cogl_material_ref (CoglHandle material) COGL_DEPRECATED;
/** /**
* cogl_material_unref: * cogl_material_unref:
@ -186,9 +188,7 @@ cogl_material_ref (CoglHandle material) G_GNUC_DEPRECATED;
* Deprecated: 1.2: Use cogl_object_unref() instead * Deprecated: 1.2: Use cogl_object_unref() instead
*/ */
void void
cogl_material_unref (CoglHandle material) G_GNUC_DEPRECATED; cogl_material_unref (CoglHandle material) COGL_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_is_material: * cogl_is_material:
@ -198,9 +198,11 @@ cogl_material_unref (CoglHandle material) G_GNUC_DEPRECATED;
* *
* Return value: %TRUE if the handle references a #CoglMaterial, * Return value: %TRUE if the handle references a #CoglMaterial,
* %FALSE otherwise * %FALSE otherwise
* Deprecated: 1.16: Use cogl_is_pipeline() instead
*/ */
CoglBool CoglBool
cogl_is_material (CoglHandle handle); cogl_is_material (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_is_pipeline);
/** /**
* cogl_material_set_color: * cogl_material_set_color:
@ -217,10 +219,12 @@ cogl_is_material (CoglHandle handle);
* The default value is (1.0, 1.0, 1.0, 1.0) * The default value is (1.0, 1.0, 1.0, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_color() instead
*/ */
void void
cogl_material_set_color (CoglMaterial *material, cogl_material_set_color (CoglMaterial *material,
const CoglColor *color); const CoglColor *color)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_color);
/** /**
* cogl_material_set_color4ub: * cogl_material_set_color4ub:
@ -235,13 +239,15 @@ cogl_material_set_color (CoglMaterial *material,
* The default value is (0xff, 0xff, 0xff, 0xff) * The default value is (0xff, 0xff, 0xff, 0xff)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_color4ub() instead
*/ */
void void
cogl_material_set_color4ub (CoglMaterial *material, cogl_material_set_color4ub (CoglMaterial *material,
uint8_t red, uint8_t red,
uint8_t green, uint8_t green,
uint8_t blue, uint8_t blue,
uint8_t alpha); uint8_t alpha)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_color4ub);
/** /**
* cogl_material_set_color4f: * cogl_material_set_color4f:
@ -256,13 +262,15 @@ cogl_material_set_color4ub (CoglMaterial *material,
* The default value is (1.0, 1.0, 1.0, 1.0) * The default value is (1.0, 1.0, 1.0, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_color4f() instead
*/ */
void void
cogl_material_set_color4f (CoglMaterial *material, cogl_material_set_color4f (CoglMaterial *material,
float red, float red,
float green, float green,
float blue, float blue,
float alpha); float alpha)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_color4f);
/** /**
* cogl_material_get_color: * cogl_material_get_color:
@ -272,10 +280,12 @@ cogl_material_set_color4f (CoglMaterial *material,
* Retrieves the current material color. * Retrieves the current material color.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_get_color() instead
*/ */
void void
cogl_material_get_color (CoglMaterial *material, cogl_material_get_color (CoglMaterial *material,
CoglColor *color); CoglColor *color)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_color);
/** /**
* cogl_material_set_ambient: * cogl_material_set_ambient:
@ -292,10 +302,12 @@ cogl_material_get_color (CoglMaterial *material,
* The default value is (0.2, 0.2, 0.2, 1.0) * The default value is (0.2, 0.2, 0.2, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_ambient (CoglMaterial *material, cogl_material_set_ambient (CoglMaterial *material,
const CoglColor *ambient); const CoglColor *ambient)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_get_ambient: * cogl_material_get_ambient:
@ -305,10 +317,12 @@ cogl_material_set_ambient (CoglMaterial *material,
* Retrieves the current ambient color for @material * Retrieves the current ambient color for @material
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_get_ambient (CoglMaterial *material, cogl_material_get_ambient (CoglMaterial *material,
CoglColor *ambient); CoglColor *ambient)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_diffuse: * cogl_material_set_diffuse:
@ -322,10 +336,12 @@ cogl_material_get_ambient (CoglMaterial *material,
* The default value is (0.8, 0.8, 0.8, 1.0) * The default value is (0.8, 0.8, 0.8, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_diffuse (CoglMaterial *material, cogl_material_set_diffuse (CoglMaterial *material,
const CoglColor *diffuse); const CoglColor *diffuse)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_get_diffuse: * cogl_material_get_diffuse:
@ -335,10 +351,12 @@ cogl_material_set_diffuse (CoglMaterial *material,
* Retrieves the current diffuse color for @material * Retrieves the current diffuse color for @material
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_get_diffuse (CoglMaterial *material, cogl_material_get_diffuse (CoglMaterial *material,
CoglColor *diffuse); CoglColor *diffuse)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_ambient_and_diffuse: * cogl_material_set_ambient_and_diffuse:
@ -353,10 +371,12 @@ cogl_material_get_diffuse (CoglMaterial *material,
* The default diffuse color is (0.8, 0.8, 0.8, 1.0) * The default diffuse color is (0.8, 0.8, 0.8, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_ambient_and_diffuse (CoglMaterial *material, cogl_material_set_ambient_and_diffuse (CoglMaterial *material,
const CoglColor *color); const CoglColor *color)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_specular: * cogl_material_set_specular:
@ -370,10 +390,12 @@ cogl_material_set_ambient_and_diffuse (CoglMaterial *material,
* The default value is (0.0, 0.0, 0.0, 1.0) * The default value is (0.0, 0.0, 0.0, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_specular (CoglMaterial *material, cogl_material_set_specular (CoglMaterial *material,
const CoglColor *specular); const CoglColor *specular)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_get_specular: * cogl_material_get_specular:
@ -383,10 +405,12 @@ cogl_material_set_specular (CoglMaterial *material,
* Retrieves the materials current specular color. * Retrieves the materials current specular color.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_get_specular (CoglMaterial *material, cogl_material_get_specular (CoglMaterial *material,
CoglColor *specular); CoglColor *specular)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_shininess: * cogl_material_set_shininess:
@ -401,10 +425,12 @@ cogl_material_get_specular (CoglMaterial *material,
* The default value is 0.0 * The default value is 0.0
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_shininess (CoglMaterial *material, cogl_material_set_shininess (CoglMaterial *material,
float shininess); float shininess)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_get_shininess: * cogl_material_get_shininess:
@ -415,9 +441,11 @@ cogl_material_set_shininess (CoglMaterial *material,
* Return value: The materials current shininess value * Return value: The materials current shininess value
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
float float
cogl_material_get_shininess (CoglMaterial *material); cogl_material_get_shininess (CoglMaterial *material)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_emission: * cogl_material_set_emission:
@ -431,10 +459,12 @@ cogl_material_get_shininess (CoglMaterial *material);
* The default value is (0.0, 0.0, 0.0, 1.0) * The default value is (0.0, 0.0, 0.0, 1.0)
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_set_emission (CoglMaterial *material, cogl_material_set_emission (CoglMaterial *material,
const CoglColor *emission); const CoglColor *emission)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_get_emission: * cogl_material_get_emission:
@ -444,10 +474,12 @@ cogl_material_set_emission (CoglMaterial *material,
* Retrieves the materials current emission color. * Retrieves the materials current emission color.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglSnippet shader api for lighting
*/ */
void void
cogl_material_get_emission (CoglMaterial *material, cogl_material_get_emission (CoglMaterial *material,
CoglColor *emission); CoglColor *emission)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* CoglMaterialAlphaFunc: * CoglMaterialAlphaFunc:
@ -498,11 +530,13 @@ typedef enum {
* The default is %COGL_MATERIAL_ALPHA_FUNC_ALWAYS * The default is %COGL_MATERIAL_ALPHA_FUNC_ALWAYS
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_alpha_test_function() instead
*/ */
void void
cogl_material_set_alpha_test_function (CoglMaterial *material, cogl_material_set_alpha_test_function (CoglMaterial *material,
CoglMaterialAlphaFunc alpha_func, CoglMaterialAlphaFunc alpha_func,
float alpha_reference); float alpha_reference)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_alpha_test_function);
/** /**
* cogl_material_set_blend: * cogl_material_set_blend:
@ -587,11 +621,13 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
* present). * present).
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_blend() instead
*/ */
CoglBool CoglBool
cogl_material_set_blend (CoglMaterial *material, cogl_material_set_blend (CoglMaterial *material,
const char *blend_string, const char *blend_string,
CoglError **error); CoglError **error)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_blend);
/** /**
* cogl_material_set_blend_constant: * cogl_material_set_blend_constant:
@ -602,10 +638,12 @@ cogl_material_set_blend (CoglMaterial *material,
* blending will depend on the constant set with this function. * blending will depend on the constant set with this function.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_blend_constant() instead
*/ */
void void
cogl_material_set_blend_constant (CoglMaterial *material, cogl_material_set_blend_constant (CoglMaterial *material,
const CoglColor *constant_color); const CoglColor *constant_color)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_blend_constant);
/** /**
* cogl_material_set_point_size: * cogl_material_set_point_size:
@ -621,10 +659,12 @@ cogl_material_set_blend_constant (CoglMaterial *material,
* transformations. The default point size is 1.0. * transformations. The default point size is 1.0.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_point_size() instead
*/ */
void void
cogl_material_set_point_size (CoglMaterial *material, cogl_material_set_point_size (CoglMaterial *material,
float point_size); float point_size)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_point_size);
/** /**
* cogl_material_get_point_size: * cogl_material_get_point_size:
@ -636,9 +676,11 @@ cogl_material_set_point_size (CoglMaterial *material,
* Return value: the point size of the material. * Return value: the point size of the material.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_get_point_size() instead
*/ */
float float
cogl_material_get_point_size (CoglMaterial *material); cogl_material_get_point_size (CoglMaterial *material)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_point_size);
/** /**
* cogl_material_get_user_program: * cogl_material_get_user_program:
@ -651,9 +693,11 @@ cogl_material_get_point_size (CoglMaterial *material);
* or %COGL_INVALID_HANDLE. * or %COGL_INVALID_HANDLE.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead instead
*/ */
CoglHandle CoglHandle
cogl_material_get_user_program (CoglMaterial *material); cogl_material_get_user_program (CoglMaterial *material)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_user_program: * cogl_material_set_user_program:
@ -700,10 +744,12 @@ cogl_material_get_user_program (CoglMaterial *material);
* using the cogl_program or cogl_shader API. * using the cogl_program or cogl_shader API.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead instead
*/ */
void void
cogl_material_set_user_program (CoglMaterial *material, cogl_material_set_user_program (CoglMaterial *material,
CoglHandle program); CoglHandle program)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_material_set_layer: * cogl_material_set_layer:
@ -723,11 +769,13 @@ cogl_material_set_user_program (CoglMaterial *material,
* as purely GLSL based layers.</note> * as purely GLSL based layers.</note>
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_layer() instead
*/ */
void void
cogl_material_set_layer (CoglMaterial *material, cogl_material_set_layer (CoglMaterial *material,
int layer_index, int layer_index,
CoglHandle texture); CoglHandle texture)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer);
/** /**
* cogl_material_remove_layer: * cogl_material_remove_layer:
@ -735,10 +783,12 @@ cogl_material_set_layer (CoglMaterial *material,
* @layer_index: Specifies the layer you want to remove * @layer_index: Specifies the layer you want to remove
* *
* This function removes a layer from your material * This function removes a layer from your material
* Deprecated: 1.16: Use cogl_pipeline_remove_layer() instead
*/ */
void void
cogl_material_remove_layer (CoglMaterial *material, cogl_material_remove_layer (CoglMaterial *material,
int layer_index); int layer_index)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_remove_layer);
/** /**
@ -832,12 +882,14 @@ cogl_material_remove_layer (CoglMaterial *material,
* or hardware. On failure, %FALSE is returned and @error is set * or hardware. On failure, %FALSE is returned and @error is set
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_layer_combine() instead
*/ */
CoglBool CoglBool
cogl_material_set_layer_combine (CoglMaterial *material, cogl_material_set_layer_combine (CoglMaterial *material,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
CoglError **error); CoglError **error)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_combine);
/** /**
* cogl_material_set_layer_combine_constant: * cogl_material_set_layer_combine_constant:
@ -850,11 +902,14 @@ cogl_material_set_layer_combine (CoglMaterial *material,
* description then you can use this function to define its value. * description then you can use this function to define its value.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_set_layer_combine_constant()
* instead
*/ */
void void
cogl_material_set_layer_combine_constant (CoglMaterial *material, cogl_material_set_layer_combine_constant (CoglMaterial *material,
int layer_index, int layer_index,
const CoglColor *constant); const CoglColor *constant)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_combine_constant);
/** /**
* cogl_material_set_layer_matrix: * cogl_material_set_layer_matrix:
@ -864,11 +919,13 @@ cogl_material_set_layer_combine_constant (CoglMaterial *material,
* *
* This function lets you set a matrix that can be used to e.g. translate * This function lets you set a matrix that can be used to e.g. translate
* and rotate a single layer of a material used to fill your geometry. * and rotate a single layer of a material used to fill your geometry.
* Deprecated: 1.16: Use cogl_pipeline_set_layer_matrix() instead
*/ */
void void
cogl_material_set_layer_matrix (CoglMaterial *material, cogl_material_set_layer_matrix (CoglMaterial *material,
int layer_index, int layer_index,
const CoglMatrix *matrix); const CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_matrix);
/** /**
* cogl_material_get_layers: * cogl_material_get_layers:
@ -890,9 +947,11 @@ cogl_material_set_layer_matrix (CoglMaterial *material,
* list of #CoglMaterialLayer<!-- -->'s that can be passed to the * list of #CoglMaterialLayer<!-- -->'s that can be passed to the
* cogl_material_layer_* functions. The list is owned by Cogl and it * cogl_material_layer_* functions. The list is owned by Cogl and it
* should not be modified or freed * should not be modified or freed
* Deprecated: 1.16: Use cogl_pipeline_get_layers() instead
*/ */
const GList * const GList *
cogl_material_get_layers (CoglMaterial *material); cogl_material_get_layers (CoglMaterial *material)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_layers);
/** /**
* cogl_material_get_n_layers: * cogl_material_get_n_layers:
@ -903,9 +962,11 @@ cogl_material_get_layers (CoglMaterial *material);
* Return value: the number of layers * Return value: the number of layers
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_pipeline_get_n_layers() instead
*/ */
int int
cogl_material_get_n_layers (CoglMaterial *material); cogl_material_get_n_layers (CoglMaterial *material)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_n_layers);
/** /**
* CoglMaterialLayerType: * CoglMaterialLayerType:
@ -934,9 +995,11 @@ typedef enum {
* first. * first.
* *
* Return value: the type of the layer * Return value: the type of the layer
* Deprecated: 1.16: No replacement
*/ */
CoglMaterialLayerType CoglMaterialLayerType
cogl_material_layer_get_type (CoglMaterialLayer *layer); cogl_material_layer_get_type (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_material_layer_get_texture: * cogl_material_layer_get_texture:
@ -951,9 +1014,11 @@ cogl_material_layer_get_type (CoglMaterialLayer *layer);
* type %COGL_MATERIAL_LAYER_TYPE_TEXTURE before calling this function.</note> * type %COGL_MATERIAL_LAYER_TYPE_TEXTURE before calling this function.</note>
* *
* Return value: (transfer none): a #CoglHandle for the texture inside the layer * Return value: (transfer none): a #CoglHandle for the texture inside the layer
* Deprecated: 1.16: No replacement
*/ */
CoglHandle CoglHandle
cogl_material_layer_get_texture (CoglMaterialLayer *layer); cogl_material_layer_get_texture (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_material_layer_get_min_filter: * cogl_material_layer_get_min_filter:
@ -962,9 +1027,11 @@ cogl_material_layer_get_texture (CoglMaterialLayer *layer);
* Queries the currently set downscaling filter for a material layer * Queries the currently set downscaling filter for a material layer
* *
* Return value: the current downscaling filter * Return value: the current downscaling filter
* Deprecated: 1.16: No replacement
*/ */
CoglMaterialFilter CoglMaterialFilter
cogl_material_layer_get_min_filter (CoglMaterialLayer *layer); cogl_material_layer_get_min_filter (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_material_layer_get_mag_filter: * cogl_material_layer_get_mag_filter:
@ -973,9 +1040,11 @@ cogl_material_layer_get_min_filter (CoglMaterialLayer *layer);
* Queries the currently set downscaling filter for a material later * Queries the currently set downscaling filter for a material later
* *
* Return value: the current downscaling filter * Return value: the current downscaling filter
* Deprecated: 1.16: No replacement
*/ */
CoglMaterialFilter CoglMaterialFilter
cogl_material_layer_get_mag_filter (CoglMaterialLayer *layer); cogl_material_layer_get_mag_filter (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_material_set_layer_filters: * cogl_material_set_layer_filters:
@ -986,12 +1055,14 @@ cogl_material_layer_get_mag_filter (CoglMaterialLayer *layer);
* *
* Changes the decimation and interpolation filters used when a texture is * Changes the decimation and interpolation filters used when a texture is
* drawn at other scales than 100%. * drawn at other scales than 100%.
* Deprecated: 1.16: Use cogl_pipeline_set_layer_filters() instead
*/ */
void void
cogl_material_set_layer_filters (CoglMaterial *material, cogl_material_set_layer_filters (CoglMaterial *material,
int layer_index, int layer_index,
CoglMaterialFilter min_filter, CoglMaterialFilter min_filter,
CoglMaterialFilter mag_filter); CoglMaterialFilter mag_filter)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_filters);
/** /**
* cogl_material_set_layer_point_sprite_coords_enabled: * cogl_material_set_layer_point_sprite_coords_enabled:
@ -1013,12 +1084,15 @@ cogl_material_set_layer_filters (CoglMaterial *material,
* *
* Return value: %TRUE if the function succeeds, %FALSE otherwise. * Return value: %TRUE if the function succeeds, %FALSE otherwise.
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_layer_point_sprite_coords_enabled()
* instead
*/ */
CoglBool CoglBool
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index, int layer_index,
CoglBool enable, CoglBool enable,
CoglError **error); CoglError **error)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_point_sprite_coords_enabled);
/** /**
* cogl_material_get_layer_point_sprite_coords_enabled: * cogl_material_get_layer_point_sprite_coords_enabled:
@ -1032,10 +1106,13 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
* point sprite coordinates. * point sprite coordinates.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_get_layer_point_sprite_coords_enabled()
* instead
*/ */
CoglBool CoglBool
cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index); int layer_index)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_layer_point_sprite_coords_enabled);
/** /**
* cogl_material_get_layer_wrap_mode_s: * cogl_material_get_layer_wrap_mode_s:
@ -1049,10 +1126,12 @@ cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
* this layer. * this layer.
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Use cogl_pipeline_get_layer_wrap_mode_s() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_get_layer_wrap_mode_s (CoglMaterial *material, cogl_material_get_layer_wrap_mode_s (CoglMaterial *material,
int layer_index); int layer_index)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_layer_wrap_mode_s);
/** /**
* cogl_material_set_layer_wrap_mode_s: * cogl_material_set_layer_wrap_mode_s:
@ -1063,11 +1142,13 @@ cogl_material_get_layer_wrap_mode_s (CoglMaterial *material,
* Sets the wrap mode for the 's' coordinate of texture lookups on this layer. * Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_layer_wrap_mode_s() instead
*/ */
void void
cogl_material_set_layer_wrap_mode_s (CoglMaterial *material, cogl_material_set_layer_wrap_mode_s (CoglMaterial *material,
int layer_index, int layer_index,
CoglMaterialWrapMode mode); CoglMaterialWrapMode mode)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_wrap_mode_s);
/** /**
* cogl_material_get_layer_wrap_mode_t: * cogl_material_get_layer_wrap_mode_t:
@ -1081,10 +1162,12 @@ cogl_material_set_layer_wrap_mode_s (CoglMaterial *material,
* this layer. * this layer.
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Use cogl_pipeline_get_layer_wrap_mode_t() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_get_layer_wrap_mode_t (CoglMaterial *material, cogl_material_get_layer_wrap_mode_t (CoglMaterial *material,
int layer_index); int layer_index)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_layer_wrap_mode_t);
/** /**
@ -1096,11 +1179,13 @@ cogl_material_get_layer_wrap_mode_t (CoglMaterial *material,
* Sets the wrap mode for the 't' coordinate of texture lookups on this layer. * Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_layer_wrap_mode_t() instead
*/ */
void void
cogl_material_set_layer_wrap_mode_t (CoglMaterial *material, cogl_material_set_layer_wrap_mode_t (CoglMaterial *material,
int layer_index, int layer_index,
CoglMaterialWrapMode mode); CoglMaterialWrapMode mode)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_wrap_mode_t);
/** /**
* cogl_material_get_layer_wrap_mode_p: * cogl_material_get_layer_wrap_mode_p:
@ -1114,10 +1199,12 @@ cogl_material_set_layer_wrap_mode_t (CoglMaterial *material,
* this layer. * this layer.
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Use cogl_pipeline_get_layer_wrap_mode_p() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_get_layer_wrap_mode_p (CoglMaterial *material, cogl_material_get_layer_wrap_mode_p (CoglMaterial *material,
int layer_index); int layer_index)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_layer_wrap_mode_p);
/** /**
* cogl_material_set_layer_wrap_mode_p: * cogl_material_set_layer_wrap_mode_p:
@ -1129,11 +1216,13 @@ cogl_material_get_layer_wrap_mode_p (CoglMaterial *material,
* this layer. 'p' is the third coordinate. * this layer. 'p' is the third coordinate.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_layer_wrap_mode_p() instead
*/ */
void void
cogl_material_set_layer_wrap_mode_p (CoglMaterial *material, cogl_material_set_layer_wrap_mode_p (CoglMaterial *material,
int layer_index, int layer_index,
CoglMaterialWrapMode mode); CoglMaterialWrapMode mode)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_wrap_mode_p);
/** /**
* cogl_material_set_layer_wrap_mode: * cogl_material_set_layer_wrap_mode:
@ -1148,11 +1237,13 @@ cogl_material_set_layer_wrap_mode_p (CoglMaterial *material,
* cogl_material_set_layer_wrap_mode_p() separately. * cogl_material_set_layer_wrap_mode_p() separately.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_set_layer_wrap_mode() instead
*/ */
void void
cogl_material_set_layer_wrap_mode (CoglMaterial *material, cogl_material_set_layer_wrap_mode (CoglMaterial *material,
int layer_index, int layer_index,
CoglMaterialWrapMode mode); CoglMaterialWrapMode mode)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_layer_wrap_mode);
/** /**
* cogl_material_layer_get_wrap_mode_s: * cogl_material_layer_get_wrap_mode_s:
@ -1163,9 +1254,11 @@ cogl_material_set_layer_wrap_mode (CoglMaterial *material,
* Return value: the wrap mode value for the s coordinate. * Return value: the wrap mode value for the s coordinate.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_layer_get_wrap_mode_s() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_layer_get_wrap_mode_s (CoglMaterialLayer *layer); cogl_material_layer_get_wrap_mode_s (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_layer_get_wrap_mode_s);
/** /**
* cogl_material_layer_get_wrap_mode_t: * cogl_material_layer_get_wrap_mode_t:
@ -1176,9 +1269,11 @@ cogl_material_layer_get_wrap_mode_s (CoglMaterialLayer *layer);
* Return value: the wrap mode value for the t coordinate. * Return value: the wrap mode value for the t coordinate.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_layer_get_wrap_mode_t() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_layer_get_wrap_mode_t (CoglMaterialLayer *layer); cogl_material_layer_get_wrap_mode_t (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_layer_get_wrap_mode_t);
/** /**
* cogl_material_layer_get_wrap_mode_p: * cogl_material_layer_get_wrap_mode_p:
@ -1190,9 +1285,11 @@ cogl_material_layer_get_wrap_mode_t (CoglMaterialLayer *layer);
* Return value: the wrap mode value for the p coordinate. * Return value: the wrap mode value for the p coordinate.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use cogl_pipeline_layer_get_wrap_mode_p() instead
*/ */
CoglMaterialWrapMode CoglMaterialWrapMode
cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer); cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_layer_get_wrap_mode_p);
#ifdef COGL_ENABLE_EXPERIMENTAL_API #ifdef COGL_ENABLE_EXPERIMENTAL_API
@ -1215,11 +1312,13 @@ cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
* *
* Since: 1.8 * Since: 1.8
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_pipeline_set_depth_state() instead
*/ */
CoglBool CoglBool
cogl_material_set_depth_state (CoglMaterial *material, cogl_material_set_depth_state (CoglMaterial *material,
const CoglDepthState *state, const CoglDepthState *state,
CoglError **error); CoglError **error)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_depth_state);
/** /**
* cogl_material_get_depth_state: * cogl_material_get_depth_state:
@ -1231,10 +1330,12 @@ cogl_material_set_depth_state (CoglMaterial *material,
* *
* Since: 2.0 * Since: 2.0
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_pipeline_get_depth_state() instead
*/ */
void void
cogl_material_get_depth_state (CoglMaterial *material, cogl_material_get_depth_state (CoglMaterial *material,
CoglDepthState *state_out); CoglDepthState *state_out)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_depth_state);
/** /**
* CoglMaterialLayerCallback: * CoglMaterialLayerCallback:
@ -1247,6 +1348,7 @@ cogl_material_get_depth_state (CoglMaterial *material,
* *
* Since: 1.4 * Since: 1.4
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16
*/ */
typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material, typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
int layer_index, int layer_index,
@ -1263,11 +1365,13 @@ typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
* *
* Since: 1.4 * Since: 1.4
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: No replacement
*/ */
void void
cogl_material_foreach_layer (CoglMaterial *material, cogl_material_foreach_layer (CoglMaterial *material,
CoglMaterialLayerCallback callback, CoglMaterialLayerCallback callback,
void *user_data); void *user_data)
COGL_DEPRECATED_IN_1_16;
#endif /* COGL_ENABLE_EXPERIMENTAL_API */ #endif /* COGL_ENABLE_EXPERIMENTAL_API */

View File

@ -31,10 +31,11 @@
#include <glib-object.h> #include <glib-object.h>
#endif /* COGL_HAS_GTYPE_SUPPORT */ #endif /* COGL_HAS_GTYPE_SUPPORT */
#include "cogl-types.h" #include <cogl/cogl-types.h>
#include <cogl/cogl-macros.h>
#ifdef COGL_ENABLE_EXPERIMENTAL_API #ifdef COGL_ENABLE_EXPERIMENTAL_API
#include "cogl-quaternion.h" #include <cogl/cogl-quaternion.h>
#endif #endif
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -408,7 +409,8 @@ cogl_matrix_ortho (CoglMatrix *matrix,
float bottom, float bottom,
float top, float top,
float near, float near,
float far); float far)
COGL_DEPRECATED_IN_1_10_FOR (cogl_matrix_orthographic);
#ifdef COGL_ENABLE_EXPERIMENTAL_API #ifdef COGL_ENABLE_EXPERIMENTAL_API
/** /**

View File

@ -82,8 +82,6 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
CoglBool CoglBool
cogl_is_offscreen (void *object); cogl_is_offscreen (void *object);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_offscreen_ref: * cogl_offscreen_ref:
* @offscreen: A pointer to a #CoglOffscreen framebuffer * @offscreen: A pointer to a #CoglOffscreen framebuffer
@ -96,7 +94,7 @@ cogl_is_offscreen (void *object);
* Deprecated: 1.2: cogl_object_ref() should be used in new code. * Deprecated: 1.2: cogl_object_ref() should be used in new code.
*/ */
void * void *
cogl_offscreen_ref (void *offscreen) G_GNUC_DEPRECATED; cogl_offscreen_ref (void *offscreen) COGL_DEPRECATED_FOR (cogl_object_ref);
/** /**
* cogl_offscreen_unref: * cogl_offscreen_unref:
@ -108,9 +106,7 @@ cogl_offscreen_ref (void *offscreen) G_GNUC_DEPRECATED;
* Deprecated: 1.2: cogl_object_unref() should be used in new code. * Deprecated: 1.2: cogl_object_unref() should be used in new code.
*/ */
void void
cogl_offscreen_unref (void *offscreen) G_GNUC_DEPRECATED; cogl_offscreen_unref (void *offscreen) COGL_DEPRECATED_FOR (cogl_object_unref);
#endif /* COGL_DISABLE_DEPRECATED */
COGL_END_DECLS COGL_END_DECLS

View File

@ -546,12 +546,13 @@ typedef void (*CoglSwapBuffersNotify) (CoglFramebuffer *framebuffer,
* the callback later. * the callback later.
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
* Deprecated: 1.14: Use cogl_onscreen_add_swap_complete_callback * Deprecated: 1.14: Use cogl_onscreen_add_frame_callback() instead
*/ */
unsigned int unsigned int
cogl_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen, cogl_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen,
CoglSwapBuffersNotify callback, CoglSwapBuffersNotify callback,
void *user_data); void *user_data)
COGL_DEPRECATED_IN_1_14_FOR (cogl_onscreen_add_frame_callback);
/** /**
* cogl_onscreen_remove_swap_buffers_callback: * cogl_onscreen_remove_swap_buffers_callback:
@ -563,11 +564,12 @@ cogl_onscreen_add_swap_buffers_callback (CoglOnscreen *onscreen,
* *
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
* Deprecated: 1.14: Use cogl_onscreen_remove_swap_complete_callback * Deprecated: 1.14: Use cogl_onscreen_remove_frame_callback() instead
*/ */
void void
cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen, cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
unsigned int id); unsigned int id)
COGL_DEPRECATED_IN_1_14_FOR (cogl_onscreen_remove_frame_callback);
/** /**
* cogl_onscreen_set_resizable: * cogl_onscreen_set_resizable:

View File

@ -30,6 +30,7 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-defines.h> #include <cogl/cogl-defines.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -239,11 +240,11 @@ typedef enum {
* source code to be used on it. * source code to be used on it.
* *
* Returns: a new shader handle. * Returns: a new shader handle.
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglHandle CoglHandle
cogl_create_shader (CoglShaderType shader_type); cogl_create_shader (CoglShaderType shader_type)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_shader_ref: * cogl_shader_ref:
@ -251,12 +252,12 @@ cogl_create_shader (CoglShaderType shader_type);
* *
* Add an extra reference to a shader. * Add an extra reference to a shader.
* *
* Deprecated: 1.0: Please use cogl_handle_ref() instead.
*
* Returns: @handle * Returns: @handle
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglHandle CoglHandle
cogl_shader_ref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_shader_ref (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_unref: * cogl_shader_unref:
@ -265,12 +266,11 @@ cogl_shader_ref (CoglHandle handle) G_GNUC_DEPRECATED;
* Removes a reference to a shader. If it was the last reference the * Removes a reference to a shader. If it was the last reference the
* shader object will be destroyed. * shader object will be destroyed.
* *
* Deprecated: 1.0: Please use cogl_handle_unref() instead. * Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_shader_unref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_shader_unref (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_is_shader: * cogl_is_shader:
@ -280,9 +280,11 @@ cogl_shader_unref (CoglHandle handle) G_GNUC_DEPRECATED;
* *
* Returns: %TRUE if the handle references a shader, * Returns: %TRUE if the handle references a shader,
* %FALSE otherwise * %FALSE otherwise
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglBool CoglBool
cogl_is_shader (CoglHandle handle); cogl_is_shader (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_source: * cogl_shader_source:
@ -295,10 +297,13 @@ cogl_is_shader (CoglHandle handle);
* Please see <link * Please see <link
* linkend="cogl-Shaders-and-Programmable-Pipeline.description">above</link> * linkend="cogl-Shaders-and-Programmable-Pipeline.description">above</link>
* for a description of the recommended format for the shader code. * for a description of the recommended format for the shader code.
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_shader_source (CoglHandle shader, cogl_shader_source (CoglHandle shader,
const char *source); const char *source)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_compile: * cogl_shader_compile:
* @handle: #CoglHandle for a shader. * @handle: #CoglHandle for a shader.
@ -307,9 +312,11 @@ cogl_shader_source (CoglHandle shader,
* for linking into a program. Note that calling this function is * for linking into a program. Note that calling this function is
* optional. If it is not called then the shader will be automatically * optional. If it is not called then the shader will be automatically
* compiled when it is linked. * compiled when it is linked.
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_shader_compile (CoglHandle handle); cogl_shader_compile (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_get_info_log: * cogl_shader_get_info_log:
@ -322,9 +329,11 @@ cogl_shader_compile (CoglHandle handle);
* *
* Return value: a newly allocated string containing the info log. Use * Return value: a newly allocated string containing the info log. Use
* g_free() to free it * g_free() to free it
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
char * char *
cogl_shader_get_info_log (CoglHandle handle); cogl_shader_get_info_log (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_get_type: * cogl_shader_get_type:
@ -334,9 +343,11 @@ cogl_shader_get_info_log (CoglHandle handle);
* *
* Return value: %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor * Return value: %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor
* or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor * or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglShaderType CoglShaderType
cogl_shader_get_type (CoglHandle handle); cogl_shader_get_type (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_shader_is_compiled: * cogl_shader_is_compiled:
@ -345,9 +356,11 @@ cogl_shader_get_type (CoglHandle handle);
* Retrieves whether a shader #CoglHandle has been compiled * Retrieves whether a shader #CoglHandle has been compiled
* *
* Return value: %TRUE if the shader object has sucessfully be compiled * Return value: %TRUE if the shader object has sucessfully be compiled
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglBool CoglBool
cogl_shader_is_compiled (CoglHandle handle); cogl_shader_is_compiled (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_create_program: * cogl_create_program:
@ -356,11 +369,11 @@ cogl_shader_is_compiled (CoglHandle handle);
* rendering pipeline with custom code. * rendering pipeline with custom code.
* *
* Returns: a new cogl program. * Returns: a new cogl program.
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglHandle CoglHandle
cogl_create_program (void); cogl_create_program (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_program_ref: * cogl_program_ref:
@ -368,12 +381,14 @@ cogl_create_program (void);
* *
* Add an extra reference to a program. * Add an extra reference to a program.
* *
* Deprecated: 1.0: Please use cogl_handle_ref() instead. * Deprecated: 1.0: Please use cogl_object_ref() instead.
* *
* Returns: @handle * Returns: @handle
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglHandle CoglHandle
cogl_program_ref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_program_ref (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_unref: * cogl_program_unref:
@ -382,12 +397,12 @@ cogl_program_ref (CoglHandle handle) G_GNUC_DEPRECATED;
* Removes a reference to a program. If it was the last reference the * Removes a reference to a program. If it was the last reference the
* program object will be destroyed. * program object will be destroyed.
* *
* Deprecated: 1.0: Please use cogl_handle_unref() instead. * Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_unref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_program_unref (CoglHandle handle)
COGL_DEPRECATED_IN_1_4_FOR (cogl_object_unref)
#endif /* COGL_DISABLE_DEPRECATED */ COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_is_program: * cogl_is_program:
@ -397,9 +412,12 @@ cogl_program_unref (CoglHandle handle) G_GNUC_DEPRECATED;
* *
* Returns: %TRUE if the handle references a program, * Returns: %TRUE if the handle references a program,
* %FALSE otherwise * %FALSE otherwise
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
CoglBool CoglBool
cogl_is_program (CoglHandle handle); cogl_is_program (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_attach_shader: * cogl_program_attach_shader:
@ -410,10 +428,13 @@ cogl_is_program (CoglHandle handle);
* vertex or fragment shaders but only one of them may provide a * vertex or fragment shaders but only one of them may provide a
* main() function. It is allowed to use a program with only a vertex * main() function. It is allowed to use a program with only a vertex
* shader or only a fragment shader. * shader or only a fragment shader.
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_attach_shader (CoglHandle program_handle, cogl_program_attach_shader (CoglHandle program_handle,
CoglHandle shader_handle); CoglHandle shader_handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_link: * cogl_program_link:
@ -422,9 +443,12 @@ cogl_program_attach_shader (CoglHandle program_handle,
* Links a program making it ready for use. Note that calling this * Links a program making it ready for use. Note that calling this
* function is optional. If it is not called the program will * function is optional. If it is not called the program will
* automatically be linked the first time it is used. * automatically be linked the first time it is used.
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_link (CoglHandle handle); cogl_program_link (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_use: * cogl_program_use:
@ -438,9 +462,12 @@ cogl_program_link (CoglHandle handle);
* context. It is much more efficient to attach the shader to a * context. It is much more efficient to attach the shader to a
* specific material used for rendering instead by calling * specific material used for rendering instead by calling
* cogl_material_set_user_program(). * cogl_material_set_user_program().
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_use (CoglHandle handle); cogl_program_use (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_get_uniform_location: * cogl_program_get_uniform_location:
@ -454,10 +481,12 @@ cogl_program_use (CoglHandle handle);
* Return value: the offset of a uniform in a specified program. * Return value: the offset of a uniform in a specified program.
* This uniform can be set using cogl_program_uniform_1f() when the * This uniform can be set using cogl_program_uniform_1f() when the
* program is in use. * program is in use.
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
int int
cogl_program_get_uniform_location (CoglHandle handle, cogl_program_get_uniform_location (CoglHandle handle,
const char *uniform_name); const char *uniform_name)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_set_uniform_1f: * cogl_program_set_uniform_1f:
@ -470,11 +499,13 @@ cogl_program_get_uniform_location (CoglHandle handle,
* @program. * @program.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
void void
cogl_program_set_uniform_1f (CoglHandle program, cogl_program_set_uniform_1f (CoglHandle program,
int uniform_location, int uniform_location,
float value); float value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_set_uniform_1i: * cogl_program_set_uniform_1i:
@ -487,11 +518,13 @@ cogl_program_set_uniform_1f (CoglHandle program,
* @program. * @program.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
void void
cogl_program_set_uniform_1i (CoglHandle program, cogl_program_set_uniform_1i (CoglHandle program,
int uniform_location, int uniform_location,
int value); int value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_set_uniform_float: * cogl_program_set_uniform_float:
@ -508,13 +541,15 @@ cogl_program_set_uniform_1i (CoglHandle program,
* the given linked @program. * the given linked @program.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
void void
cogl_program_set_uniform_float (CoglHandle program, cogl_program_set_uniform_float (CoglHandle program,
int uniform_location, int uniform_location,
int n_components, int n_components,
int count, int count,
const float *value); const float *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_set_uniform_int: * cogl_program_set_uniform_int:
@ -531,13 +566,15 @@ cogl_program_set_uniform_float (CoglHandle program,
* the given linked @program. * the given linked @program.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
void void
cogl_program_set_uniform_int (CoglHandle program, cogl_program_set_uniform_int (CoglHandle program,
int uniform_location, int uniform_location,
int n_components, int n_components,
int count, int count,
const int *value); const int *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_set_uniform_matrix: * cogl_program_set_uniform_matrix:
@ -555,6 +592,7 @@ cogl_program_set_uniform_int (CoglHandle program,
* given linked @program. * given linked @program.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use #CoglSnippet api instead
*/ */
void void
cogl_program_set_uniform_matrix (CoglHandle program, cogl_program_set_uniform_matrix (CoglHandle program,
@ -562,9 +600,8 @@ cogl_program_set_uniform_matrix (CoglHandle program,
int dimensions, int dimensions,
int count, int count,
CoglBool transpose, CoglBool transpose,
const float *value); const float *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_program_uniform_1f: * cogl_program_uniform_1f:
@ -574,11 +611,12 @@ cogl_program_set_uniform_matrix (CoglHandle program,
* Changes the value of a floating point uniform in the currently * Changes the value of a floating point uniform in the currently
* used (see cogl_program_use()) shader program. * used (see cogl_program_use()) shader program.
* *
* Deprecated: 1.4: Use cogl_program_set_uniform_1f() instead. * Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_uniform_1f (int uniform_no, cogl_program_uniform_1f (int uniform_no,
float value) G_GNUC_DEPRECATED; float value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_uniform_1i: * cogl_program_uniform_1i:
@ -588,11 +626,12 @@ cogl_program_uniform_1f (int uniform_no,
* Changes the value of an integer uniform in the currently * Changes the value of an integer uniform in the currently
* used (see cogl_program_use()) shader program. * used (see cogl_program_use()) shader program.
* *
* Deprecated: 1.4: Use cogl_program_set_uniform_1i() instead. * Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_uniform_1i (int uniform_no, cogl_program_uniform_1i (int uniform_no,
int value) G_GNUC_DEPRECATED; int value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_uniform_float: * cogl_program_uniform_float:
@ -604,13 +643,14 @@ cogl_program_uniform_1i (int uniform_no,
* Changes the value of a float vector uniform, or uniform array in the * Changes the value of a float vector uniform, or uniform array in the
* currently used (see cogl_program_use()) shader program. * currently used (see cogl_program_use()) shader program.
* *
* Deprecated: 1.4: Use cogl_program_set_uniform_float() instead. * Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_uniform_float (int uniform_no, cogl_program_uniform_float (int uniform_no,
int size, int size,
int count, int count,
const float *value) G_GNUC_DEPRECATED; const float *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_uniform_int: * cogl_program_uniform_int:
@ -621,12 +661,15 @@ cogl_program_uniform_float (int uniform_no,
* *
* Changes the value of a int vector uniform, or uniform array in the * Changes the value of a int vector uniform, or uniform array in the
* currently used (see cogl_program_use()) shader program. * currently used (see cogl_program_use()) shader program.
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_uniform_int (int uniform_no, cogl_program_uniform_int (int uniform_no,
int size, int size,
int count, int count,
const int *value) G_GNUC_DEPRECATED; const int *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
/** /**
* cogl_program_uniform_matrix: * cogl_program_uniform_matrix:
@ -639,15 +682,16 @@ cogl_program_uniform_int (int uniform_no,
* Changes the value of a matrix uniform, or uniform array in the * Changes the value of a matrix uniform, or uniform array in the
* currently used (see cogl_program_use()) shader program. The @size * currently used (see cogl_program_use()) shader program. The @size
* parameter is used to determine the square size of the matrix. * parameter is used to determine the square size of the matrix.
*
* Deprecated: 1.16: Use #CoglSnippet api
*/ */
void void
cogl_program_uniform_matrix (int uniform_no, cogl_program_uniform_matrix (int uniform_no,
int size, int size,
int count, int count,
CoglBool transpose, CoglBool transpose,
const float *value) G_GNUC_DEPRECATED; const float *value)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_);
#endif /* COGL_DISABLE_DEPRECATED */
COGL_END_DECLS COGL_END_DECLS

View File

@ -315,7 +315,7 @@ cogl_texture_get_format (CoglTexture *texture);
* a mistake that it was ever published. * a mistake that it was ever published.
*/ */
unsigned int unsigned int
cogl_texture_get_rowstride (CoglTexture *texture); cogl_texture_get_rowstride (CoglTexture *texture) COGL_DEPRECATED_IN_1_10;
/** /**
* cogl_texture_get_max_waste: * cogl_texture_get_max_waste:
@ -556,8 +556,6 @@ cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
int sub_width, int sub_width,
int sub_height); int sub_height);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_texture_ref: * cogl_texture_ref:
* @texture: a #CoglTexture. * @texture: a #CoglTexture.
@ -569,7 +567,7 @@ cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
* Return value: the @texture pointer. * Return value: the @texture pointer.
*/ */
void * void *
cogl_texture_ref (void *texture) G_GNUC_DEPRECATED; cogl_texture_ref (void *texture) COGL_DEPRECATED_FOR (cogl_object_ref);
/** /**
* cogl_texture_unref: * cogl_texture_unref:
@ -580,9 +578,7 @@ cogl_texture_ref (void *texture) G_GNUC_DEPRECATED;
* Deprecated: 1.2: Use cogl_object_unref() instead * Deprecated: 1.2: Use cogl_object_unref() instead
*/ */
void void
cogl_texture_unref (void *texture) G_GNUC_DEPRECATED; cogl_texture_unref (void *texture) COGL_DEPRECATED_FOR (cogl_object_unref);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_texture_allocate: * cogl_texture_allocate:

View File

@ -3,7 +3,7 @@
* *
* An object oriented GL/GLES Abstraction/Utility Layer * An object oriented GL/GLES Abstraction/Utility Layer
* *
* Copyright (C) 2012 Intel Corporation. * Copyright (C) 2012,2013 Intel Corporation.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -16,7 +16,8 @@
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
* *
* *
*/ */
@ -33,7 +34,39 @@
* Cogl offers a set of macros for checking the version of the library * Cogl offers a set of macros for checking the version of the library
* at compile time. * at compile time.
* *
* Since: 1.12.0 * Cogl adds version information to both API deprecations and additions;
* by definining the macros %COGL_VERSION_MIN_REQUIRED and
* %COGL_VERSION_MAX_ALLOWED, you can specify the range of Cogl versions
* whose API you want to use. Functions that were deprecated before, or
* introduced after, this range will trigger compiler warnings. For instance,
* if we define the following symbols:
*
* |[
* COGL_VERSION_MIN_REQUIRED = COGL_VERSION_1_6
* COGL_VERSION_MAX_ALLOWED = COGL_VERSION_1_8
* ]|
*
* and we have the following functions annotated in the Cogl headers:
*
* |[
* void cogl_function_A (void) COGL_DEPRECATED_IN_1_4;
* void cogl_function_B (void) COGL_DEPRECATED_IN_1_6;
* void cogl_function_C (void) COGL_AVAILABLE_IN_1_8;
* void cogl_function_D (void) COGL_AVAILABLE_IN_1_10;
* ]|
*
* then any application code using the functions above will get the output:
*
* |[
* cogl_function_A: deprecation warning
* cogl_function_B: no warning
* cogl_function_C: no warning
* cogl_function_D: symbol not available warning
* ]|
*
* It is possible to disable the compiler warnings by defining the macro
* %COGL_DISABLE_DEPRECATION_WARNINGS before including the cogl.h
* header.
*/ */
/** /**
@ -182,4 +215,118 @@
#define COGL_VERSION_CHECK(major, minor, micro) \ #define COGL_VERSION_CHECK(major, minor, micro) \
(COGL_VERSION >= COGL_VERSION_ENCODE (major, minor, micro)) (COGL_VERSION >= COGL_VERSION_ENCODE (major, minor, micro))
/**
* COGL_VERSION_1_0:
*
* A macro that evaluates to the 1.0 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_0 (COGL_VERSION_ENCODE (1, 0, 0))
/**
* COGL_VERSION_1_2:
*
* A macro that evaluates to the 1.2 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_2 (COGL_VERSION_ENCODE (1, 2, 0))
/**
* COGL_VERSION_1_4:
*
* A macro that evaluates to the 1.4 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_4 (COGL_VERSION_ENCODE (1, 4, 0))
/**
* COGL_VERSION_1_6:
*
* A macro that evaluates to the 1.6 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_6 (COGL_VERSION_ENCODE (1, 6, 0))
/**
* COGL_VERSION_1_8:
*
* A macro that evaluates to the 1.8 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_8 (COGL_VERSION_ENCODE (1, 8, 0))
/**
* COGL_VERSION_1_10:
*
* A macro that evaluates to the 1.10 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_10 (COGL_VERSION_ENCODE (1, 10, 0))
/**
* COGL_VERSION_1_12:
*
* A macro that evaluates to the 1.12 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_12 (COGL_VERSION_ENCODE (1, 12, 0))
/**
* COGL_VERSION_1_14:
*
* A macro that evaluates to the 1.14 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_14 (COGL_VERSION_ENCODE (1, 14, 0))
/**
* COGL_VERSION_1_16:
*
* A macro that evaluates to the 1.16 version of Cogl, in a format
* that can be used by the C pre-processor.
*
* Since: 1.16
*/
#define COGL_VERSION_1_16 (COGL_VERSION_ENCODE (1, 16, 0))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
*/
#if (COGL_VERSION_MINOR_INTERNAL % 2)
#define COGL_VERSION_CURRENT_STABLE \
(COGL_VERSION_ENCODE (COGL_VERSION_MAJOR_INTERNAL, \
COGL_VERSION_MINOR_INTERNAL + 1, 0))
#else
#define COGL_VERSION_CURRENT_STABLE \
(COGL_VERSION_ENCODE (COGL_VERSION_MAJOR_INTERNAL, \
COGL_VERSION_MINOR_INTERNAL, 0))
#endif
/* evaluates to the previous stable version */
#if (COGL_VERSION_MINOR_INTERNAL % 2)
#define COGL_VERSION_PREVIOUS_STABLE \
(COGL_VERSION_ENCODE (COGL_VERSION_MAJOR_INTERNAL, \
COGL_VERSION_MINOR_INTERNAL - 1, 0))
#else
#define COGL_VERSION_PREVIOUS_STABLE \
(COGL_VERSION_ENCODE (COGL_VERSION_MAJOR_INTERNAL, \
COGL_VERSION_MINOR_INTERNAL - 2, 0))
#endif
#endif /* __COGL_VERSION_H__ */ #endif /* __COGL_VERSION_H__ */

View File

@ -34,6 +34,7 @@
#include <glib.h> #include <glib.h>
#include <cogl/cogl-defines.h> #include <cogl/cogl-defines.h>
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -82,9 +83,11 @@ COGL_BEGIN_DECLS
* Creates a new vertex buffer that you can use to add attributes. * Creates a new vertex buffer that you can use to add attributes.
* *
* Return value: a new #CoglHandle * Return value: a new #CoglHandle
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglHandle CoglHandle
cogl_vertex_buffer_new (unsigned int n_vertices); cogl_vertex_buffer_new (unsigned int n_vertices)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_get_n_vertices: * cogl_vertex_buffer_get_n_vertices:
@ -93,9 +96,11 @@ cogl_vertex_buffer_new (unsigned int n_vertices);
* Retrieves the number of vertices that @handle represents * Retrieves the number of vertices that @handle represents
* *
* Return value: the number of vertices * Return value: the number of vertices
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
unsigned int unsigned int
cogl_vertex_buffer_get_n_vertices (CoglHandle handle); cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_add: * cogl_vertex_buffer_add:
@ -159,6 +164,8 @@ cogl_vertex_buffer_get_n_vertices (CoglHandle handle);
* |- - - - -0-0-0-0-0-0 0 0 0 0| * |- - - - -0-0-0-0-0-0 0 0 0 0|
* </programlisting> * </programlisting>
* (Though you can have multiple groups of interleved attributes)</note> * (Though you can have multiple groups of interleved attributes)</note>
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_add (CoglHandle handle, cogl_vertex_buffer_add (CoglHandle handle,
@ -167,7 +174,8 @@ cogl_vertex_buffer_add (CoglHandle handle,
CoglAttributeType type, CoglAttributeType type,
CoglBool normalized, CoglBool normalized,
uint16_t stride, uint16_t stride,
const void *pointer); const void *pointer)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_delete: * cogl_vertex_buffer_delete:
@ -177,10 +185,13 @@ cogl_vertex_buffer_add (CoglHandle handle,
* Deletes an attribute from a buffer. You will need to call * Deletes an attribute from a buffer. You will need to call
* cogl_vertex_buffer_submit() or issue a draw call to commit this * cogl_vertex_buffer_submit() or issue a draw call to commit this
* change to the GPU. * change to the GPU.
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_delete (CoglHandle handle, cogl_vertex_buffer_delete (CoglHandle handle,
const char *attribute_name); const char *attribute_name)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_submit: * cogl_vertex_buffer_submit:
@ -193,9 +204,12 @@ cogl_vertex_buffer_delete (CoglHandle handle,
* validating your data; it potentially incurs a transport cost (especially if * validating your data; it potentially incurs a transport cost (especially if
* you are using GLX indirect rendering) and potentially a format conversion * you are using GLX indirect rendering) and potentially a format conversion
* cost if the GPU doesn't natively support any of the given attribute formats. * cost if the GPU doesn't natively support any of the given attribute formats.
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_submit (CoglHandle handle); cogl_vertex_buffer_submit (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_disable: * cogl_vertex_buffer_disable:
@ -210,10 +224,13 @@ cogl_vertex_buffer_submit (CoglHandle handle);
* *
* You don't need to call cogl_vertex_buffer_submit() after using this * You don't need to call cogl_vertex_buffer_submit() after using this
* function. * function.
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_disable (CoglHandle handle, cogl_vertex_buffer_disable (CoglHandle handle,
const char *attribute_name); const char *attribute_name)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_enable: * cogl_vertex_buffer_enable:
@ -227,10 +244,13 @@ cogl_vertex_buffer_disable (CoglHandle handle,
* attributes before using a buffer for drawing. * attributes before using a buffer for drawing.
* *
* You don't need to call cogl_vertex_buffer_submit() after using this function * You don't need to call cogl_vertex_buffer_submit() after using this function
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_enable (CoglHandle handle, cogl_vertex_buffer_enable (CoglHandle handle,
const char *attribute_name); const char *attribute_name)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_draw: * cogl_vertex_buffer_draw:
@ -245,12 +265,15 @@ cogl_vertex_buffer_enable (CoglHandle handle,
* *
* Any un-submitted attribute changes are automatically submitted before * Any un-submitted attribute changes are automatically submitted before
* drawing. * drawing.
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_draw (CoglHandle handle, cogl_vertex_buffer_draw (CoglHandle handle,
CoglVerticesMode mode, CoglVerticesMode mode,
int first, int first,
int count); int count)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_indices_new: * cogl_vertex_buffer_indices_new:
@ -267,11 +290,14 @@ cogl_vertex_buffer_draw (CoglHandle handle,
* *
* Return value: A CoglHandle for the indices which you can pass to * Return value: A CoglHandle for the indices which you can pass to
* cogl_vertex_buffer_draw_elements(). * cogl_vertex_buffer_draw_elements().
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglHandle CoglHandle
cogl_vertex_buffer_indices_new (CoglIndicesType indices_type, cogl_vertex_buffer_indices_new (CoglIndicesType indices_type,
const void *indices_array, const void *indices_array,
int indices_len); int indices_len)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_indices_get_type: * cogl_vertex_buffer_indices_get_type:
@ -280,9 +306,12 @@ cogl_vertex_buffer_indices_new (CoglIndicesType indices_type,
* Queries back the data type used for the given indices * Queries back the data type used for the given indices
* *
* Returns: The CoglIndicesType used * Returns: The CoglIndicesType used
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglIndicesType CoglIndicesType
cogl_vertex_buffer_indices_get_type (CoglHandle indices); cogl_vertex_buffer_indices_get_type (CoglHandle indices)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_vertex_buffer_draw_elements: * cogl_vertex_buffer_draw_elements:
@ -303,6 +332,7 @@ cogl_vertex_buffer_indices_get_type (CoglHandle indices);
* *
* Any un-submitted attribute changes are automatically submitted before * Any un-submitted attribute changes are automatically submitted before
* drawing. * drawing.
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
void void
cogl_vertex_buffer_draw_elements (CoglHandle handle, cogl_vertex_buffer_draw_elements (CoglHandle handle,
@ -311,9 +341,8 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
int min_index, int min_index,
int max_index, int max_index,
int indices_offset, int indices_offset,
int count); int count)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_vertex_buffer_ref: * cogl_vertex_buffer_ref:
@ -323,10 +352,11 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
* *
* Return value: the @handle. * Return value: the @handle.
* *
* Deprecated: 1.2: Use cogl_handle_ref() instead * Deprecated: 1.2: Use cogl_object_ref() instead
*/ */
CoglHandle CoglHandle
cogl_vertex_buffer_ref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_vertex_buffer_ref (CoglHandle handle)
COGL_DEPRECATED_FOR (cogl_object_ref);
/** /**
* cogl_vertex_buffer_unref: * cogl_vertex_buffer_unref:
@ -334,12 +364,11 @@ cogl_vertex_buffer_ref (CoglHandle handle) G_GNUC_DEPRECATED;
* *
* Decrement the reference count for a vertex buffer * Decrement the reference count for a vertex buffer
* *
* Deprecated: 1.2: Use cogl_handle_unref() instead * Deprecated: 1.2: Use cogl_object_unref() instead
*/ */
void void
cogl_vertex_buffer_unref (CoglHandle handle) G_GNUC_DEPRECATED; cogl_vertex_buffer_unref (CoglHandle handle)
COGL_DEPRECATED_FOR (cogl_object_unref);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_vertex_buffer_indices_get_for_quads: * cogl_vertex_buffer_indices_get_for_quads:
@ -371,9 +400,12 @@ cogl_vertex_buffer_unref (CoglHandle handle) G_GNUC_DEPRECATED;
* *
* Returns: A %CoglHandle containing the indices. The handled is * Returns: A %CoglHandle containing the indices. The handled is
* owned by Cogl and should not be modified or unref'd. * owned by Cogl and should not be modified or unref'd.
*
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglHandle CoglHandle
cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices); cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_is_vertex_buffer: * cogl_is_vertex_buffer:
@ -385,9 +417,11 @@ cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices);
* otherwise * otherwise
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglBool CoglBool
cogl_is_vertex_buffer (CoglHandle handle); cogl_is_vertex_buffer (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
/** /**
* cogl_is_vertex_buffer_indices: * cogl_is_vertex_buffer_indices:
@ -400,9 +434,11 @@ cogl_is_vertex_buffer (CoglHandle handle);
* otherwise * otherwise
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.16: Use the #CoglPrimitive api instead
*/ */
CoglBool CoglBool
cogl_is_vertex_buffer_indices (CoglHandle handle); cogl_is_vertex_buffer_indices (CoglHandle handle)
COGL_DEPRECATED_IN_1_16_FOR (cogl_primitive_API);
COGL_END_DECLS COGL_END_DECLS

View File

@ -32,6 +32,7 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-clutter-xlib.h> #include <cogl/cogl-clutter-xlib.h>
#include <cogl/cogl-xlib-renderer.h> #include <cogl/cogl-xlib-renderer.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -43,9 +44,11 @@ COGL_BEGIN_DECLS
* before this function is called. * before this function is called.
* *
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_xlib_renderer_get_display() instead
*/ */
Display * Display *
cogl_xlib_get_display (void); cogl_xlib_get_display (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_xlib_renderer_get_display);
/* /*
* cogl_xlib_set_display: * cogl_xlib_set_display:
@ -55,9 +58,12 @@ cogl_xlib_get_display (void);
* more complete winsys abstraction. * more complete winsys abstraction.
* *
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_xlib_renderer_set_foreign_display()
* instead
*/ */
void void
cogl_xlib_set_display (Display *display); cogl_xlib_set_display (Display *display)
COGL_DEPRECATED_IN_1_16_FOR (cogl_xlib_renderer_set_foreign_display);
/* /*
* cogl_xlib_handle_event: * cogl_xlib_handle_event:
@ -75,9 +81,11 @@ cogl_xlib_set_display (Display *display);
* any exclusive action. * any exclusive action.
* *
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_xlib_renderer_handle_event() instead
*/ */
CoglFilterReturn CoglFilterReturn
cogl_xlib_handle_event (XEvent *xevent); cogl_xlib_handle_event (XEvent *xevent)
COGL_DEPRECATED_IN_1_16_FOR (cogl_xlib_renderer_handle_event);
COGL_END_DECLS COGL_END_DECLS

View File

@ -21,15 +21,15 @@
* *
*/ */
#ifdef HAVE_CONFIG_H #include <config.h>
#include "config.h"
#endif
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_4
#include "cogl-debug.h" #include "cogl-debug.h"
#include "cogl-util.h" #include "cogl-util.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"

View File

@ -44,6 +44,8 @@
*/ */
#include <cogl/cogl-defines.h> #include <cogl/cogl-defines.h>
#include <cogl/cogl-macros.h>
#include <cogl/cogl-error.h> #include <cogl/cogl-error.h>
#include <cogl/cogl-object.h> #include <cogl/cogl-object.h>

View File

@ -34,6 +34,7 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-texture.h> #include <cogl/cogl-texture.h>
#include <cogl/cogl-framebuffer.h> #include <cogl/cogl-framebuffer.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -47,9 +48,10 @@ COGL_BEGIN_DECLS
* Return value: a #GOptionGroup * Return value: a #GOptionGroup
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Not replaced
*/ */
GOptionGroup * GOptionGroup *
cogl_get_option_group (void); cogl_get_option_group (void) COGL_DEPRECATED_IN_1_16;
/* Misc */ /* Misc */
/** /**
@ -60,9 +62,11 @@ cogl_get_option_group (void);
* Return value: A logical OR of all the supported COGL features. * Return value: A logical OR of all the supported COGL features.
* *
* Since: 0.8 * Since: 0.8
* Deprecated: 1.10: Use cogl_foreach_feature() instead
*/ */
CoglFeatureFlags CoglFeatureFlags
cogl_get_features (void); cogl_get_features (void)
COGL_DEPRECATED_IN_1_10_FOR (cogl_foreach_feature);
/** /**
* cogl_features_available: * cogl_features_available:
@ -74,9 +78,11 @@ cogl_get_features (void);
* are available. * are available.
* *
* Return value: %TRUE if the features are available, %FALSE otherwise. * Return value: %TRUE if the features are available, %FALSE otherwise.
* Deprecated: 1.10: Use cogl_has_feature() instead
*/ */
CoglBool CoglBool
cogl_features_available (CoglFeatureFlags features); cogl_features_available (CoglFeatureFlags features)
COGL_DEPRECATED_IN_1_10_FOR (cogl_has_feature);
/** /**
* cogl_get_proc_address: * cogl_get_proc_address:
@ -96,8 +102,6 @@ cogl_features_available (CoglFeatureFlags features);
CoglFuncPtr CoglFuncPtr
cogl_get_proc_address (const char *name); cogl_get_proc_address (const char *name);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_check_extension: * cogl_check_extension:
* @name: extension to check for * @name: extension to check for
@ -116,9 +120,7 @@ cogl_get_proc_address (const char *name);
*/ */
CoglBool CoglBool
cogl_check_extension (const char *name, cogl_check_extension (const char *name,
const char *ext) G_GNUC_DEPRECATED; const char *ext) COGL_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_get_bitmasks: * cogl_get_bitmasks:
@ -130,12 +132,16 @@ cogl_check_extension (const char *name,
* Gets the number of bitplanes used for each of the color components * 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 * in the color buffer. Pass %NULL for any of the arguments if the
* value is not required. * value is not required.
*
* Deprecated: 1.8: Use cogl_framebuffer_get_red/green/blue/alpha_bits()
* instead
*/ */
void void
cogl_get_bitmasks (int *red, cogl_get_bitmasks (int *red,
int *green, int *green,
int *blue, int *blue,
int *alpha); int *alpha)
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_get_red_OR_green_OR_blue_OR_alpha_bits);
/** /**
* cogl_perspective: * cogl_perspective:
@ -151,12 +157,15 @@ cogl_get_bitmasks (int *red,
* ratio since that will reduce the effectiveness of depth testing * ratio since that will reduce the effectiveness of depth testing
* since there wont be enough precision to identify the depth of * since there wont be enough precision to identify the depth of
* objects near to each other.</note> * objects near to each other.</note>
*
* Deprecated: 1.10: Use cogl_framebuffer_perspective() instead
*/ */
void void
cogl_perspective (float fovy, cogl_perspective (float fovy,
float aspect, float aspect,
float z_near, float z_near,
float z_far); float z_far)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_perspective);
/** /**
* cogl_frustum: * cogl_frustum:
@ -176,6 +185,7 @@ cogl_perspective (float fovy,
* all cross through the origin and 2 near and far clip planes. * all cross through the origin and 2 near and far clip planes.
* *
* Since: 0.8.2 * Since: 0.8.2
* Deprecated: 1.10: Use cogl_framebuffer_frustum() instead
*/ */
void void
cogl_frustum (float left, cogl_frustum (float left,
@ -183,7 +193,8 @@ cogl_frustum (float left,
float bottom, float bottom,
float top, float top,
float z_near, float z_near,
float z_far); float z_far)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_frustum);
/** /**
* cogl_ortho: * cogl_ortho:
@ -213,6 +224,7 @@ cogl_frustum (float left,
* left, right bottom and top arguments.</note> * left, right bottom and top arguments.</note>
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.10: Use cogl_framebuffer_orthographic() instead
*/ */
void void
cogl_ortho (float left, cogl_ortho (float left,
@ -220,9 +232,8 @@ cogl_ortho (float left,
float bottom, float bottom,
float top, float top,
float near, float near,
float far); float far)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_orthographic);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_viewport: * cogl_viewport:
@ -232,14 +243,12 @@ cogl_ortho (float left,
* Replace the current viewport with the given values. * Replace the current viewport with the given values.
* *
* Since: 0.8.2 * Since: 0.8.2
* * Deprecated: 1.8: Use cogl_framebuffer_set_viewport instead
* Deprecated: 1.2: Use cogl_set_viewport() instead
*/ */
void void
cogl_viewport (unsigned int width, cogl_viewport (unsigned int width,
unsigned int height) G_GNUC_DEPRECATED; unsigned int height)
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_set_viewport);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_set_viewport: * cogl_set_viewport:
@ -251,29 +260,37 @@ cogl_viewport (unsigned int width,
* Replaces the current viewport with the given values. * Replaces the current viewport with the given values.
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.8: Use cogl_framebuffer_set_viewport() instead
*/ */
void void
cogl_set_viewport (int x, cogl_set_viewport (int x,
int y, int y,
int width, int width,
int height); int height)
COGL_DEPRECATED_IN_1_8_FOR (cogl_framebuffer_set_viewport);
/** /**
* cogl_push_matrix: * cogl_push_matrix:
* *
* Stores the current model-view matrix on the matrix stack. The matrix * Stores the current model-view matrix on the matrix stack. The matrix
* can later be restored with cogl_pop_matrix(). * can later be restored with cogl_pop_matrix().
*
* Deprecated: 1.10: Use cogl_framebuffer_push_matrix() instead
*/ */
void void
cogl_push_matrix (void); cogl_push_matrix (void)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_push_matrix);
/** /**
* cogl_pop_matrix: * cogl_pop_matrix:
* *
* Restores the current model-view matrix from the matrix stack. * Restores the current model-view matrix from the matrix stack.
*
* Deprecated: 1.10: Use cogl_framebuffer_pop_matrix() instead
*/ */
void void
cogl_pop_matrix (void); cogl_pop_matrix (void)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_push_matrix);
/** /**
* cogl_scale: * cogl_scale:
@ -283,11 +300,14 @@ cogl_pop_matrix (void);
* *
* Multiplies the current model-view matrix by one that scales the x, * Multiplies the current model-view matrix by one that scales the x,
* y and z axes by the given values. * y and z axes by the given values.
*
* Deprecated: 1.10: Use cogl_framebuffer_pop_matrix() instead
*/ */
void void
cogl_scale (float x, cogl_scale (float x,
float y, float y,
float z); float z)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_scale);
/** /**
* cogl_translate: * cogl_translate:
@ -297,11 +317,14 @@ cogl_scale (float x,
* *
* Multiplies the current model-view matrix by one that translates the * Multiplies the current model-view matrix by one that translates the
* model along all three axes according to the given values. * model along all three axes according to the given values.
*
* Deprecated: 1.10: Use cogl_framebuffer_translate() instead
*/ */
void void
cogl_translate (float x, cogl_translate (float x,
float y, float y,
float z); float z)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_translate);
/** /**
* cogl_rotate: * cogl_rotate:
@ -315,12 +338,15 @@ cogl_translate (float x,
* follows the right-hand thumb rule so for example rotating by 10 * follows the right-hand thumb rule so for example rotating by 10
* degrees about the vertex (0, 0, 1) causes a small counter-clockwise * degrees about the vertex (0, 0, 1) causes a small counter-clockwise
* rotation. * rotation.
*
* Deprecated: 1.10: Use cogl_framebuffer_rotate() instead
*/ */
void void
cogl_rotate (float angle, cogl_rotate (float angle,
float x, float x,
float y, float y,
float z); float z)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_rotate);
/** /**
* cogl_transform: * cogl_transform:
@ -329,45 +355,63 @@ cogl_rotate (float angle,
* Multiplies the current model-view matrix by the given matrix. * Multiplies the current model-view matrix by the given matrix.
* *
* Since: 1.4 * Since: 1.4
* Deprecated: 1.10: Use cogl_framebuffer_transform() instead
*/ */
void void
cogl_transform (const CoglMatrix *matrix); cogl_transform (const CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_transform);
/** /**
* cogl_get_modelview_matrix: * cogl_get_modelview_matrix:
* @matrix: (out): return location for the model-view matrix * @matrix: (out): return location for the model-view matrix
* *
* Stores the current model-view matrix in @matrix. * Stores the current model-view matrix in @matrix.
*
* Deprecated: 1.10: Use cogl_framebuffer_get_modelview_matrix()
* instead
*/ */
void void
cogl_get_modelview_matrix (CoglMatrix *matrix); cogl_get_modelview_matrix (CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_modelview_matrix);
/** /**
* cogl_set_modelview_matrix: * cogl_set_modelview_matrix:
* @matrix: the new model-view matrix * @matrix: the new model-view matrix
* *
* Loads @matrix as the new model-view matrix. * Loads @matrix as the new model-view matrix.
*
* Deprecated: 1.10: Use cogl_framebuffer_set_modelview_matrix()
* instead
*/ */
void void
cogl_set_modelview_matrix (CoglMatrix *matrix); cogl_set_modelview_matrix (CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_set_modelview_matrix);
/** /**
* cogl_get_projection_matrix: * cogl_get_projection_matrix:
* @matrix: (out): return location for the projection matrix * @matrix: (out): return location for the projection matrix
* *
* Stores the current projection matrix in @matrix. * Stores the current projection matrix in @matrix.
*
* Deprecated: 1.10: Use cogl_framebuffer_get_projection_matrix()
* instead
*/ */
void void
cogl_get_projection_matrix (CoglMatrix *matrix); cogl_get_projection_matrix (CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_projection_matrix);
/** /**
* cogl_set_projection_matrix: * cogl_set_projection_matrix:
* @matrix: the new projection matrix * @matrix: the new projection matrix
* *
* Loads matrix as the new projection matrix. * Loads matrix as the new projection matrix.
*
* Deprecated: 1.10: Use cogl_framebuffer_set_projection_matrix()
* instead
*/ */
void void
cogl_set_projection_matrix (CoglMatrix *matrix); cogl_set_projection_matrix (CoglMatrix *matrix)
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_set_projection_matrix);
/** /**
* cogl_get_viewport: * cogl_get_viewport:
@ -377,9 +421,13 @@ cogl_set_projection_matrix (CoglMatrix *matrix);
* Stores the current viewport in @v. @v[0] and @v[1] get the x and y * 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 * position of the viewport and @v[2] and @v[3] get the width and
* height. * height.
*
* Deprecated: 1.10: Use cogl_framebuffer_get_viewport4fv()
* instead
*/ */
void void
cogl_get_viewport (float v[4]); cogl_get_viewport (float v[4])
COGL_DEPRECATED_IN_1_10_FOR (cogl_framebuffer_get_viewport4fv);
/** /**
* cogl_set_depth_test_enabled: * cogl_set_depth_test_enabled:
@ -391,11 +439,11 @@ cogl_get_viewport (float v[4]);
* clutter_actor_lower(), otherwise it will also take into account the * clutter_actor_lower(), otherwise it will also take into account the
* actor's depth. Depth testing is disabled by default. * actor's depth. Depth testing is disabled by default.
* *
* Deprecated: 1.4: Use cogl_material_set_depth_test_enabled() * Deprecated: 1.16: Use cogl_pipeline_set_depth_state() instead
* instead.
*/ */
void void
cogl_set_depth_test_enabled (CoglBool setting); cogl_set_depth_test_enabled (CoglBool setting)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_depth_state);
/** /**
* cogl_get_depth_test_enabled: * cogl_get_depth_test_enabled:
@ -404,11 +452,11 @@ cogl_set_depth_test_enabled (CoglBool setting);
* *
* Return value: %TRUE if depth testing is enabled, and %FALSE otherwise * Return value: %TRUE if depth testing is enabled, and %FALSE otherwise
* *
* Deprecated: 1.4: Use cogl_material_get_depth_test_enabled() * Deprecated: 1.16: Use cogl_pipeline_set_depth_state() instead
* instead.
*/ */
CoglBool CoglBool
cogl_get_depth_test_enabled (void); cogl_get_depth_test_enabled (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_depth_state);
/** /**
* cogl_set_backface_culling_enabled: * cogl_set_backface_culling_enabled:
@ -419,9 +467,12 @@ cogl_get_depth_test_enabled (void);
* textures or fully closed cubes without enabling depth testing. This * textures or fully closed cubes without enabling depth testing. This
* only affects calls to the cogl_rectangle* family of functions and * only affects calls to the cogl_rectangle* family of functions and
* cogl_vertex_buffer_draw*. Backface culling is disabled by default. * cogl_vertex_buffer_draw*. Backface culling is disabled by default.
*
* Deprecated: 1.16: Use cogl_pipeline_set_cull_face_mode() instead
*/ */
void void
cogl_set_backface_culling_enabled (CoglBool setting); cogl_set_backface_culling_enabled (CoglBool setting)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_set_cull_face_mode);
/** /**
* cogl_get_backface_culling_enabled: * cogl_get_backface_culling_enabled:
@ -430,9 +481,12 @@ cogl_set_backface_culling_enabled (CoglBool setting);
* cogl_set_backface_culling_enabled() * cogl_set_backface_culling_enabled()
* *
* Return value: %TRUE if backface culling is enabled, and %FALSE otherwise * Return value: %TRUE if backface culling is enabled, and %FALSE otherwise
*
* Deprecated: 1.16: Use cogl_pipeline_get_cull_face_mode() instead
*/ */
CoglBool CoglBool
cogl_get_backface_culling_enabled (void); cogl_get_backface_culling_enabled (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_pipeline_get_cull_face_mode);
/** /**
* cogl_set_fog: * cogl_set_fog:
@ -458,22 +512,28 @@ cogl_get_backface_culling_enabled (void);
* and use cogl_material_set_color() you can only use fogging with fully * 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 * opaque primitives. This might improve in the future when we can depend
* on fragment shaders.</note> * on fragment shaders.</note>
*
* Deprecated: 1.16: Use #CoglSnippet shader api for fog
*/ */
void void
cogl_set_fog (const CoglColor *fog_color, cogl_set_fog (const CoglColor *fog_color,
CoglFogMode mode, CoglFogMode mode,
float density, float density,
float z_near, float z_near,
float z_far); float z_far)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_API);
/** /**
* cogl_disable_fog: * cogl_disable_fog:
* *
* This function disables fogging, so primitives drawn afterwards will not be * This function disables fogging, so primitives drawn afterwards will not be
* blended with any previously set fog color. * blended with any previously set fog color.
*
* Deprecated: 1.16: Use #CoglSnippet shader api for fog
*/ */
void void
cogl_disable_fog (void); cogl_disable_fog (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_snippet_API);
/** /**
* cogl_clear: * cogl_clear:
@ -483,10 +543,13 @@ cogl_disable_fog (void);
* *
* Clears all the auxiliary buffers identified in the @buffers mask, and if * Clears all the auxiliary buffers identified in the @buffers mask, and if
* that includes the color buffer then the specified @color is used. * that includes the color buffer then the specified @color is used.
*
* Deprecated: 1.16: Use cogl_framebuffer_clear() api instead
*/ */
void void
cogl_clear (const CoglColor *color, cogl_clear (const CoglColor *color,
unsigned long buffers); unsigned long buffers)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_clear);
/** /**
* cogl_set_source: * cogl_set_source:
@ -498,9 +561,12 @@ cogl_clear (const CoglColor *color,
* cogl_rectangle() or vertices drawn using cogl_vertex_buffer_draw(). * cogl_rectangle() or vertices drawn using cogl_vertex_buffer_draw().
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_set_source (void *material); cogl_set_source (void *material) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_get_source: * cogl_get_source:
@ -517,9 +583,12 @@ cogl_set_source (void *material);
* Return value: The current source material. * Return value: The current source material.
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void * void *
cogl_get_source (void); cogl_get_source (void) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_push_source: * cogl_push_source:
@ -530,9 +599,12 @@ cogl_get_source (void);
* process later primitives as defined by cogl_set_source(). * process later primitives as defined by cogl_set_source().
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_push_source (void *material); cogl_push_source (void *material) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_pop_source: * cogl_pop_source:
@ -542,9 +614,12 @@ cogl_push_source (void *material);
* later primitives as defined by cogl_set_source(). * later primitives as defined by cogl_set_source().
* *
* Since: 1.6 * Since: 1.6
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_pop_source (void); cogl_pop_source (void) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_set_source_color: * cogl_set_source_color:
@ -562,9 +637,12 @@ cogl_pop_source (void);
* if you already have the color components. * if you already have the color components.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_set_source_color (const CoglColor *color); cogl_set_source_color (const CoglColor *color) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_set_source_color4ub: * cogl_set_source_color4ub:
@ -581,12 +659,15 @@ cogl_set_source_color (const CoglColor *color);
* between 0 and 255. * between 0 and 255.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_set_source_color4ub (uint8_t red, cogl_set_source_color4ub (uint8_t red,
uint8_t green, uint8_t green,
uint8_t blue, uint8_t blue,
uint8_t alpha); uint8_t alpha) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_set_source_color4f: * cogl_set_source_color4f:
@ -604,12 +685,15 @@ cogl_set_source_color4ub (uint8_t red,
* range, they will be clamped. * range, they will be clamped.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_set_source_color4f (float red, cogl_set_source_color4f (float red,
float green, float green,
float blue, float blue,
float alpha); float alpha) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_set_source_texture: * cogl_set_source_texture:
@ -630,9 +714,12 @@ cogl_set_source_color4f (float red,
* </programlisting> * </programlisting>
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Latest drawing apis all take an explicit
* #CoglPipeline argument so this stack of
* #CoglMaterial<!-- -->s shouldn't be used.
*/ */
void void
cogl_set_source_texture (CoglTexture *texture); cogl_set_source_texture (CoglTexture *texture) COGL_DEPRECATED_IN_1_16;
/** /**
@ -644,8 +731,6 @@ cogl_set_source_texture (CoglTexture *texture);
* intersected with the previous region. * intersected with the previous region.
*/ */
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_clip_push_window_rect: * cogl_clip_push_window_rect:
* @x_offset: left edge of the clip rectangle in window coordinates * @x_offset: left edge of the clip rectangle in window coordinates
@ -662,15 +747,14 @@ cogl_set_source_texture (CoglTexture *texture);
* The rectangle is intersected with the current clip region. To undo * The rectangle is intersected with the current clip region. To undo
* the effect of this function, call cogl_clip_pop(). * the effect of this function, call cogl_clip_pop().
* *
* Deprecated: 1.2: Use cogl_clip_push_window_rectangle() instead * Deprecated: 1.16: Use cogl_framebuffer_push_scissor_clip() instead
*/ */
void void
cogl_clip_push_window_rect (float x_offset, cogl_clip_push_window_rect (float x_offset,
float y_offset, float y_offset,
float width, float width,
float height) G_GNUC_DEPRECATED; float height)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_scissor_clip);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_clip_push_window_rectangle: * cogl_clip_push_window_rectangle:
@ -689,14 +773,14 @@ cogl_clip_push_window_rect (float x_offset,
* the effect of this function, call cogl_clip_pop(). * the effect of this function, call cogl_clip_pop().
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: Use cogl_framebuffer_push_scissor_clip() instead
*/ */
void void
cogl_clip_push_window_rectangle (int x_offset, cogl_clip_push_window_rectangle (int x_offset,
int y_offset, int y_offset,
int width, int width,
int height); int height)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_scissor_clip);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_clip_push: * cogl_clip_push:
@ -714,19 +798,18 @@ cogl_clip_push_window_rectangle (int x_offset,
* The rectangle is intersected with the current clip region. To undo * The rectangle is intersected with the current clip region. To undo
* the effect of this function, call cogl_clip_pop(). * the effect of this function, call cogl_clip_pop().
* *
* Deprecated: 1.2: The x, y, width, height arguments are inconsistent * Deprecated: 1.16: The x, y, width, height arguments are inconsistent
* with other API that specify rectangles in model space, and when used * with other API that specify rectangles in model space, and when used
* with a coordinate space that puts the origin at the center and y+ * with a coordinate space that puts the origin at the center and y+
* extending up, it's awkward to use. Please use cogl_clip_push_rectangle() * extending up, it's awkward to use. Please use
* instead * cogl_framebuffer_push_rectangle_clip()
*/ */
void void
cogl_clip_push (float x_offset, cogl_clip_push (float x_offset,
float y_offset, float y_offset,
float width, float width,
float height) G_GNUC_DEPRECATED; float height)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_rectangle_clip);
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_clip_push_rectangle: * cogl_clip_push_rectangle:
@ -745,12 +828,15 @@ cogl_clip_push (float x_offset,
* the effect of this function, call cogl_clip_pop(). * the effect of this function, call cogl_clip_pop().
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: Use cogl_framebuffer_push_rectangle_clip()
* instead
*/ */
void void
cogl_clip_push_rectangle (float x0, cogl_clip_push_rectangle (float x0,
float y0, float y0,
float x1, float x1,
float y1); float y1)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_rectangle_clip);
/** /**
* cogl_clip_push_from_path_preserve: * cogl_clip_push_from_path_preserve:
@ -761,11 +847,12 @@ cogl_clip_push_rectangle (float x0,
* cogl_clip_pop(). * cogl_clip_pop().
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use cogl_framebuffer_push_path_clip() instead
*/ */
void void
cogl_clip_push_from_path_preserve (void); cogl_clip_push_from_path_preserve (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_path_clip);
#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
/** /**
* cogl_clip_push_primitive: * cogl_clip_push_primitive:
* @primitive: A #CoglPrimitive describing a flat 2D shape * @primitive: A #CoglPrimitive describing a flat 2D shape
@ -795,25 +882,28 @@ cogl_clip_push_from_path_preserve (void);
* *
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
* Deprecated: 1.16: Use cogl_framebuffer_push_primitive_clip()
* instead
*/ */
void void
cogl_clip_push_primitive (CoglPrimitive *primitive, cogl_clip_push_primitive (CoglPrimitive *primitive,
float bounds_x1, float bounds_x1,
float bounds_y1, float bounds_y1,
float bounds_x2, float bounds_x2,
float bounds_y2); float bounds_y2)
#endif COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_primitive_clip);
/** /**
* cogl_clip_pop: * cogl_clip_pop:
* *
* Reverts the clipping region to the state before the last call to * Reverts the clipping region to the state before the last call to
* cogl_clip_push(). * cogl_clip_push().
*
* Deprecated: 1.16: Use cogl_framebuffer_pop_clip() instead
*/ */
void void
cogl_clip_pop (void); cogl_clip_pop (void)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_pop_clip);
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_clip_ensure: * cogl_clip_ensure:
@ -828,7 +918,7 @@ cogl_clip_pop (void);
* Since: 1.0 * Since: 1.0
*/ */
void void
cogl_clip_ensure (void) G_GNUC_DEPRECATED; cogl_clip_ensure (void) COGL_DEPRECATED;
/** /**
* cogl_clip_stack_save: * cogl_clip_stack_save:
@ -848,7 +938,7 @@ cogl_clip_ensure (void) G_GNUC_DEPRECATED;
* Since: 0.8.2 * Since: 0.8.2
*/ */
void void
cogl_clip_stack_save (void) G_GNUC_DEPRECATED; cogl_clip_stack_save (void) COGL_DEPRECATED;
/** /**
* cogl_clip_stack_restore: * cogl_clip_stack_restore:
@ -865,9 +955,7 @@ cogl_clip_stack_save (void) G_GNUC_DEPRECATED;
* Since: 0.8.2 * Since: 0.8.2
*/ */
void void
cogl_clip_stack_restore (void) G_GNUC_DEPRECATED; cogl_clip_stack_restore (void) COGL_DEPRECATED;
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_set_framebuffer: * cogl_set_framebuffer:
@ -878,9 +966,12 @@ cogl_clip_stack_restore (void) G_GNUC_DEPRECATED;
* or in the future it may be an onscreen framebuffers too. * or in the future it may be an onscreen framebuffers too.
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: The latest drawing apis take explicit
* #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_set_framebuffer (CoglFramebuffer *buffer); cogl_set_framebuffer (CoglFramebuffer *buffer) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_push_framebuffer: * cogl_push_framebuffer:
@ -959,9 +1050,12 @@ cogl_set_framebuffer (CoglFramebuffer *buffer);
* The previous framebuffer can be restored by calling cogl_pop_framebuffer() * The previous framebuffer can be restored by calling cogl_pop_framebuffer()
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: The latest drawing apis take explicit
* #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_push_framebuffer (CoglFramebuffer *buffer); cogl_push_framebuffer (CoglFramebuffer *buffer) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_pop_framebuffer: * cogl_pop_framebuffer:
@ -970,11 +1064,12 @@ cogl_push_framebuffer (CoglFramebuffer *buffer);
* All subsequent drawing will be redirected to this framebuffer. * All subsequent drawing will be redirected to this framebuffer.
* *
* Since: 1.2 * Since: 1.2
* Deprecated: 1.16: The latest drawing apis take explicit
* #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_pop_framebuffer (void); cogl_pop_framebuffer (void) COGL_DEPRECATED_IN_1_16;
#ifndef COGL_DISABLE_DEPRECATED
/** /**
* cogl_set_draw_buffer: * cogl_set_draw_buffer:
@ -988,34 +1083,37 @@ cogl_pop_framebuffer (void);
* cogl_offscreen_new_to_texture () or you can revert to your original * cogl_offscreen_new_to_texture () or you can revert to your original
* on screen window buffer. * on screen window buffer.
* *
* Deprecated: 1.2: The target argument was redundant since we could look at * Deprecated: 1.16: The latest drawing apis take explicit
* the type of CoglHandle given instead. * #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_set_draw_buffer (CoglBufferTarget target, cogl_set_draw_buffer (CoglBufferTarget target,
CoglHandle offscreen) G_GNUC_DEPRECATED; CoglHandle offscreen) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_push_draw_buffer: * cogl_push_draw_buffer:
* *
* Save cogl_set_draw_buffer() state. * Save cogl_set_draw_buffer() state.
* *
* Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API * Deprecated: 1.16: The latest drawing apis take explicit
* #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_push_draw_buffer (void) COGL_GNUC_DEPRECATED; cogl_push_draw_buffer (void) COGL_DEPRECATED_IN_1_16;
/** /**
* cogl_pop_draw_buffer: * cogl_pop_draw_buffer:
* *
* Restore cogl_set_draw_buffer() state. * Restore cogl_set_draw_buffer() state.
* *
* Deprecated: 1.2: The draw buffer API was replaced with a framebuffer API * Deprecated: 1.16: The latest drawing apis take explicit
* #CoglFramebuffer arguments so this stack of
* framebuffers shouldn't be used anymore.
*/ */
void void
cogl_pop_draw_buffer (void) COGL_GNUC_DEPRECATED; cogl_pop_draw_buffer (void) COGL_DEPRECATED_IN_1_16;
#endif /* COGL_DISABLE_DEPRECATED */
/** /**
* cogl_read_pixels: * cogl_read_pixels:
@ -1038,6 +1136,8 @@ cogl_pop_draw_buffer (void) COGL_GNUC_DEPRECATED;
* read the pixel values without any conversion you should either * read the pixel values without any conversion you should either
* specify a format that doesn't use an alpha channel or use one of * specify a format that doesn't use an alpha channel or use one of
* the formats ending in PRE. * the formats ending in PRE.
*
* Deprecated: 1.16: Use cogl_framebuffer_read_pixels() instead
*/ */
void void
cogl_read_pixels (int x, cogl_read_pixels (int x,
@ -1046,7 +1146,8 @@ cogl_read_pixels (int x,
int height, int height,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglPixelFormat format, CoglPixelFormat format,
uint8_t *pixels); uint8_t *pixels)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_read_pixels);
/** /**
* cogl_flush: * cogl_flush:
@ -1149,9 +1250,10 @@ cogl_flush (void);
* OpenGL. * OpenGL.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglGLES2Context api instead
*/ */
void void
cogl_begin_gl (void); cogl_begin_gl (void) COGL_DEPRECATED_IN_1_16_FOR (CoglGLES2Context_API);
/** /**
* cogl_end_gl: * cogl_end_gl:
@ -1160,9 +1262,10 @@ cogl_begin_gl (void);
* code using raw OpenGL. Please refer to cogl_begin_gl() for full details. * code using raw OpenGL. Please refer to cogl_begin_gl() for full details.
* *
* Since: 1.0 * Since: 1.0
* Deprecated: 1.16: Use the #CoglGLES2Context api instead
*/ */
void void
cogl_end_gl (void); cogl_end_gl (void) COGL_DEPRECATED_IN_1_16_FOR (CoglGLES2Context_API);
COGL_END_DECLS COGL_END_DECLS

View File

@ -30,6 +30,7 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl2-path.h> #include <cogl/cogl2-path.h>
#include <cogl/cogl-macros.h>
COGL_BEGIN_DECLS COGL_BEGIN_DECLS
@ -45,9 +46,11 @@ COGL_BEGIN_DECLS
* *
* Since: 1.8 * Since: 1.8
* Stability: Unstable * Stability: Unstable
* Deprecated: 1.16: Use cogl_framebuffer_push_path_clip() instead
*/ */
void void
cogl_clip_push_from_path (CoglPath *path); cogl_clip_push_from_path (CoglPath *path)
COGL_DEPRECATED_IN_1_16_FOR (cogl_framebuffer_push_path_clip);
COGL_END_DECLS COGL_END_DECLS

View File

@ -3,6 +3,9 @@ RELEASING
When making a new release; When making a new release;
- If it's a new stable release that increments the Cogl minor version
remember to add a new COGL_VERSION_1_X define to cogl/cogl-macros.h
- Verify that you don't have uncommitted changes; both: - Verify that you don't have uncommitted changes; both:
$ git diff HEAD $ git diff HEAD

View File

@ -169,8 +169,9 @@ main (int argc, char **argv)
cogl_onscreen_show (onscreen); cogl_onscreen_show (onscreen);
cogl_push_framebuffer (fb); cogl_framebuffer_set_viewport (fb, 0, 0,
cogl_set_viewport (0, 0, data.framebuffer_width, data.framebuffer_height); data.framebuffer_width,
data.framebuffer_height);
fovy = 60; /* y-axis field of view */ fovy = 60; /* y-axis field of view */
aspect = (float)data.framebuffer_width/(float)data.framebuffer_height; aspect = (float)data.framebuffer_width/(float)data.framebuffer_height;
@ -178,7 +179,7 @@ main (int argc, char **argv)
z_2d = 1000; /* position to 2d plane */ z_2d = 1000; /* position to 2d plane */
z_far = 2000; /* distance to far clipping plane */ z_far = 2000; /* distance to far clipping plane */
cogl_perspective (fovy, aspect, z_near, z_far); cogl_framebuffer_perspective (fb, fovy, aspect, z_near, z_far);
/* Since the pango renderer emits geometry in pixel/device coordinates /* Since the pango renderer emits geometry in pixel/device coordinates
* and the anti aliasing is implemented with the assumption that the * and the anti aliasing is implemented with the assumption that the
@ -195,12 +196,11 @@ main (int argc, char **argv)
cogl_matrix_view_2d_in_perspective (&data.view, fovy, aspect, z_near, z_2d, cogl_matrix_view_2d_in_perspective (&data.view, fovy, aspect, z_near, z_2d,
data.framebuffer_width, data.framebuffer_width,
data.framebuffer_height); data.framebuffer_height);
cogl_set_modelview_matrix (&data.view); cogl_framebuffer_set_modelview_matrix (fb, &data.view);
cogl_pop_framebuffer ();
/* Initialize some convenient constants */ /* Initialize some convenient constants */
cogl_matrix_init_identity (&identity); cogl_matrix_init_identity (&identity);
cogl_color_set_from_4ub (&white, 0xff, 0xff, 0xff, 0xff); cogl_color_init_from_4ub (&white, 0xff, 0xff, 0xff, 0xff);
/* rectangle indices allow the GPU to interpret a list of quads (the /* rectangle indices allow the GPU to interpret a list of quads (the
* faces of our cube) as a list of triangles. * faces of our cube) as a list of triangles.

View File

@ -806,15 +806,9 @@ cogland_compositor_create_output (CoglandCompositor *compositor,
g_error ("Failed to allocate framebuffer: %s\n", error->message); g_error ("Failed to allocate framebuffer: %s\n", error->message);
cogl_onscreen_show (output->onscreen); cogl_onscreen_show (output->onscreen);
#if 0 cogl_framebuffer_set_viewport (fb, -x, -y,
cogl_framebuffer_set_viewport (fb, x, y, width, height); compositor->virtual_width,
#else compositor->virtual_height);
cogl_push_framebuffer (fb);
cogl_set_viewport (-x, -y,
compositor->virtual_width,
compositor->virtual_height);
cogl_pop_framebuffer ();
#endif
mode = g_slice_new0 (CoglandMode); mode = g_slice_new0 (CoglandMode);
mode->flags = 0; mode->flags = 0;

View File

@ -1,3 +1,5 @@
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_0
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>

View File

@ -1,3 +1,5 @@
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_0
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>

View File

@ -1,3 +1,5 @@
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_0
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>

View File

@ -1,3 +1,5 @@
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_0
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include "test-utils.h" #include "test-utils.h"

View File

@ -1,3 +1,5 @@
#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_0
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>