michael@0: // michael@0: // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // main.h: Management of thread-local data. michael@0: michael@0: #ifndef LIBGLESV2_MAIN_H_ michael@0: #define LIBGLESV2_MAIN_H_ michael@0: michael@0: #include "common/debug.h" michael@0: #include "common/system.h" michael@0: michael@0: namespace egl michael@0: { michael@0: class Display; michael@0: class Surface; michael@0: } michael@0: michael@0: namespace gl michael@0: { michael@0: class Context; michael@0: michael@0: struct Current michael@0: { michael@0: Context *context; michael@0: egl::Display *display; michael@0: }; michael@0: michael@0: void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface); michael@0: michael@0: Context *getContext(); michael@0: Context *getNonLostContext(); michael@0: egl::Display *getDisplay(); michael@0: michael@0: void error(GLenum errorCode); michael@0: michael@0: template michael@0: const T &error(GLenum errorCode, const T &returnValue) michael@0: { michael@0: error(errorCode); michael@0: michael@0: return returnValue; michael@0: } michael@0: michael@0: } michael@0: michael@0: namespace rx michael@0: { michael@0: class Renderer; michael@0: } michael@0: michael@0: extern "C" michael@0: { michael@0: // Exported functions for use by EGL michael@0: gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess); michael@0: void glDestroyContext(gl::Context *context); michael@0: void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface); michael@0: gl::Context *glGetCurrentContext(); michael@0: rx::Renderer *glCreateRenderer(egl::Display *display, HDC hDc, EGLNativeDisplayType displayId); michael@0: void glDestroyRenderer(rx::Renderer *renderer); michael@0: michael@0: __eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname); michael@0: bool __stdcall glBindTexImage(egl::Surface *surface); michael@0: } michael@0: michael@0: #endif // LIBGLESV2_MAIN_H_