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 LIBGLESV2_MAIN_H_
10#define LIBGLESV2_MAIN_H_
11
12#define GL_APICALL
13#include <GLES2/gl2.h>
14#include <GLES2/gl2ext.h>
15
16#include "common/debug.h"
17#include "libEGL/Display.h"
18
19#include "libGLESv2/Context.h"
20
21namespace gl
22{
23struct Current
24{
25    Context *context;
26    egl::Display *display;
27};
28
29void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface);
30
31Context *getContext();
32egl::Display *getDisplay();
33
34IDirect3DDevice9 *getDevice();
35}
36
37void error(GLenum errorCode);
38
39template<class T>
40const T &error(GLenum errorCode, const T &returnValue)
41{
42    error(errorCode);
43
44    return returnValue;
45}
46
47#endif   // LIBGLESV2_MAIN_H_
48