1/*
2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef GLDefs_h
27#define GLDefs_h
28
29#define GL_GLEXT_PROTOTYPES 1
30
31#if USE(OPENGL_ES_2)
32#include "Extensions3DOpenGLES.h"
33#include "OpenGLESShims.h"
34#include <GLES2/gl2.h>
35#include <GLES2/gl2ext.h>
36#else
37#include "Extensions3DOpenGL.h"
38#include "OpenGLShims.h"
39#include <GL/gl.h>
40#include <GL/glext.h>
41#if USE(GLX)
42#define GLX_GLXEXT_PROTOTYPES 1
43#include <GL/glx.h>
44#include <GL/glxext.h>
45#endif
46#endif
47
48#if USE(EGL)
49#define EGL_EGLEXT_PROTOTYPES 1
50#include <EGL/egl.h>
51#include <EGL/eglext.h>
52#endif
53
54namespace WebCore {
55
56typedef uint32_t PlatformBufferHandle;
57
58#if USE(GLX)
59typedef GLXContext PlatformContext;
60typedef Display* PlatformDisplay;
61typedef GLXFBConfig PlatformSurfaceConfig;
62typedef GLXDrawable PlatformDrawable;
63#elif USE(EGL)
64#if USE(OPENGL_ES_2)
65static const EGLenum eglAPIVersion = EGL_OPENGL_ES_API;
66#else
67static const EGLenum eglAPIVersion = EGL_OPENGL_API;
68#endif
69typedef EGLContext PlatformContext;
70typedef EGLDisplay PlatformDisplay;
71typedef EGLConfig PlatformSurfaceConfig;
72typedef EGLSurface PlatformDrawable;
73#else
74typedef void* PlatformContext;
75typedef void* PlatformDisplay;
76typedef void* PlatformSurfaceConfig;
77typedef void* PlatformDrawable;
78#endif
79
80}
81
82#endif
83