gfx/angle/src/libEGL/main.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libEGL/main.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-2010 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 LIBEGL_MAIN_H_
    1.13 +#define LIBEGL_MAIN_H_
    1.14 +
    1.15 +#define EGLAPI
    1.16 +#include <EGL/egl.h>
    1.17 +#include <EGL/eglext.h>
    1.18 +
    1.19 +namespace egl
    1.20 +{
    1.21 +struct Current
    1.22 +{
    1.23 +    EGLint error;
    1.24 +    EGLenum API;
    1.25 +    EGLDisplay display;
    1.26 +    EGLSurface drawSurface;
    1.27 +    EGLSurface readSurface;
    1.28 +};
    1.29 +
    1.30 +void setCurrentError(EGLint error);
    1.31 +EGLint getCurrentError();
    1.32 +
    1.33 +void setCurrentAPI(EGLenum API);
    1.34 +EGLenum getCurrentAPI();
    1.35 +
    1.36 +void setCurrentDisplay(EGLDisplay dpy);
    1.37 +EGLDisplay getCurrentDisplay();
    1.38 +
    1.39 +void setCurrentDrawSurface(EGLSurface surface);
    1.40 +EGLSurface getCurrentDrawSurface();
    1.41 +
    1.42 +void setCurrentReadSurface(EGLSurface surface);
    1.43 +EGLSurface getCurrentReadSurface();
    1.44 +
    1.45 +void error(EGLint errorCode);
    1.46 +
    1.47 +template<class T>
    1.48 +const T &error(EGLint errorCode, const T &returnValue)
    1.49 +{
    1.50 +    error(errorCode);
    1.51 +
    1.52 +    return returnValue;
    1.53 +}
    1.54 +
    1.55 +template<class T>
    1.56 +const T &success(const T &returnValue)
    1.57 +{
    1.58 +    egl::setCurrentError(EGL_SUCCESS);
    1.59 +
    1.60 +    return returnValue;
    1.61 +}
    1.62 +
    1.63 +}
    1.64 +
    1.65 +#endif  // LIBEGL_MAIN_H_

mercurial