-
Notifications
You must be signed in to change notification settings - Fork 11
/
gl_empty.go
515 lines (437 loc) · 19.9 KB
/
gl_empty.go
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
// This doesn't actually send anything to the graphics card. This is so that servers
// can use engo and other parts of the engine while being headless and not depending
// on the OpenGL library. Anything that does have a return, returns a zero-value
// of whatever's supposed to be returned, except returns true for booleans in case
// success checks are used.
//go:build nogl
// +build nogl
package gl
import (
"unsafe"
)
type Texture struct{ uint32 }
type Buffer struct{ uint32 }
type FrameBuffer struct{ uint32 }
type RenderBuffer struct{ uint32 }
type Program struct{ uint32 }
type UniformLocation struct{ int32 }
type Shader struct{ uint32 }
type Context struct {
ARRAY_BUFFER int
ARRAY_BUFFER_BINDING int
ATTACHED_SHADERS int
BACK int
BLEND int
BLEND_COLOR int
BLEND_DST_ALPHA int
BLEND_DST_RGB int
BLEND_EQUATION int
BLEND_EQUATION_ALPHA int
BLEND_EQUATION_RGB int
BLEND_SRC_ALPHA int
BLEND_SRC_RGB int
BLUE_BITS int
BOOL int
BOOL_VEC2 int
BOOL_VEC3 int
BOOL_VEC4 int
BROWSER_DEFAULT_WEBGL int
BUFFER_SIZE int
BUFFER_USAGE int
BYTE int
CCW int
CLAMP_TO_EDGE int
CLAMP_TO_BORDER int
COLOR_ATTACHMENT0 int
COLOR_BUFFER_BIT int
COLOR_CLEAR_VALUE int
COLOR_WRITEMASK int
COMPILE_STATUS uint32
COMPRESSED_TEXTURE_FORMATS int
CONSTANT_ALPHA int
CONSTANT_COLOR int
CONTEXT_LOST_WEBGL int
CULL_FACE int
CULL_FACE_MODE int
CURRENT_PROGRAM int
CURRENT_VERTEX_ATTRIB int
CW int
DECR int
DECR_WRAP int
DELETE_STATUS int
DEPTH_ATTACHMENT int
DEPTH_BITS int
DEPTH_BUFFER_BIT int
DEPTH_CLEAR_VALUE int
DEPTH_COMPONENT int
DEPTH_COMPONENT16 int
DEPTH_FUNC int
DEPTH_RANGE int
DEPTH_STENCIL int
DEPTH_STENCIL_ATTACHMENT int
DEPTH_TEST int
DEPTH_WRITEMASK int
DITHER int
DONT_CARE int
DST_ALPHA int
DST_COLOR int
DYNAMIC_DRAW int
ELEMENT_ARRAY_BUFFER int
ELEMENT_ARRAY_BUFFER_BINDING int
EQUAL int
FASTEST int
FLOAT int
FLOAT_MAT2 int
FLOAT_MAT3 int
FLOAT_MAT4 int
FLOAT_VEC2 int
FLOAT_VEC3 int
FLOAT_VEC4 int
FRAGMENT_SHADER int
FRAMEBUFFER int
FRAMEBUFFER_ATTACHMENT_OBJECT_NAME int
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE int
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE int
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL int
FRAMEBUFFER_BINDING int
FRAMEBUFFER_COMPLETE int
FRAMEBUFFER_INCOMPLETE_ATTACHMENT int
FRAMEBUFFER_INCOMPLETE_DIMENSIONS int
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT int
FRAMEBUFFER_UNSUPPORTED int
FRONT int
FRONT_AND_BACK int
FRONT_FACE int
FUNC_ADD int
FUNC_REVERSE_SUBTRACT int
FUNC_SUBTRACT int
GENERATE_MIPMAP_HINT int
GEQUAL int
GREATER int
GREEN_BITS int
HIGH_FLOAT int
HIGH_INT int
INCR int
INCR_WRAP int
INFO_LOG_LENGTH uint32
INT int
INT_VEC2 int
INT_VEC3 int
INT_VEC4 int
INVALID_ENUM int
INVALID_FRAMEBUFFER_OPERATION int
INVALID_OPERATION int
INVALID_VALUE int
INVERT int
KEEP int
LEQUAL int
LESS int
LINEAR int
LINEAR_MIPMAP_LINEAR int
LINEAR_MIPMAP_NEAREST int
LINES int
LINE_LOOP int
LINE_STRIP int
LINE_STIPPLE int
LINE_WIDTH int
LINK_STATUS int
LOW_FLOAT int
LOW_INT int
LUMINANCE int
LUMINANCE_ALPHA int
MAX_COMBINED_TEXTURE_IMAGE_UNITS int
MAX_CUBE_MAP_TEXTURE_SIZE int
MAX_FRAGMENT_UNIFORM_VECTORS int
MAX_RENDERBUFFER_SIZE int
MAX_TEXTURE_IMAGE_UNITS int
MAX_TEXTURE_SIZE int
MAX_VARYING_VECTORS int
MAX_VERTEX_ATTRIBS int
MAX_VERTEX_TEXTURE_IMAGE_UNITS int
MAX_VERTEX_UNIFORM_VECTORS int
MAX_VIEWPORT_DIMS int
MEDIUM_FLOAT int
MEDIUM_INT int
MIRRORED_REPEAT int
MULTISAMPLE int
NEAREST int
NEAREST_MIPMAP_LINEAR int
NEAREST_MIPMAP_NEAREST int
NEVER int
NICEST int
NONE int
NOTEQUAL int
NO_ERROR int
NUM_COMPRESSED_TEXTURE_FORMATS int
ONE int
ONE_MINUS_CONSTANT_ALPHA int
ONE_MINUS_CONSTANT_COLOR int
ONE_MINUS_DST_ALPHA int
ONE_MINUS_DST_COLOR int
ONE_MINUS_SRC_ALPHA int
ONE_MINUS_SRC_COLOR int
OUT_OF_MEMORY int
PACK_ALIGNMENT int
POINTS int
POLYGON_OFFSET_FACTOR int
POLYGON_OFFSET_FILL int
POLYGON_OFFSET_UNITS int
RED_BITS int
RENDERBUFFER int
RENDERBUFFER_ALPHA_SIZE int
RENDERBUFFER_BINDING int
RENDERBUFFER_BLUE_SIZE int
RENDERBUFFER_DEPTH_SIZE int
RENDERBUFFER_GREEN_SIZE int
RENDERBUFFER_HEIGHT int
RENDERBUFFER_INTERNAL_FORMAT int
RENDERBUFFER_RED_SIZE int
RENDERBUFFER_STENCIL_SIZE int
RENDERBUFFER_WIDTH int
RENDERER int
REPEAT int
REPLACE int
RGB int
RGB5_A1 int
RGB565 int
RGBA int
RGBA4 int
RGBA8 int
SAMPLER_2D int
SAMPLER_CUBE int
SAMPLES int
SAMPLE_ALPHA_TO_COVERAGE int
SAMPLE_BUFFERS int
SAMPLE_COVERAGE int
SAMPLE_COVERAGE_INVERT int
SAMPLE_COVERAGE_VALUE int
SCISSOR_BOX int
SCISSOR_TEST int
SHADER_COMPILER int
SHADER_SOURCE_LENGTH int
SHADER_TYPE int
SHADING_LANGUAGE_VERSION int
SHORT int
SRC_ALPHA int
SRC_ALPHA_SATURATE int
SRC_COLOR int
STATIC_DRAW int
STENCIL_ATTACHMENT int
STENCIL_BACK_FAIL int
STENCIL_BACK_FUNC int
STENCIL_BACK_PASS_DEPTH_FAIL int
STENCIL_BACK_PASS_DEPTH_PASS int
STENCIL_BACK_REF int
STENCIL_BACK_VALUE_MASK int
STENCIL_BACK_WRITEMASK int
STENCIL_BITS int
STENCIL_BUFFER_BIT int
STENCIL_CLEAR_VALUE int
STENCIL_FAIL int
STENCIL_FUNC int
STENCIL_INDEX int
STENCIL_INDEX8 int
STENCIL_PASS_DEPTH_FAIL int
STENCIL_PASS_DEPTH_PASS int
STENCIL_REF int
STENCIL_TEST int
STENCIL_VALUE_MASK int
STENCIL_WRITEMASK int
STREAM_DRAW int
SUBPIXEL_BITS int
TEXTURE int
TEXTURE0 int
TEXTURE1 int
TEXTURE2 int
TEXTURE3 int
TEXTURE4 int
TEXTURE5 int
TEXTURE6 int
TEXTURE7 int
TEXTURE8 int
TEXTURE9 int
TEXTURE10 int
TEXTURE11 int
TEXTURE12 int
TEXTURE13 int
TEXTURE14 int
TEXTURE15 int
TEXTURE16 int
TEXTURE17 int
TEXTURE18 int
TEXTURE19 int
TEXTURE20 int
TEXTURE21 int
TEXTURE22 int
TEXTURE23 int
TEXTURE24 int
TEXTURE25 int
TEXTURE26 int
TEXTURE27 int
TEXTURE28 int
TEXTURE29 int
TEXTURE30 int
TEXTURE31 int
TEXTURE_2D int
TEXTURE_BINDING_2D int
TEXTURE_BINDING_CUBE_MAP int
TEXTURE_CUBE_MAP int
TEXTURE_CUBE_MAP_NEGATIVE_X int
TEXTURE_CUBE_MAP_NEGATIVE_Y int
TEXTURE_CUBE_MAP_NEGATIVE_Z int
TEXTURE_CUBE_MAP_POSITIVE_X int
TEXTURE_CUBE_MAP_POSITIVE_Y int
TEXTURE_CUBE_MAP_POSITIVE_Z int
TEXTURE_MAG_FILTER int
TEXTURE_MIN_FILTER int
TEXTURE_WRAP_S int
TEXTURE_WRAP_T int
TRIANGLES int
TRIANGLE_FAN int
TRIANGLE_STRIP int
UNPACK_ALIGNMENT int
UNPACK_COLORSPACE_CONVERSION_WEBGL int
UNPACK_FLIP_Y_WEBGL int
UNPACK_PREMULTIPLY_ALPHA_WEBGL int
UNSIGNED_BYTE int
UNSIGNED_INT int
UNSIGNED_SHORT int
UNSIGNED_SHORT_4_4_4_4 int
UNSIGNED_SHORT_5_5_5_1 int
UNSIGNED_SHORT_5_6_5 int
VALIDATE_STATUS int
VENDOR int
VERSION int
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING int
VERTEX_ATTRIB_ARRAY_ENABLED int
VERTEX_ATTRIB_ARRAY_NORMALIZED int
VERTEX_ATTRIB_ARRAY_POINTER int
VERTEX_ATTRIB_ARRAY_SIZE int
VERTEX_ATTRIB_ARRAY_STRIDE int
VERTEX_ATTRIB_ARRAY_TYPE int
VERTEX_SHADER int
VIEWPORT int
ZERO int
TRUE int
}
func NewContext() *Context {
return &Context{}
}
func (c *Context) CreateShader(typ int) *Shader {
shader := &Shader{0}
return shader
}
func (c *Context) ShaderSource(shader *Shader, source string) {}
func (c *Context) CompileShader(shader *Shader) {}
func (c *Context) Ptr(data interface{}) unsafe.Pointer {
var ptr unsafe.Pointer
return ptr
}
func (c *Context) Str(str string) *uint8 {
var num uint8
return &num
}
func (c *Context) GoStr(cstr *uint8) string {
return ""
}
func (c *Context) DeleteShader(shader *Shader) {}
func (c *Context) DeleteTexture(texture *Texture) {}
func (c *Context) GetShaderiv(shader *Shader, pname uint32) bool {
return true
}
func (c *Context) GetShaderInfoLog(shader *Shader) string {
return ""
}
func (c *Context) CreateProgram() *Program {
return &Program{0}
}
func (c *Context) DeleteProgram(program *Program) {}
func (c *Context) BindAttribLocation(program *Program, index int, name string) {}
func (c *Context) GetProgramParameteri(program *Program, pname int) int {
return 0
}
func (c *Context) GetProgramParameterb(program *Program, pname int) bool {
return true
}
func (c *Context) GetProgramInfoLog(program *Program) string {
return ""
}
func (c *Context) AttachShader(program *Program, shader *Shader) {}
func (c *Context) LineStipple(factor int32, pattern uint16) {}
func (c *Context) LineWidth(width float32) {}
func (c *Context) LinkProgram(program *Program) {}
func (c *Context) CreateTexture() *Texture {
return &Texture{0}
}
func (c *Context) BindTexture(target int, texture *Texture) {}
func (c *Context) ActiveTexture(target int) {}
func (c *Context) TexParameteri(target int, pname int, param int) {}
func (c *Context) TexImage2D(target, level, internalFormat, format, kind int, data interface{}) {}
func (c *Context) TexImage2DEmpty(target, level, internalFormat, format, kind, width, height int) {}
func (c *Context) GetAttribLocation(program *Program, name string) int {
return 0
}
func (c *Context) GetUniformLocation(program *Program, name string) *UniformLocation {
return &UniformLocation{0}
}
func (c *Context) GetError() int {
return 0
}
func (c *Context) CreateBuffer() *Buffer {
return &Buffer{0}
}
func (c *Context) DeleteBuffer(buffer *Buffer) {}
func (c *Context) BindBuffer(target int, buffer *Buffer) {}
func (c *Context) BufferData(target int, data interface{}, usage int) {}
func (c *Context) EnableVertexAttribArray(index int) {}
func (c *Context) DisableVertexAttribArray(index int) {}
func (c *Context) VertexAttribPointer(index, size, typ int, normal bool, stride int, offset int) {}
func (c *Context) Enable(flag int) {}
func (c *Context) Disable(flag int) {}
func (c *Context) BlendFunc(src, dst int) {}
func (c *Context) BlendEquation(mode int) {}
func (c *Context) UniformMatrix2fv(location *UniformLocation, transpose bool, value []float32) {}
func (c *Context) UniformMatrix3fv(location *UniformLocation, transpose bool, value []float32) {}
func (c *Context) UniformMatrix4fv(location *UniformLocation, transpose bool, value []float32) {}
func (c *Context) UseProgram(program *Program) {}
func (c *Context) ValidateProgram(program *Program) {}
func (c *Context) Uniform1f(location *UniformLocation, x float32) {}
func (c *Context) Uniform1i(location *UniformLocation, x int) {}
func (c *Context) Uniform1iTexture(location *UniformLocation, tex *Texture) {}
func (c *Context) Uniform2f(location *UniformLocation, x, y float32) {}
func (c *Context) Uniform3f(location *UniformLocation, x, y, z float32) {}
func (c *Context) Uniform4f(location *UniformLocation, x, y, z, w float32) {}
func (c *Context) BufferSubData(target int, offset int, data interface{}) {}
func (c *Context) DrawArrays(mode, first, count int) {}
func (c *Context) DrawElements(mode, count, typ, offset int) {}
func (c *Context) ClearColor(r, g, b, a float32) {}
func (c *Context) Viewport(x, y, width, height int) {}
func (c *Context) GetViewport() [4]int32 {
return [4]int32{0, 0, 0, 0}
}
func (c *Context) Scissor(x, y, width, height int) {}
func (c *Context) Clear(flags int) {}
func (c *Context) MatrixMode(mode uint32) {}
func (c *Context) LoadIdentity() {}
func (c *Context) PushMatrix() {}
func (c *Context) PopMatrix() {}
func (c *Context) CreateRenderBuffer() *RenderBuffer {
return &RenderBuffer{0}
}
func (c *Context) DeleteRenderBuffer(rb *RenderBuffer) {
}
func (c *Context) BindRenderBuffer(rb *RenderBuffer) {
}
func (c *Context) RenderBufferStorage(internalFormat int, width, height int) {
}
func (c *Context) CreateFrameBuffer() *FrameBuffer {
return &FrameBuffer{0}
}
func (c *Context) DeleteFrameBuffer(fb *FrameBuffer) {
}
func (c *Context) BindFrameBuffer(fb *FrameBuffer) {
}
func (c *Context) FrameBufferTexture2D(target, attachment, texTarget int, t *Texture, level int) {
}
func (c *Context) FrameBufferRenderBuffer(target, attachment int, rb *RenderBuffer) {
}