OSDN Git Service

6af62225c6fef7689d5f93a0f4347bd11a6d4449
[android-x86/external-swiftshader.git] / src / Radiance / libRAD / main.h
1 // SwiftShader Software Renderer
2 //
3 // Copyright(c) 2005-2012 TransGaming Inc.
4 //
5 // All rights reserved. No part of this software may be copied, distributed, transmitted,
6 // transcribed, stored in a retrieval system, translated into any human or computer
7 // language by any means, or disclosed to third parties without the explicit written
8 // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
9 // or implied, including but not limited to any patent rights, are granted to you.
10 //
11
12 // main.h: Management of thread-local data.
13
14 #ifndef LIBGLESV2_MAIN_H_
15 #define LIBGLESV2_MAIN_H_
16
17 #include "Context.h"
18 #include "Device.hpp"
19 #include "common/debug.h"
20 #include "libEGL/Display.h"
21
22 #define GL_APICALL
23 #include <GLES2/gl2.h>
24 #include <GLES2/gl2ext.h>
25
26 namespace rad
27 {
28         Context *getContext();
29         egl::Display *getDisplay();
30         Device *getDevice();
31 }
32
33 namespace egl
34 {
35         GLint getClientVersion();
36 }
37
38 void error(GLenum errorCode);
39
40 template<class T>
41 const T &error(GLenum errorCode, const T &returnValue)
42 {
43     error(errorCode);
44
45     return returnValue;
46 }
47
48 // libEGL dependencies
49 namespace egl
50 {
51         extern egl::Context *(*getCurrentContext)();
52         extern egl::Display *(*getCurrentDisplay)();
53 }
54
55 extern void *libEGL;       // Handle to the libEGL module
56
57 #endif   // LIBGLESV2_MAIN_H_