2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 #ifndef UTIL_EGLWINDOW_H_
8 #define UTIL_EGLWINDOW_H_
10 #define GL_GLEXT_PROTOTYPES
12 #include <GLES3/gl3.h>
13 #include <GLES3/gl3ext.h>
14 #include <GLES2/gl2.h>
15 #include <GLES2/gl2ext.h>
17 #include <EGL/eglext.h>
24 #include "shared_utils.h"
31 EGLWindow(size_t width, size_t height,
32 EGLint glesMajorVersion = 2,
33 EGLint requestedRenderer = EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
37 void setClientVersion(EGLint glesMajorVersion) { mClientVersion = glesMajorVersion; }
38 void setWidth(size_t width) { mWidth = width; }
39 void setHeight(size_t height) { mHeight = height; }
40 void setConfigRedBits(int bits) { mRedBits = bits; }
41 void setConfigGreenBits(int bits) { mGreenBits = bits; }
42 void setConfigBlueBits(int bits) { mBlueBits = bits; }
43 void setConfigAlphaBits(int bits) { mAlphaBits = bits; }
44 void setConfigDepthBits(int bits) { mDepthBits = bits; }
45 void setConfigStencilBits(int bits) { mStencilBits = bits; }
46 void setMultisample(bool multisample) { mMultisample = multisample; }
47 void setSwapInterval(EGLint swapInterval) { mSwapInterval = swapInterval; }
51 GLuint getClientVersion() const { return mClientVersion; }
52 EGLConfig getConfig() const;
53 EGLDisplay getDisplay() const;
54 EGLSurface getSurface() const;
55 EGLContext getContext() const;
56 size_t getWidth() const { return mWidth; }
57 size_t getHeight() const { return mHeight; }
58 int getConfigRedBits() const { return mRedBits; }
59 int getConfigGreenBits() const { return mGreenBits; }
60 int getConfigBlueBits() const { return mBlueBits; }
61 int getConfigAlphaBits() const { return mAlphaBits; }
62 int getConfigDepthBits() const { return mDepthBits; }
63 int getConfigStencilBits() const { return mStencilBits; }
64 bool isMultisample() const { return mMultisample; }
65 EGLint getSwapInterval() const { return mSwapInterval; }
67 bool initializeGL(const OSWindow *osWindow);
71 DISALLOW_COPY_AND_ASSIGN(EGLWindow);
78 GLuint mClientVersion;
79 EGLint mRequestedRenderer;
92 #endif // UTIL_EGLWINDOW_H_