2009-11-17 13:52:40 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 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
|
2010-03-01 12:56:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
2009-11-17 13:52:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __COGL_FEATURE_PRIVATE_H
|
|
|
|
#define __COGL_FEATURE_PRIVATE_H
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
#include "cogl-internal.h"
|
|
|
|
|
2009-11-17 13:52:40 +00:00
|
|
|
#define COGL_CHECK_GL_VERSION(driver_major, driver_minor, \
|
|
|
|
target_major, target_minor) \
|
|
|
|
((driver_major) > (target_major) || \
|
|
|
|
((driver_major) == (target_major) && (driver_minor) >= (target_minor)))
|
|
|
|
|
2011-07-06 17:59:20 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
COGL_EXT_IN_GLES = (1 << 0),
|
|
|
|
COGL_EXT_IN_GLES2 = (1 << 1)
|
|
|
|
} CoglExtGlesAvailability;
|
|
|
|
|
2009-11-17 13:52:40 +00:00
|
|
|
typedef struct _CoglFeatureFunction CoglFeatureFunction;
|
|
|
|
|
|
|
|
struct _CoglFeatureFunction
|
|
|
|
{
|
|
|
|
/* The name of the function without the "EXT" or "ARB" suffix */
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-10 01:57:32 +00:00
|
|
|
const char *name;
|
2009-11-17 13:52:40 +00:00
|
|
|
/* The offset in the context of where to store the function pointer */
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-10 01:57:32 +00:00
|
|
|
unsigned int pointer_offset;
|
2009-11-17 13:52:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _CoglFeatureData CoglFeatureData;
|
|
|
|
|
|
|
|
struct _CoglFeatureData
|
|
|
|
{
|
|
|
|
/* A minimum GL version which the functions should be defined in
|
|
|
|
without needing an extension. Set to 255,255 if it's only
|
|
|
|
provided in an extension */
|
2011-07-06 17:59:20 +00:00
|
|
|
int min_gl_major, min_gl_minor;
|
|
|
|
/* Flags specifying which versions of GLES the feature is available
|
|
|
|
in core in */
|
|
|
|
CoglExtGlesAvailability gles_availability;
|
2009-11-17 13:52:40 +00:00
|
|
|
/* \0 separated list of namespaces to try. Eg "EXT\0ARB\0" */
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-10 01:57:32 +00:00
|
|
|
const char *namespaces;
|
2009-11-17 13:52:40 +00:00
|
|
|
/* \0 separated list of required extension names without the GL_EXT
|
2011-07-06 17:59:20 +00:00
|
|
|
or GL_ARB prefix. Any of the extensions must be available for the
|
2009-11-17 13:52:40 +00:00
|
|
|
feature to be considered available. If the suffix for an
|
|
|
|
extension is different from the namespace, you can specify it
|
|
|
|
with a ':' after the namespace */
|
cogl: improves header and coding style consistency
We've had complaints that our Cogl code/headers are a bit "special" so
this is a first pass at tidying things up by giving them some
consistency. These changes are all consistent with how new code in Cogl
is being written, but the style isn't consistently applied across all
code yet.
There are two parts to this patch; but since each one required a large
amount of effort to maintain tidy indenting it made sense to combine the
changes to reduce the time spent re indenting the same lines.
The first change is to use a consistent style for declaring function
prototypes in headers. Cogl headers now consistently use this style for
prototypes:
return_type
cogl_function_name (CoglType arg0,
CoglType arg1);
Not everyone likes this style, but it seems that most of the currently
active Cogl developers agree on it.
The second change is to constrain the use of redundant glib data types
in Cogl. Uses of gint, guint, gfloat, glong, gulong and gchar have all
been replaced with int, unsigned int, float, long, unsigned long and char
respectively. When talking about pixel data; use of guchar has been
replaced with guint8, otherwise unsigned char can be used.
The glib types that we continue to use for portability are gboolean,
gint{8,16,32,64}, guint{8,16,32,64} and gsize.
The general intention is that Cogl should look palatable to the widest
range of C programmers including those outside the Gnome community so
- especially for the public API - we want to minimize the number of
foreign looking typedefs.
2010-02-10 01:57:32 +00:00
|
|
|
const char *extension_names;
|
2009-11-17 13:52:40 +00:00
|
|
|
/* A set of feature flags to enable if the extension is available */
|
|
|
|
CoglFeatureFlags feature_flags;
|
2011-05-24 16:21:28 +00:00
|
|
|
/* A set of private feature flags to enable if the extension is
|
|
|
|
* available */
|
|
|
|
int feature_flags_private;
|
2010-11-05 12:28:33 +00:00
|
|
|
/* An optional corresponding winsys feature. */
|
|
|
|
CoglWinsysFeature winsys_feature;
|
2009-11-17 13:52:40 +00:00
|
|
|
/* A list of functions required for this feature. Terminated with a
|
|
|
|
NULL name */
|
|
|
|
const CoglFeatureFunction *functions;
|
|
|
|
};
|
|
|
|
|
2010-11-05 12:28:33 +00:00
|
|
|
gboolean
|
2011-05-24 00:38:48 +00:00
|
|
|
_cogl_feature_check (const CoglWinsysVtable *winsys,
|
|
|
|
const char *driver_prefix,
|
2010-11-05 12:28:33 +00:00
|
|
|
const CoglFeatureData *data,
|
2011-07-06 17:59:20 +00:00
|
|
|
int gl_major,
|
|
|
|
int gl_minor,
|
2011-07-07 19:44:56 +00:00
|
|
|
CoglDriver driver,
|
2010-11-05 12:28:33 +00:00
|
|
|
const char *extensions_string,
|
|
|
|
void *function_table);
|
2009-11-17 13:52:40 +00:00
|
|
|
|
2011-07-06 17:59:20 +00:00
|
|
|
void
|
|
|
|
_cogl_feature_check_ext_functions (CoglContext *context,
|
|
|
|
int gl_major,
|
|
|
|
int gl_minor,
|
2011-07-07 19:44:56 +00:00
|
|
|
const char *gl_extensions);
|
2011-07-06 17:59:20 +00:00
|
|
|
|
2009-11-17 13:52:40 +00:00
|
|
|
#endif /* __COGL_FEATURE_PRIVATE_H */
|