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"
29 #ifdef COGL_HAS_XLIB_SUPPORT
30 #include <X11/Xutil.h>
36 _cogl_gl_error_to_string (GLenum error_code);
38 #define GE(ctx, x) G_STMT_START { \
41 while ((__err = (ctx)->glGetError ()) != GL_NO_ERROR) \
43 g_warning ("%s: GL error (%d): %s\n", \
46 _cogl_gl_error_to_string (__err)); \
49 #define GE_RET(ret, ctx, x) G_STMT_START { \
52 while ((__err = (ctx)->glGetError ()) != GL_NO_ERROR) \
54 g_warning ("%s: GL error (%d): %s\n", \
57 _cogl_gl_error_to_string (__err)); \
60 #else /* !COGL_GL_DEBUG */
62 #define GE(ctx, x) ((ctx)->x)
63 #define GE_RET(ret, ctx, x) (ret = ((ctx)->x))
65 #endif /* COGL_GL_DEBUG */
67 #define COGL_ENABLE_ALPHA_TEST (1<<1)
68 #define COGL_ENABLE_VERTEX_ARRAY (1<<2)
69 #define COGL_ENABLE_COLOR_ARRAY (1<<3)
72 _cogl_enable (unsigned long flags);
75 _cogl_get_enable (void);
78 _cogl_transform_point (const CoglMatrix *matrix_mv,
79 const CoglMatrix *matrix_p,
80 const float *viewport,
84 #define COGL_DRIVER_ERROR (_cogl_driver_error_quark ())
86 typedef enum { /*< prefix=COGL_DRIVER_ERROR >*/
87 COGL_DRIVER_ERROR_UNKNOWN_VERSION,
88 COGL_DRIVER_ERROR_INVALID_VERSION,
89 COGL_DRIVER_ERROR_NO_SUITABLE_DRIVER_FOUND,
90 COGL_DRIVER_ERROR_FAILED_TO_LOAD_LIBRARY
95 COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE = 1L<<0,
96 COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1,
97 COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2,
98 COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT = 1L<<3,
99 COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4,
100 COGL_PRIVATE_FEATURE_PBOS = 1L<<5,
101 COGL_PRIVATE_FEATURE_VBOS = 1L<<6,
102 COGL_PRIVATE_FEATURE_EXT_PACKED_DEPTH_STENCIL = 1L<<7,
103 COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL = 1L<<8
104 } CoglPrivateFeatureFlags;
106 /* Sometimes when evaluating pipelines, either during comparisons or
107 * if calculating a hash value we need to tweak the evaluation
109 typedef enum _CoglPipelineEvalFlags
111 COGL_PIPELINE_EVAL_FLAG_NONE = 0
112 } CoglPipelineEvalFlags;
115 _cogl_check_extension (const char *name, const char *ext);
118 _cogl_driver_error_quark (void);
120 #endif /* __COGL_INTERNAL_H */