summaryrefslogtreecommitdiff
path: root/src/opengl/bind/c.bind
blob: 1cf6e80e08f49a0bbd997b455180200a0a5f091a (plain)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
int glCheckFramebufferStatus_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLenum bind_result = glCheckFramebufferStatus(target);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glCheckNamedFramebufferStatus_bind(lua_State *L)
{
	GLuint framebuffer = luaL_checkinteger(L, 1);
	GLenum target = luaL_checkinteger(L, 2);
	GLenum bind_result = glCheckNamedFramebufferStatus(framebuffer, target);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glClampColor_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLenum clamp = luaL_checkinteger(L, 2);
	glClampColor(target, clamp);
	return 0;
}


int glClear_bind(lua_State *L)
{
	GLbitfield mask = luaL_checkinteger(L, 1);
	glClear(mask);
	return 0;
}


int glClearBufferiv_bind(lua_State *L)
{
	GLenum buffer = luaL_checkinteger(L, 1);
	GLint drawbuffer = luaL_checkinteger(L, 2);
	const GLint * value = get: const GLint *
	glClearBufferiv(buffer, drawbuffer, value);
	return 0;
}


int glClearBufferuiv_bind(lua_State *L)
{
	GLenum buffer = luaL_checkinteger(L, 1);
	GLint drawbuffer = luaL_checkinteger(L, 2);
	const GLuint * value = get: const GLuint *
	glClearBufferuiv(buffer, drawbuffer, value);
	return 0;
}


int glClearBufferfv_bind(lua_State *L)
{
	GLenum buffer = luaL_checkinteger(L, 1);
	GLint drawbuffer = luaL_checkinteger(L, 2);
	const GLfloat * value = get: const GLfloat *
	glClearBufferfv(buffer, drawbuffer, value);
	return 0;
}


int glClearBufferfi_bind(lua_State *L)
{
	GLenum buffer = luaL_checkinteger(L, 1);
	GLint drawbuffer = luaL_checkinteger(L, 2);
	GLfloat depth = luaL_checknumber(L, 3);
	GLint stencil = luaL_checkinteger(L, 4);
	glClearBufferfi(buffer, drawbuffer, depth, stencil);
	return 0;
}


int glClearStencil_bind(lua_State *L)
{
	GLint s = luaL_checkinteger(L, 1);
	glClearStencil(s);
	return 0;
}


int glClientWaitSync_bind(lua_State *L)
{
	GLsync sync = luaL_checkinteger(L, 1);
	GLbitfield flags = luaL_checkinteger(L, 2);
	GLuint64 timeout = luaL_checkinteger(L, 3);
	GLenum bind_result = glClientWaitSync(sync, flags, timeout);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glColorMask_bind(lua_State *L)
{
	GLboolean red = get: GLboolean
	GLboolean green = get: GLboolean
	GLboolean blue = get: GLboolean
	GLboolean alpha = get: GLboolean
	glColorMask(red, green, blue, alpha);
	return 0;
}


int glColorMaski_bind(lua_State *L)
{
	GLuint buf = luaL_checkinteger(L, 1);
	GLboolean red = get: GLboolean
	GLboolean green = get: GLboolean
	GLboolean blue = get: GLboolean
	GLboolean alpha = get: GLboolean
	glColorMaski(buf, red, green, blue, alpha);
	return 0;
}


int glCompileShader_bind(lua_State *L)
{
	GLuint shader = luaL_checkinteger(L, 1);
	glCompileShader(shader);
	return 0;
}


int glCompressedTexImage1D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLenum internalformat = luaL_checkinteger(L, 3);
	GLsizei width = luaL_checkinteger(L, 4);
	GLint border = luaL_checkinteger(L, 5);
	GLsizei imageSize = luaL_checkinteger(L, 6);
	const void * data = get: const void *
	glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data);
	return 0;
}


int glCompressedTexImage2D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLenum internalformat = luaL_checkinteger(L, 3);
	GLsizei width = luaL_checkinteger(L, 4);
	GLsizei height = luaL_checkinteger(L, 5);
	GLint border = luaL_checkinteger(L, 6);
	GLsizei imageSize = luaL_checkinteger(L, 7);
	const void * data = get: const void *
	glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
	return 0;
}


int glCompressedTexImage3D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLenum internalformat = luaL_checkinteger(L, 3);
	GLsizei width = luaL_checkinteger(L, 4);
	GLsizei height = luaL_checkinteger(L, 5);
	GLsizei depth = luaL_checkinteger(L, 6);
	GLint border = luaL_checkinteger(L, 7);
	GLsizei imageSize = luaL_checkinteger(L, 8);
	const void * data = get: const void *
	glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
	return 0;
}


int glCompressedTexSubImage1D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLsizei width = luaL_checkinteger(L, 4);
	GLenum format = luaL_checkinteger(L, 5);
	GLsizei imageSize = luaL_checkinteger(L, 6);
	const void * data = get: const void *
	glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data);
	return 0;
}


