summaryrefslogtreecommitdiff
path: root/src/render/naclglfunctions.h
blob: 83757f07c0b48735954df69b5e20f68f25095987 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 *  The ManaPlus Client
 *  Copyright (C) 2014-2015  The ManaPlus Developers
 *
 *  This file is part of The ManaPlus Client.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef RENDER_NACLGLFUNCTIONS_H
#define RENDER_NACLGLFUNCTIONS_H

#if defined(__native_client__) && defined(USE_OPENGL)

#include <ppapi/c/ppb_opengles2.h>

extern const struct PPB_OpenGLES2* gles2Interface;
extern PP_Resource gles2Context;

#define mglDrawArrays(...) \
    gles2Interface->DrawArrays(gles2Context, __VA_ARGS__)
#define mglEnableVertexAttribArray(...) \
    gles2Interface->EnableVertexAttribArray(gles2Context, __VA_ARGS__)
#define mglVertexAttribPointer(...) \
    gles2Interface->VertexAttribPointer(gles2Context, __VA_ARGS__)
#define mglUseProgram(...) \
    gles2Interface->UseProgram(gles2Context, __VA_ARGS__)
#define mglViewport(...) \
    gles2Interface->Viewport(gles2Context, __VA_ARGS__)
#define mglGenBuffers(...) \
    gles2Interface->GenBuffers(gles2Context, __VA_ARGS__)
#define mglBindBuffer(...) \
    gles2Interface->BindBuffer(gles2Context, __VA_ARGS__)
#define mglBufferData(...) \
    gles2Interface->BufferData(gles2Context, __VA_ARGS__)
#define mglDeleteBuffers(...) \
    gles2Interface->DeleteBuffers(gles2Context, __VA_ARGS__)
#define mglGetUniformLocation(...) \
    gles2Interface->GetUniformLocation(gles2Context, __VA_ARGS__)
#define mglCreateShader(...) \
    gles2Interface->CreateShader(gles2Context, __VA_ARGS__)
#define mglShaderSource(...) \
    gles2Interface->ShaderSource(gles2Context, __VA_ARGS__)
#define mglCompileShader(...) \
    gles2Interface->CompileShader(gles2Context, __VA_ARGS__)
#define mglGetShaderiv(...) \
    gles2Interface->GetShaderiv(gles2Context, __VA_ARGS__)
#define mglAttachShader(...) \
    gles2Interface->AttachShader(gles2Context, __VA_ARGS__)
#define mglBindAttribLocation(...) \
    gles2Interface->BindAttribLocation(gles2Context, __VA_ARGS__)
#define mglLinkProgram(...) \
    gles2Interface->LinkProgram(gles2Context, __VA_ARGS__)
#define mglGetProgramiv(...) \
    gles2Interface->GetProgramiv(gles2Context, __VA_ARGS__)
#define mglClearColor(...) \
    gles2Interface->ClearColor(gles2Context, __VA_ARGS__)
#define mglUniform1f(...) \
    gles2Interface->Uniform1f(gles2Context, __VA_ARGS__)
#define mglUniform2f(...) \
    gles2Interface->Uniform2f(gles2Context, __VA_ARGS__)
#define mglUniform4f(...) \
    gles2Interface->Uniform4f(gles2Context, __VA_ARGS__)
#define mglActiveTexture(...) \
    gles2Interface->ActiveTexture(gles2Context, __VA_ARGS__)
#define mglBindTexture(...) \
    gles2Interface->BindTexture(gles2Context, __VA_ARGS__)
#define mglEnable(...) \
    gles2Interface->Enable(gles2Context, __VA_ARGS__)
#define mglClear(...) \
    gles2Interface->Clear(gles2Context, __VA_ARGS__)
#define mglValidateProgram(...) \
    gles2Interface->ValidateProgram(gles2Context, __VA_ARGS__)
#define mglDeleteProgram(...) \
    gles2Interface->DeleteProgram(gles2Context, __VA_ARGS__)
#define mglCreateProgram() \
    gles2Interface->CreateProgram(gles2Context)
#define mglGetProgramInfoLog(...) \
    gles2Interface->GetProgramInfoLog(gles2Context, __VA_ARGS__)
#define mglDisable(...) \
    gles2Interface->Disable(gles2Context, __VA_ARGS__)
#define mglHint(...) \
    gles2Interface->Hint(gles2Context, __VA_ARGS__)
#define mglScissor(...) \
    gles2Interface->Scissor(gles2Context, __VA_ARGS__)
#define mglEnable(...) \
    gles2Interface->Enable(gles2Context, __VA_ARGS__)
#define mglGetIntegerv(...) \
    gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__)

#endif  // defined(__native_client__) && defined(USE_OPENGL)
#endif  // RENDER_NACLGLFUNCTIONS_H