Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 2 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame] | 6 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 8 | // |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 14 | |
| 15 | // main.h: Management of thread-local data. |
| 16 | |
| 17 | #ifndef LIBGLESV2_MAIN_H_ |
| 18 | #define LIBGLESV2_MAIN_H_ |
| 19 | |
| 20 | #include "Context.h" |
| 21 | #include "Device.hpp" |
| 22 | #include "common/debug.h" |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 23 | #include "libEGL/libEGL.hpp" |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 24 | #include "libEGL/Display.h" |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 25 | #include "libGLES_CM/libGLES_CM.hpp" |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 26 | |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 27 | #include <GLES2/gl2.h> |
| 28 | #include <GLES2/gl2ext.h> |
Alexis Hetu | fceb183 | 2015-03-10 16:42:04 -0400 | [diff] [blame] | 29 | #include <GLES3/gl3.h> |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 30 | |
Nicolas Capens | 14ee762 | 2014-10-28 23:48:41 -0400 | [diff] [blame] | 31 | namespace es2 |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 32 | { |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 33 | Context *getContext(); |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 34 | Device *getDevice(); |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 35 | |
| 36 | void error(GLenum errorCode); |
| 37 | |
| 38 | template<class T> |
| 39 | const T &error(GLenum errorCode, const T &returnValue) |
| 40 | { |
| 41 | error(errorCode); |
| 42 | |
| 43 | return returnValue; |
| 44 | } |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 45 | } |
| 46 | |
Nicolas Capens | d76b5df | 2014-10-28 15:54:46 -0400 | [diff] [blame] | 47 | namespace egl |
| 48 | { |
| 49 | GLint getClientVersion(); |
| 50 | } |
| 51 | |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 52 | extern LibEGL libEGL; |
| 53 | extern LibGLES_CM libGLES_CM; |
Nicolas Capens | afd1f9f | 2014-10-28 02:53:50 -0400 | [diff] [blame] | 54 | |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 55 | #endif // LIBGLESV2_MAIN_H_ |