• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2018 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.
5 //
6 // util_gl.h: Includes the right GL/EGL headers for static/shared link.
7 
8 #ifndef UTIL_GL_H_
9 #define UTIL_GL_H_
10 
11 #include "common/platform.h"
12 
13 #if defined(ANGLE_USE_UTIL_LOADER)
14 #    include "util/egl_loader_autogen.h"
15 #    include "util/gles_loader_autogen.h"
16 #    if defined(ANGLE_PLATFORM_WINDOWS) && !defined(ANGLE_ENABLE_WINDOWS_UWP)
17 #        include "util/windows/wgl_loader_autogen.h"
18 #    endif  // defined(ANGLE_PLATFORM_WINDOWS) && !defined(ANGLE_ENABLE_WINDOWS_UWP)
19 #else
20 
21 #    if !defined(GL_GLES_PROTOTYPES)
22 #        error Config error. Should either be using the ANGLE GL loader or header prototypes.
23 #    endif  // !defined(GL_GLES_PROTOTYPES)
24 
25 #    include <EGL/egl.h>
26 #    include <EGL/eglext.h>
27 #    include "angle_gl.h"
28 #endif  // defined(ANGLE_USE_UTIL_LOADER)
29 
30 #include <string>
31 
32 namespace angle
33 {
CheckExtensionExists(const char * allExtensions,const std::string & extName)34 inline bool CheckExtensionExists(const char *allExtensions, const std::string &extName)
35 {
36     const std::string paddedExtensions = std::string(" ") + allExtensions + std::string(" ");
37     return paddedExtensions.find(std::string(" ") + extName + std::string(" ")) !=
38            std::string::npos;
39 }
40 }  // namespace angle
41 #endif  // UTIL_GL_H_
42