blob: 3f2fa78c58fd47151b6d7c8bd9d6b39751506560 [file] [log] [blame]
Nicolas Capens0bac2852016-05-07 06:09:58 -04001// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
John Bauman89401822014-05-06 15:04:28 -04002//
Nicolas Capens0bac2852016-05-07 06:09:58 -04003// 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 Bauman19bac1e2014-05-06 15:23:49 -04006//
Nicolas Capens0bac2852016-05-07 06:09:58 -04007// http://www.apache.org/licenses/LICENSE-2.0
John Bauman89401822014-05-06 15:04:28 -04008//
Nicolas Capens0bac2852016-05-07 06:09:58 -04009// 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 Bauman89401822014-05-06 15:04:28 -040014
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 Capensa2308052015-04-15 16:50:21 -040023#include "libEGL/libEGL.hpp"
John Bauman89401822014-05-06 15:04:28 -040024#include "libEGL/Display.h"
Nicolas Capensa2308052015-04-15 16:50:21 -040025#include "libGLES_CM/libGLES_CM.hpp"
John Bauman89401822014-05-06 15:04:28 -040026
John Bauman89401822014-05-06 15:04:28 -040027#include <GLES2/gl2.h>
28#include <GLES2/gl2ext.h>
Alexis Hetufceb1832015-03-10 16:42:04 -040029#include <GLES3/gl3.h>
John Bauman89401822014-05-06 15:04:28 -040030
Nicolas Capens14ee7622014-10-28 23:48:41 -040031namespace es2
John Bauman89401822014-05-06 15:04:28 -040032{
John Bauman89401822014-05-06 15:04:28 -040033 Context *getContext();
John Bauman89401822014-05-06 15:04:28 -040034 Device *getDevice();
Nicolas Capensa2308052015-04-15 16:50:21 -040035
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 Bauman89401822014-05-06 15:04:28 -040045}
46
Nicolas Capensd76b5df2014-10-28 15:54:46 -040047namespace egl
48{
49 GLint getClientVersion();
50}
51
Nicolas Capensa2308052015-04-15 16:50:21 -040052extern LibEGL libEGL;
53extern LibGLES_CM libGLES_CM;
Nicolas Capensafd1f9f2014-10-28 02:53:50 -040054
John Bauman89401822014-05-06 15:04:28 -040055#endif // LIBGLESV2_MAIN_H_