• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
2 //
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
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
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"
23 #include "libEGL/libEGL.hpp"
24 #include "libEGL/Display.h"
25 #include "libGLES_CM/libGLES_CM.hpp"
26 
27 #include <GLES2/gl2.h>
28 #include <GLES2/gl2ext.h>
29 #include <GLES3/gl3.h>
30 
31 namespace es2
32 {
33 	Context *getContextLocked();
34 	ContextPtr getContext();
35 	Device *getDevice();
36 
37 	void error(GLenum errorCode);
38 
39 	template<class T>
error(GLenum errorCode,const T & returnValue)40 	const T &error(GLenum errorCode, const T &returnValue)
41 	{
42 		error(errorCode);
43 
44 		return returnValue;
45 	}
46 }
47 
48 namespace egl
49 {
50 	GLint getClientVersion();
51 }
52 
53 extern LibEGL libEGL;
54 extern LibGLES_CM libGLES_CM;
55 
56 #endif   // LIBGLESV2_MAIN_H_
57