Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -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 |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -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 |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -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. |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 14 | |
| 15 | // main.h: Management of thread-local data. |
| 16 | |
Nicolas Capens | 1115782 | 2014-10-23 23:00:29 -0400 | [diff] [blame] | 17 | #ifndef LIBGLES_CM_MAIN_H_ |
| 18 | #define LIBGLES_CM_MAIN_H_ |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 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" |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 24 | #include "libEGL/Display.h" |
| 25 | |
Nicolas Capens | 1115782 | 2014-10-23 23:00:29 -0400 | [diff] [blame] | 26 | #include <GLES/gl.h> |
Nicolas Capens | 1115782 | 2014-10-23 23:00:29 -0400 | [diff] [blame] | 27 | #include <GLES/glext.h> |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 28 | |
Nicolas Capens | 14ee762 | 2014-10-28 23:48:41 -0400 | [diff] [blame] | 29 | namespace es1 |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 30 | { |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 31 | Context *getContext(); |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 32 | Device *getDevice(); |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 33 | |
| 34 | void error(GLenum errorCode); |
| 35 | |
| 36 | template<class T> |
| 37 | const T &error(GLenum errorCode, const T &returnValue) |
| 38 | { |
| 39 | error(errorCode); |
| 40 | |
| 41 | return returnValue; |
| 42 | } |
Nicolas Capens | dbf6fc8 | 2014-10-23 13:33:20 -0400 | [diff] [blame] | 43 | } |
| 44 | |
Nicolas Capens | a230805 | 2015-04-15 16:50:21 -0400 | [diff] [blame] | 45 | extern LibEGL libEGL; |
Nicolas Capens | afd1f9f | 2014-10-28 02:53:50 -0400 | [diff] [blame] | 46 | |
Nicolas Capens | 1115782 | 2014-10-23 23:00:29 -0400 | [diff] [blame] | 47 | #endif // LIBGLES_CM_MAIN_H_ |