int glCompressedTexSubImage2D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLint yoffset = luaL_checkinteger(L, 4);
	GLsizei width = luaL_checkinteger(L, 5);
	GLsizei height = luaL_checkinteger(L, 6);
	GLenum format = luaL_checkinteger(L, 7);
	GLsizei imageSize = luaL_checkinteger(L, 8);
	const void * data = get: const void *
	glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
	return 0;
}


int glCompressedTexSubImage3D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLint yoffset = luaL_checkinteger(L, 4);
	GLint zoffset = luaL_checkinteger(L, 5);
	GLsizei width = luaL_checkinteger(L, 6);
	GLsizei height = luaL_checkinteger(L, 7);
	GLsizei depth = luaL_checkinteger(L, 8);
	GLenum format = luaL_checkinteger(L, 9);
	GLsizei imageSize = luaL_checkinteger(L, 10);
	const void * data = get: const void *
	glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
	return 0;
}


int glCopyBufferSubData_bind(lua_State *L)
{
	GLenum readTarget = luaL_checkinteger(L, 1);
	GLenum writeTarget = luaL_checkinteger(L, 2);
	GLintptr readOffset = luaL_checkinteger(L, 3);
	GLintptr writeOffset = luaL_checkinteger(L, 4);
	GLsizeiptr size = luaL_checkinteger(L, 5);
	glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
	return 0;
}


int glCopyBufferSubData_bind(lua_State *L)
{
	GLenum readTarget = luaL_checkinteger(L, 1);
	GLenum writeTarget = luaL_checkinteger(L, 2);
	GLintptr readOffset = luaL_checkinteger(L, 3);
	GLintptr writeOffset = luaL_checkinteger(L, 4);
	GLsizeiptr size = luaL_checkinteger(L, 5);
	glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
	return 0;
}


int glCopyTexImage1D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLenum internalformat = luaL_checkinteger(L, 3);
	GLint x = luaL_checkinteger(L, 4);
	GLint y = luaL_checkinteger(L, 5);
	GLsizei width = luaL_checkinteger(L, 6);
	GLint border = luaL_checkinteger(L, 7);
	glCopyTexImage1D(target, level, internalformat, x, y, width, border);
	return 0;
}


int glCopyTexImage2D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLenum internalformat = luaL_checkinteger(L, 3);
	GLint x = luaL_checkinteger(L, 4);
	GLint y = luaL_checkinteger(L, 5);
	GLsizei width = luaL_checkinteger(L, 6);
	GLsizei height = luaL_checkinteger(L, 7);
	GLint border = luaL_checkinteger(L, 8);
	glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
	return 0;
}


int glCopyTexSubImage1D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLint x = luaL_checkinteger(L, 4);
	GLint y = luaL_checkinteger(L, 5);
	GLsizei width = luaL_checkinteger(L, 6);
	glCopyTexSubImage1D(target, level, xoffset, x, y, width);
	return 0;
}


int glCopyTexSubImage2D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLint yoffset = luaL_checkinteger(L, 4);
	GLint x = luaL_checkinteger(L, 5);
	GLint y = luaL_checkinteger(L, 6);
	GLsizei width = luaL_checkinteger(L, 7);
	GLsizei height = luaL_checkinteger(L, 8);
	glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
	return 0;
}


int glCopyTexSubImage3D_bind(lua_State *L)
{
	GLenum target = luaL_checkinteger(L, 1);
	GLint level = luaL_checkinteger(L, 2);
	GLint xoffset = luaL_checkinteger(L, 3);
	GLint yoffset = luaL_checkinteger(L, 4);
	GLint zoffset = luaL_checkinteger(L, 5);
	GLint x = luaL_checkinteger(L, 6);
	GLint y = luaL_checkinteger(L, 7);
	GLsizei width = luaL_checkinteger(L, 8);
	GLsizei height = luaL_checkinteger(L, 9);
	glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
	return 0;
}


int glCreateProgram_bind(lua_State *L)
{
	 void = get: 
	GLuint bind_result = glCreateProgram(void);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glCreateShader_bind(lua_State *L)
{
	GLenum shaderType = luaL_checkinteger(L, 1);
	GLuint bind_result = glCreateShader(shaderType);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glCreateShaderProgramv_bind(lua_State *L)
{
	GLenum type = luaL_checkinteger(L, 1);
	GLsizei count = luaL_checkinteger(L, 2);
	const char ** strings = get: const char **
	GLuint bind_result = glCreateShaderProgramv(type, count, strings);
	lua_pushinteger(L, bind_result);
	return 1;
}


int glCullFace_bind(lua_State *L)
{
	GLenum mode = luaL_checkinteger(L, 1);
	glCullFace(mode);
	return 0;
}