blob: 34092b02412ef270a465d203a554ae795b1c9f9d [file] [log] [blame]
Nicolas Capens0bac2852016-05-07 06:09:58 -04001// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
Nicolas Capensdbf6fc82014-10-23 13:33:20 -04002//
Nicolas Capens0bac2852016-05-07 06:09:58 -04003// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
Nicolas Capensdbf6fc82014-10-23 13:33:20 -04006//
Nicolas Capens0bac2852016-05-07 06:09:58 -04007// http://www.apache.org/licenses/LICENSE-2.0
Nicolas Capensdbf6fc82014-10-23 13:33:20 -04008//
Nicolas Capens0bac2852016-05-07 06:09:58 -04009// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040014
15// main.h: Management of thread-local data.
16
Nicolas Capens11157822014-10-23 23:00:29 -040017#ifndef LIBGLES_CM_MAIN_H_
18#define LIBGLES_CM_MAIN_H_
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040019
20#include "Context.h"
21#include "Device.hpp"
22#include "common/debug.h"
Nicolas Capensa2308052015-04-15 16:50:21 -040023#include "libEGL/libEGL.hpp"
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040024#include "libEGL/Display.h"
25
Nicolas Capens11157822014-10-23 23:00:29 -040026#include <GLES/gl.h>
Nicolas Capens11157822014-10-23 23:00:29 -040027#include <GLES/glext.h>
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040028
Nicolas Capens14ee7622014-10-28 23:48:41 -040029namespace es1
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040030{
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040031 Context *getContext();
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040032 Device *getDevice();
Nicolas Capensa2308052015-04-15 16:50:21 -040033
34 void error(GLenum errorCode);
35
36 template<class T>
37 const T &error(GLenum errorCode, const T &returnValue)
38 {
39 error(errorCode);
40
41 return returnValue;
42 }
Nicolas Capensdbf6fc82014-10-23 13:33:20 -040043}
44
Nicolas Capensa2308052015-04-15 16:50:21 -040045extern LibEGL libEGL;
Nicolas Capensafd1f9f2014-10-28 02:53:50 -040046
Nicolas Capens11157822014-10-23 23:00:29 -040047#endif // LIBGLES_CM_MAIN_H_