4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2011 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_WINSYS_EGL_PRIVATE_H
25 #define __COGL_WINSYS_EGL_PRIVATE_H
27 #include "cogl-defines.h"
28 #include "cogl-winsys-private.h"
29 #include "cogl-context.h"
30 #include "cogl-context-private.h"
31 #include "cogl-framebuffer-private.h"
33 typedef struct _CoglWinsysEGLVtable
36 (* display_setup) (CoglDisplay *display,
39 (* display_destroy) (CoglDisplay *display);
42 (* try_create_context) (CoglDisplay *display,
47 (* context_created) (CoglDisplay *display,
51 (* cleanup_context) (CoglDisplay *display);
54 (* context_init) (CoglContext *context, GError **error);
57 (* context_deinit) (CoglContext *context);
60 (* onscreen_init) (CoglOnscreen *onscreen,
64 (* onscreen_deinit) (CoglOnscreen *onscreen);
67 (* add_config_attributes) (CoglDisplay *display,
68 CoglFramebufferConfig *config,
70 } CoglWinsysEGLVtable;
72 typedef enum _CoglEGLWinsysFeature
74 COGL_EGL_WINSYS_FEATURE_SWAP_REGION =1L<<0,
75 COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_X11_PIXMAP =1L<<1,
76 COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_WAYLAND_BUFFER =1L<<2,
77 COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL =1L<<3,
78 COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES1 =1L<<4,
79 COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES2 =1L<<5
80 } CoglEGLWinsysFeature;
82 typedef struct _CoglRendererEGL
84 CoglEGLWinsysFeature private_features;
88 EGLint egl_version_major;
89 EGLint egl_version_minor;
91 /* Data specific to the EGL platform */
93 /* vtable for platform specific parts */
94 const CoglWinsysEGLVtable *platform_vtable;
96 /* Function pointers for EGL specific extensions */
97 #define COGL_WINSYS_FEATURE_BEGIN(a, b, c, d)
99 #define COGL_WINSYS_FEATURE_FUNCTION(ret, name, args) \
100 ret (APIENTRY * pf_ ## name) args;
102 #define COGL_WINSYS_FEATURE_END()
104 #include "cogl-winsys-egl-feature-functions.h"
106 #undef COGL_WINSYS_FEATURE_BEGIN
107 #undef COGL_WINSYS_FEATURE_FUNCTION
108 #undef COGL_WINSYS_FEATURE_END
111 typedef struct _CoglDisplayEGL
113 EGLContext egl_context;
114 EGLSurface dummy_surface;
115 EGLSurface egl_surface;
117 EGLConfig egl_config;
118 gboolean found_egl_config;
119 gboolean stencil_disabled;
121 /* Platform specific display data */
125 typedef struct _CoglContextEGL
127 EGLSurface current_surface;
130 typedef struct _CoglOnscreenEGL
132 EGLSurface egl_surface;
134 /* Platform specific data */
138 const CoglWinsysVtable *
139 _cogl_winsys_egl_get_vtable (void);
141 #ifdef EGL_KHR_image_base
143 _cogl_egl_create_image (CoglContext *ctx,
145 EGLClientBuffer buffer,
146 const EGLint *attribs);
149 _cogl_egl_destroy_image (CoglContext *ctx,
154 _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
157 #endif /* __COGL_WINSYS_EGL_PRIVATE_H */