1 // SwiftShader Software Renderer
3 // Copyright(c) 2005-2012 TransGaming Inc.
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.
12 // main.h: Management of thread-local data.
14 #ifndef LIBEGL_MAIN_H_
15 #define LIBEGL_MAIN_H_
19 #include <EGL/eglext.h>
30 EGLSurface drawSurface;
31 EGLSurface readSurface;
34 void setCurrentError(EGLint error);
35 EGLint getCurrentError();
37 void setCurrentAPI(EGLenum API);
38 EGLenum getCurrentAPI();
40 void setCurrentDisplay(EGLDisplay dpy);
41 EGLDisplay getCurrentDisplay();
43 void setCurrentContext(EGLContext ctx);
44 EGLContext getCurrentContext();
46 void setCurrentDrawSurface(EGLSurface surface);
47 EGLSurface getCurrentDrawSurface();
49 void setCurrentReadSurface(EGLSurface surface);
50 EGLSurface getCurrentReadSurface();
53 void error(EGLint errorCode);
56 const T &error(EGLint errorCode, const T &returnValue)
64 const T &success(const T &returnValue)
66 egl::setCurrentError(EGL_SUCCESS);
83 enum Format : unsigned char;
86 // libRAD dependencies
89 extern egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext);
91 extern egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
92 extern egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
93 extern sw::FrameBuffer *(*createFrameBuffer)(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
98 extern __eglMustCastToProperFunctionPointerType (RADAPIENTRY *getProcAddress)(const char *procname);
101 extern void *libRAD; // Handle to the libRAD module
103 #endif // LIBEGL_MAIN_H_