1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/libGLESv2/main.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 1.4 +// 1.5 +// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +// main.h: Management of thread-local data. 1.11 + 1.12 +#ifndef LIBGLESV2_MAIN_H_ 1.13 +#define LIBGLESV2_MAIN_H_ 1.14 + 1.15 +#include "common/debug.h" 1.16 +#include "common/system.h" 1.17 + 1.18 +namespace egl 1.19 +{ 1.20 +class Display; 1.21 +class Surface; 1.22 +} 1.23 + 1.24 +namespace gl 1.25 +{ 1.26 +class Context; 1.27 + 1.28 +struct Current 1.29 +{ 1.30 + Context *context; 1.31 + egl::Display *display; 1.32 +}; 1.33 + 1.34 +void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface); 1.35 + 1.36 +Context *getContext(); 1.37 +Context *getNonLostContext(); 1.38 +egl::Display *getDisplay(); 1.39 + 1.40 +void error(GLenum errorCode); 1.41 + 1.42 +template<class T> 1.43 +const T &error(GLenum errorCode, const T &returnValue) 1.44 +{ 1.45 + error(errorCode); 1.46 + 1.47 + return returnValue; 1.48 +} 1.49 + 1.50 +} 1.51 + 1.52 +namespace rx 1.53 +{ 1.54 +class Renderer; 1.55 +} 1.56 + 1.57 +extern "C" 1.58 +{ 1.59 +// Exported functions for use by EGL 1.60 +gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess); 1.61 +void glDestroyContext(gl::Context *context); 1.62 +void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface); 1.63 +gl::Context *glGetCurrentContext(); 1.64 +rx::Renderer *glCreateRenderer(egl::Display *display, HDC hDc, EGLNativeDisplayType displayId); 1.65 +void glDestroyRenderer(rx::Renderer *renderer); 1.66 + 1.67 +__eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname); 1.68 +bool __stdcall glBindTexImage(egl::Surface *surface); 1.69 +} 1.70 + 1.71 +#endif // LIBGLESV2_MAIN_H_