4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
24
#ifndef __COGL_INTERNAL_H
25
#define __COGL_INTERNAL_H
27
#include "cogl-bitmask.h"
28
#include "cogl-gl-header.h"
30
#ifdef COGL_HAS_XLIB_SUPPORT
31
#include <X11/Xutil.h>
37
_cogl_gl_error_to_string (GLenum error_code);
39
#define GE(ctx, x) G_STMT_START { \
42
while ((__err = (ctx)->glGetError ()) != GL_NO_ERROR) \
44
g_warning ("%s: GL error (%d): %s\n", \
47
_cogl_gl_error_to_string (__err)); \
50
#define GE_RET(ret, ctx, x) G_STMT_START { \
53
while ((__err = (ctx)->glGetError ()) != GL_NO_ERROR) \
55
g_warning ("%s: GL error (%d): %s\n", \
58
_cogl_gl_error_to_string (__err)); \
61
#else /* !COGL_GL_DEBUG */
63
#define GE(ctx, x) ((ctx)->x)
64
#define GE_RET(ret, ctx, x) (ret = ((ctx)->x))
66
#endif /* COGL_GL_DEBUG */
68
#define COGL_ENABLE_ALPHA_TEST (1<<1)
69
#define COGL_ENABLE_VERTEX_ARRAY (1<<2)
70
#define COGL_ENABLE_COLOR_ARRAY (1<<3)
73
_cogl_enable (unsigned long flags);
76
_cogl_get_enable (void);
79
_cogl_transform_point (const CoglMatrix *matrix_mv,
80
const CoglMatrix *matrix_p,
81
const float *viewport,
85
#define COGL_DRIVER_ERROR (_cogl_driver_error_quark ())
87
typedef enum { /*< prefix=COGL_DRIVER_ERROR >*/
88
COGL_DRIVER_ERROR_UNKNOWN_VERSION,
89
COGL_DRIVER_ERROR_INVALID_VERSION,
90
COGL_DRIVER_ERROR_NO_SUITABLE_DRIVER_FOUND,
91
COGL_DRIVER_ERROR_FAILED_TO_LOAD_LIBRARY
96
COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE = 1L<<0,
97
COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1,
98
COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2,
99
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT = 1L<<3,
100
COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4,
101
COGL_PRIVATE_FEATURE_PBOS = 1L<<5,
102
COGL_PRIVATE_FEATURE_VBOS = 1L<<6,
103
COGL_PRIVATE_FEATURE_EXT_PACKED_DEPTH_STENCIL = 1L<<7,
104
COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL = 1L<<8,
105
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888 = 1L<<9,
106
COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE = 1L<<10,
107
COGL_PRIVATE_FEATURE_SAMPLER_OBJECTS = 1L<<11
108
} CoglPrivateFeatureFlags;
110
/* Sometimes when evaluating pipelines, either during comparisons or
111
* if calculating a hash value we need to tweak the evaluation
113
typedef enum _CoglPipelineEvalFlags
115
COGL_PIPELINE_EVAL_FLAG_NONE = 0
116
} CoglPipelineEvalFlags;
119
_cogl_check_extension (const char *name, const char *ext);
122
_cogl_driver_error_quark (void);
124
#endif /* __COGL_INTERNAL_H */