~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/ThirdParty/ANGLE/src/libEGL/main.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 
3
// Use of this source code is governed by a BSD-style license that can be
 
4
// found in the LICENSE file.
 
5
//
 
6
 
 
7
// main.h: Management of thread-local data.
 
8
 
 
9
#ifndef LIBEGL_MAIN_H_
 
10
#define LIBEGL_MAIN_H_
 
11
 
 
12
#define EGLAPI
 
13
#include <EGL/egl.h>
 
14
#include <EGL/eglext.h>
 
15
 
 
16
namespace egl
 
17
{
 
18
struct Current
 
19
{
 
20
    EGLint error;
 
21
    EGLenum API;
 
22
    EGLDisplay display;
 
23
    EGLSurface drawSurface;
 
24
    EGLSurface readSurface;
 
25
};
 
26
 
 
27
void setCurrentError(EGLint error);
 
28
EGLint getCurrentError();
 
29
 
 
30
void setCurrentAPI(EGLenum API);
 
31
EGLenum getCurrentAPI();
 
32
 
 
33
void setCurrentDisplay(EGLDisplay dpy);
 
34
EGLDisplay getCurrentDisplay();
 
35
 
 
36
void setCurrentDrawSurface(EGLSurface surface);
 
37
EGLSurface getCurrentDrawSurface();
 
38
 
 
39
void setCurrentReadSurface(EGLSurface surface);
 
40
EGLSurface getCurrentReadSurface();
 
41
}
 
42
 
 
43
void error(EGLint errorCode);
 
44
 
 
45
template<class T>
 
46
const T &error(EGLint errorCode, const T &returnValue)
 
47
{
 
48
    error(errorCode);
 
49
 
 
50
    return returnValue;
 
51
}
 
52
 
 
53
template<class T>
 
54
const T &success(const T &returnValue)
 
55
{
 
56
    egl::setCurrentError(EGL_SUCCESS);
 
57
 
 
58
    return returnValue;
 
59
}
 
60
 
 
61
#endif  // LIBEGL_MAIN_H_