DEADSOFTWARE

Net: Improve malformed packet handling more
[d2df-sdl.git] / src / nogl / noGLES1.inc
1 implementation
3 uses SDL2;
5 const
6 GL_FLOAT = $1406;
7 GL_VERTEX_ARRAY = $8074;
8 GL_NORMAL_ARRAY = $8075;
9 GL_COLOR_ARRAY = $8076;
10 GL_TEXTURE_COORD_ARRAY = $8078;
11 GL_TRIANGLES = $0004;
12 GL_TEXTURE0 = $84C0;
13 GL_INVALID_ENUM = $0500;
15 const
16 ValPerVertex = 2;
17 ValPerColor = 4;
18 ValPerCoord = 2;
20 type
21 TArrayFloat = array of GLfloat;
23 TCmds = record
24 mode: GLenum;
25 v, c, t: TArrayFloat;
26 end;
28 var
29 cmds: TCmds;
31 var
32 extList: string = '';
34 var
35 es_glVertexPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
36 es_glColorPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
37 es_glTexCoordPointer: procedure (size: GLint; _type: GLenum; stride: GLsizei; pointer: PGLvoid); cdecl;
38 es_glEnableClientState: procedure (arr: GLenum); cdecl;
39 es_glDisableClientState: procedure (arr: GLenum); cdecl;
40 es_glDrawArrays: procedure (mode: GLenum; first: GLint; count: GLsizei); cdecl;
41 // es_glActiveTexture: procedure(texture: GLenum); cdecl;
42 // es_glClientActiveTexture: procedure(texture: GLenum); cdecl;
43 es_glColor4f: procedure(red, green, blue, alpha: GLfloat); cdecl;
45 es_glEnable: procedure (cap: GLenum); cdecl;
46 es_glDisable: procedure (cap: GLenum); cdecl;
47 es_glIsEnabled: function (cap: GLenum): GLBoolean; cdecl;
48 es_glGetString: function (name: GLenum): PChar; cdecl;
49 es_glGetError: function (): GLenum; cdecl;
50 es_glClearColor: procedure (red, green, blue, alpha: GLclampf); cdecl;
51 es_glClear: procedure (mask: GLbitfield); cdecl;
52 es_glAlphaFunc: procedure (func: GLenum; ref: GLclampf); cdecl;
53 es_glBlendFunc: procedure (sfactor, dfactor: GLenum); cdecl;
54 es_glPointSize: procedure (size: GLfloat); cdecl;
55 es_glLineWidth: procedure (width: GLfloat); cdecl;
56 es_glGetIntegerv: procedure (pname: GLenum; params: PGLint); cdecl;
57 es_glFlush: procedure; cdecl;
58 es_glFinish: procedure; cdecl;
60 es_glLoadIdentity: procedure; cdecl;
61 es_glMatrixMode: procedure (mode: GLenum); cdecl;
62 es_glLoadMatrixf: procedure (m: PGLfloat); cdecl;
63 es_glPushMatrix: procedure; cdecl;
64 es_glPopMatrix: procedure; cdecl;
65 es_glTranslatef: procedure (x, y, z: GLfloat); cdecl;
66 es_glRotatef: procedure (angle, x, y, z: GLfloat); cdecl;
67 es_glScalef: procedure (x, y, z: GLfloat); cdecl;
69 es_glReadPixels: procedure (x, y: GLint; width, height: GLsizei; format,_type: GLenum; pixels: PGLvoid); cdecl;
71 es_glViewport: procedure (x, y: GLint; width, height: GLsizei); cdecl;
72 es_glScissor: procedure (x, y: GLint; width, height: GLsizei); cdecl;
73 es_glStencilMask: procedure (mask: GLuint); cdecl;
74 es_glStencilFunc: procedure (func: GLenum; ref: GLint; mask: GLuint); cdecl;
75 es_glStencilOp: procedure (fail, zfail, zpass: GLenum); cdecl;
76 es_glColorMask: procedure (red: GLboolean; green: GLboolean; blue: GLboolean; alpha: GLboolean); cdecl;
78 es_glBindTexture: procedure (target: GLenum; texture: GLuint); cdecl;
79 es_glGenTextures: procedure (n: GLsizei; textures: PGLuint); cdecl;
80 es_glTexEnvi: procedure (target: GLenum; pname: GLenum; param: GLint); cdecl;
81 es_glTexParameterf: procedure (target: GLenum; pname: GLenum; param: GLfloat); cdecl;
82 es_glTexParameteri: procedure (target: GLenum; pname: GLenum; param: GLint); cdecl;
83 es_glTexImage2D: procedure (target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, _type:GLenum; pixels: PGLvoid); cdecl;
84 es_glTexSubImage2D: procedure (target: GLenum; level: GLint; xoffset, yoffset: GLint; width, height: GLsizei; format, _type: GLenum; pixels: PGLvoid); cdecl;
85 es_glDeleteTextures: procedure (n: GLsizei; textures: PGLuint); cdecl;
87 es_glGenFramebuffers: procedure (n: GLsizei; framebuffers: PGLuint); cdecl;
88 es_glBindFramebuffer: procedure (target: GLenum; framebuffer: GLuint); cdecl;
89 es_glFramebufferTexture2D: procedure (target, attachment, textarget: GLenum; texture: GLuint; level: GLint); cdecl;
90 es_glFramebufferRenderbuffer: procedure (target, attachment, rbotarget: GLenum; rbo: GLuint); cdecl;
91 es_glCheckFramebufferStatus: function (framebuffer: GLuint): GLenum; cdecl;
92 es_glDeleteFramebuffers: procedure (n: GLsizei; const framebuffers: PGLuint); cdecl;
94 es_glGenRenderbuffers: procedure (n: GLsizei; framebuffers: PGLuint); cdecl;
95 es_glBindRenderbuffer: procedure (target: GLenum; renderbuffer: GLuint); cdecl;
96 es_glRenderbufferStorage: procedure (target, internalformat: GLenum; w, h: GLsizei); cdecl;
97 es_glDeleteRenderbuffers: procedure (n: GLsizei; const renderbuffers: PGLuint); cdecl;
99 procedure glEnable(cap: GLenum);
100 begin
101 es_glEnable(cap);
102 end;
104 procedure glDisable(cap: GLenum);
105 begin
106 es_glDisable(cap);
107 end;
109 function glIsEnabled(cap: GLenum): GLboolean;
110 begin
111 result := es_glIsEnabled(cap);
112 end;
114 function glGetString(name: GLenum): PChar;
115 begin
116 result := es_glGetString(name);
117 end;
119 function glGetError: GLenum;
120 begin
121 result := es_glGetError
122 end;
124 procedure glClearColor(red, green, blue, alpha: GLclampf);
125 begin
126 es_glClearColor(red, green, blue, alpha);
127 end;
129 procedure glClear(mask: GLbitfield);
130 begin
131 es_glClear(mask);
132 end;
134 procedure glAlphaFunc(func: GLenum; ref: GLclampf);
135 begin
136 es_glAlphaFunc(func, ref);
137 end;
139 procedure glBlendFunc(sfactor, dfactor: GLenum);
140 begin
141 es_glBlendFunc(sfactor, dfactor);
142 end;
144 procedure glPointSize(size: GLfloat);
145 begin
146 es_glPointSize(size);
147 end;
149 procedure glLineWidth(width: GLfloat);
150 begin
151 es_glLineWidth(width);
152 end;
154 procedure glGetIntegerv(pname: GLenum; params: PGLint);
155 begin
156 es_glGetIntegerv(pname, params);
157 end;
159 procedure glFlush;
160 begin
161 es_glFlush;
162 end;
164 procedure glFinish;
165 begin
166 es_glFinish;
167 end;
173 procedure glBegin(mode: GLenum);
174 begin
175 assert(cmds.mode = GL_INVALID_ENUM);
176 assert((mode = GL_POINTS) or (mode = GL_LINES) or (mode = GL_QUADS));
177 cmds.mode := mode;
178 SetLength(cmds.v, 0);
179 SetLength(cmds.c, 0);
180 SetLength(cmds.t, 0);
181 end;
183 procedure glEnd;
184 begin
185 assert(cmds.mode <> GL_INVALID_ENUM);
186 assert(Length(cmds.v) mod ValPerVertex = 0);
187 assert(Length(cmds.c) mod ValPerColor = 0);
188 assert(Length(cmds.t) mod ValPerCoord = 0);
189 if Length(cmds.c) <> 0 then
190 assert(Length(cmds.v) div ValPerVertex = Length(cmds.c) div ValPerColor);
191 if Length(cmds.t) <> 0 then
192 assert(Length(cmds.v) div ValPerVertex = Length(cmds.t) div ValPerCoord);
194 es_glVertexPointer(ValPerVertex, GL_FLOAT, 0, @cmds.v[0]);
195 es_glColorPointer(ValPerColor, GL_FLOAT, 0, @cmds.c[0]);
196 es_glTexCoordPointer(ValPerCoord, GL_FLOAT, 0, @cmds.t[0]);
197 es_glEnableClientState(GL_VERTEX_ARRAY);
198 es_glEnableClientState(GL_COLOR_ARRAY);
199 es_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
200 es_glDisableClientState(GL_NORMAL_ARRAY);
202 if Length(cmds.c) = 0 then
203 es_glDisableClientState(GL_COLOR_ARRAY);
204 if Length(cmds.t) = 0 then
205 es_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
207 if cmds.mode = GL_QUADS then
208 es_glDrawArrays(GL_TRIANGLES, 0, Length(cmds.v) div ValPerVertex)
209 else
210 es_glDrawArrays(cmds.mode, 0, Length(cmds.v) div ValPerVertex);
212 SetLength(cmds.v, 0);
213 SetLength(cmds.c, 0);
214 SetLength(cmds.t, 0);
215 cmds.mode := GL_INVALID_ENUM;
216 end;
218 (* ---------- begin internals ---------- *)
220 procedure AddFloatRaw (var x: TArrayFloat; f: GLfloat);
221 var i: Integer;
222 begin
223 i := Length(x);
224 SetLength(x, i + 1);
225 x[i] := f;
226 end;
228 procedure AddFloatX (var x: TArrayFloat; v: array of GLfloat); inline;
229 var i, j, vpx: Integer;
230 begin
231 i := Length(x);
232 vpx := Length(v);
233 if (cmds.mode = GL_QUADS) and (i div vpx mod 4 = 3) then
234 begin
235 for j := 0 to vpx - 1 do
236 AddFloatRaw(x, x[i - 3*vpx + j]);
237 for j := 0 to vpx - 1 do
238 AddFloatRaw(x, x[i - 1*vpx + j]);
239 end;
240 for j := 0 to vpx - 1 do
241 AddFloatRaw(x, v[j]);
242 end;
244 (* ---------- end internals ---------- *)
246 procedure glVertex2f(x, y: GLfloat);
247 begin
248 AddFloatX(cmds.v, [x, y]);
249 end;
251 procedure glVertex2i(x, y: GLint);
252 begin
253 AddFloatX(cmds.v, [x, y]);
254 end;
256 procedure glColor4f(red, green, blue, alpha: GLfloat);
257 begin
258 if cmds.mode = GL_INVALID_ENUM then
259 es_glColor4f(red, green, blue, alpha)
260 else
261 AddFloatX(cmds.c, [red, green, blue, alpha])
262 end;
264 procedure glColor4ub(red, green, blue, alpha: GLubyte);
265 begin
266 glColor4f(red / 255, green / 255, blue / 255, alpha / 255)
267 end;
269 procedure glColor3ub(red, green, blue: GLubyte);
270 begin
271 glColor4f(red / 255, green / 255, blue / 255, 255)
272 end;
274 procedure glTexCoord2f(s, t: GLfloat);
275 begin
276 AddFloatX(cmds.t, [s, t]);
277 end;
279 procedure glTexCoord2i(s, t: GLint);
280 begin
281 AddFloatX(cmds.t, [s, t]);
282 end;
290 procedure glReadPixels(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer);
291 begin
292 es_glReadPixels(x, y, width, height, format, atype, pixels);
293 end;
300 procedure glLoadIdentity;
301 begin
302 es_glLoadIdentity;
303 end;
305 procedure glMatrixMode(mode: GLenum);
306 begin
307 es_glMatrixMode(mode);
308 end;
310 procedure glLoadMatrixd(const m: PGLdouble);
311 var
312 i: Integer;
313 n: array [0..15] of GLfloat;
314 begin
315 for i := 0 to 15 do
316 n[i] := m[i];
317 es_glLoadMatrixf(@n[0]);
318 end;
320 procedure glPushMatrix;
321 begin
322 es_glPushMatrix;
323 end;
325 procedure glPopMatrix;
326 begin
327 es_glPopMatrix;
328 end;
330 procedure glTranslatef(x, y, z: GLfloat);
331 begin
332 es_glTranslatef(x, y, z);
333 end;
335 procedure glRotatef(angle, x, y, z: GLfloat);
336 begin
337 es_glRotatef(angle, x, y, z);
338 end;
340 procedure glScalef(x, y, z: GLfloat);
341 begin
342 es_glScalef(x, y, z);
343 end;
350 procedure glViewport(x, y: GLint; width, height: GLsizei);
351 begin
352 es_glViewport(x, y, width, height);
353 end;
355 procedure glScissor(x, y: GLint; width, height: GLsizei);
356 begin
357 es_glScissor(x, y, width, height);
358 end;
360 procedure glStencilMask(mask: GLuint);
361 begin
362 es_glStencilMask(mask);
363 end;
365 procedure glStencilFunc(func: GLenum; ref: GLint; mask: GLuint);
366 begin
367 es_glStencilFunc(func, ref, mask);
368 end;
370 procedure glStencilOp(fail, zfail, zpass: GLenum);
371 begin
372 es_glStencilOp(fail, zfail, zpass);
373 end;
375 procedure glColorMask(red, green, blue, alpha: GLboolean);
376 begin
377 es_glColorMask(red, green, blue, alpha);
378 end;
385 procedure glBindTexture(target: GLenum; texture: GLuint);
386 begin
387 es_glBindTexture(target, texture);
388 end;
390 procedure glGenTextures(n: GLsizei; textures: PGLuint);
391 begin
392 es_glGenTextures(n, textures);
393 end;
395 procedure glTexEnvi(target: GLenum; pname: GLenum; param: GLint);
396 begin
397 es_glTexEnvi(target, pname, param);
398 end;
400 procedure glTexParameterf(target: GLenum; pname: GLenum; param: GLfloat);
401 begin
402 es_glTexParameterf(target, pname, param);
403 end;
405 procedure glTexParameteri(target: GLenum; pname: GLenum; param: GLint);
406 begin
407 es_glTexParameteri(target, pname, param);
408 end;
410 procedure glTexImage2D(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; const pixels: Pointer);
411 begin
412 es_glTexImage2D(target, level, internalformat, width, height, border, format, atype, pixels);
413 end;
415 procedure glTexSubImage2D(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; const pixels: Pointer);
416 begin
417 es_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, atype, pixels);
418 end;
420 procedure glDeleteTextures(n: GLsizei; const textures: PGLuint);
421 begin
422 es_glDeleteTextures(n, textures);
423 end;
430 procedure glGenFramebuffers(n: GLsizei; framebuffers: PGLuint);
431 begin
432 es_glGenFramebuffers(n, framebuffers);
433 end;
435 procedure glBindFramebuffer(target: GLenum; framebuffer: GLuint);
436 begin
437 es_glBindFramebuffer(target, framebuffer);
438 end;
440 procedure glFramebufferTexture2D(target, attachment, textarget: GLenum; texture: GLuint; level: GLint);
441 begin
442 es_glFramebufferTexture2D(target, attachment, textarget, texture, level);
443 end;
445 procedure glFramebufferRenderbuffer(target, attachment, rbotarget: GLenum; rbo: GLuint);
446 begin
447 es_glFramebufferRenderbuffer(target, attachment, rbotarget, rbo);
448 end;
450 function glCheckFramebufferStatus(framebuffer: GLuint): GLenum;
451 begin
452 result := es_glCheckFramebufferStatus(framebuffer);
453 end;
455 procedure glDeleteFramebuffers(n: GLsizei; const framebuffers: PGLuint);
456 begin
457 es_glDeleteFramebuffers(n, framebuffers);
458 end;
460 procedure glGenRenderbuffers(n: GLsizei; renderbuffers: PGLuint);
461 begin
462 es_glGenRenderbuffers(n, renderbuffers);
463 end;
465 procedure glBindRenderbuffer(target: GLenum; renderbuffer: GLuint);
466 begin
467 es_glBindRenderbuffer(target, renderbuffer);
468 end;
470 procedure glRenderbufferStorage(target, internalformat: GLenum; w, h: GLsizei);
471 begin
472 es_glRenderbufferStorage(target, internalformat, w, h);
473 end;
475 procedure glDeleteRenderbuffers(n: GLsizei; const renderbuffers: PGLuint);
476 begin
477 es_glDeleteRenderbuffers(n, renderbuffers);
478 end;
485 procedure nogl_Init;
486 begin
487 es_glVertexPointer := SDL_GL_GetProcAddress('glVertexPointer');
488 es_glColorPointer := SDL_GL_GetProcAddress('glColorPointer');
489 es_glTexCoordPointer := SDL_GL_GetProcAddress('glTexCoordPointer');
490 es_glEnableClientState := SDL_GL_GetProcAddress('glEnableClientState');
491 es_glDisableClientState := SDL_GL_GetProcAddress('glDisableClientState');
492 es_glDrawArrays := SDL_GL_GetProcAddress('glDrawArrays');
493 // es_glActiveTexture := SDL_GL_GetProcAddress('glActiveTexture');
494 // es_glClientActiveTexture := SDL_GL_GetProcAddress('glClientActiveTexture');
495 es_glColor4f := SDL_GL_GetProcAddress('glColor4f');
497 es_glEnable := SDL_GL_GetProcAddress('glEnable');
498 es_glDisable := SDL_GL_GetProcAddress('glDisable');
499 es_glIsEnabled := SDL_GL_GetProcAddress('glIsEnabled');
500 es_glGetString := SDL_GL_GetProcAddress('glGetString');
501 es_glGetError := SDL_GL_GetProcAddress('glGetError');
502 es_glClearColor := SDL_GL_GetProcAddress('glClearColor');
503 es_glClear := SDL_GL_GetProcAddress('glClear');
504 es_glAlphaFunc := SDL_GL_GetProcAddress('glAlphaFunc');
505 es_glBlendFunc := SDL_GL_GetProcAddress('glBlendFunc');
506 es_glPointSize := SDL_GL_GetProcAddress('glPointSize');
507 es_glLineWidth := SDL_GL_GetProcAddress('glLineWidth');
508 es_glGetIntegerv := SDL_GL_GetProcAddress('glGetIntegerv');
509 es_glFlush := SDL_GL_GetProcAddress('glFlush');
510 es_glFinish := SDL_GL_GetProcAddress('glFinish');
512 es_glLoadIdentity := SDL_GL_GetProcAddress('glLoadIdentity');
513 es_glMatrixMode := SDL_GL_GetProcAddress('glMatrixMode');
514 es_glLoadMatrixf := SDL_GL_GetProcAddress('glLoadMatrixf');
515 es_glPushMatrix := SDL_GL_GetProcAddress('glPushMatrix');
516 es_glPopMatrix := SDL_GL_GetProcAddress('glPopMatrix');
517 es_glTranslatef := SDL_GL_GetProcAddress('glTranslatef');
518 es_glRotatef := SDL_GL_GetProcAddress('glRotatef');
519 es_glScalef := SDL_GL_GetProcAddress('glScalef');
521 es_glReadPixels := SDL_GL_GetProcAddress('glReadPixels');
523 es_glViewport := SDL_GL_GetProcAddress('glViewport');
524 es_glScissor := SDL_GL_GetProcAddress('glScissor');
525 es_glStencilMask := SDL_GL_GetProcAddress('glStencilMask');
526 es_glStencilFunc := SDL_GL_GetProcAddress('glStencilFunc');
527 es_glStencilOp := SDL_GL_GetProcAddress('glStencilOp');
528 es_glColorMask := SDL_GL_GetProcAddress('glColorMask');
530 es_glBindTexture := SDL_GL_GetProcAddress('glBindTexture');
531 es_glGenTextures := SDL_GL_GetProcAddress('glGenTextures');
532 es_glTexEnvi := SDL_GL_GetProcAddress('glTexEnvi');
533 es_glTexParameterf := SDL_GL_GetProcAddress('glTexParameterf');
534 es_glTexParameteri := SDL_GL_GetProcAddress('glTexParameteri');
535 es_glTexImage2D := SDL_GL_GetProcAddress('glTexImage2D');
536 es_glTexSubImage2D := SDL_GL_GetProcAddress('glTexSubImage2D');
537 es_glDeleteTextures := SDL_GL_GetProcAddress('glDeleteTextures');
539 es_glGenFramebuffers := SDL_GL_GetProcAddress('glGenFramebuffersOES');
540 es_glBindFramebuffer := SDL_GL_GetProcAddress('glBindFramebufferOES');
541 es_glFramebufferTexture2D := SDL_GL_GetProcAddress('glFramebufferTexture2DOES');;
542 es_glFramebufferRenderbuffer := SDL_GL_GetProcAddress('glFramebufferRenderbufferOES');
543 es_glCheckFramebufferStatus := SDL_GL_GetProcAddress('glCheckFramebufferStatusOES');
544 es_glDeleteFramebuffers := SDL_GL_GetProcAddress('glDeleteFramebuffersOES');
546 es_glGenRenderbuffers := SDL_GL_GetProcAddress('glGenRenderbuffersOES');
547 es_glBindRenderbuffer := SDL_GL_GetProcAddress('glBindRenderbufferOES');
548 es_glRenderbufferStorage := SDL_GL_GetProcAddress('glRenderbufferStorageOES');
549 es_glDeleteRenderbuffers := SDL_GL_GetProcAddress('glDeleteRenderbuffersOES');
551 cmds.mode := GL_INVALID_ENUM
552 end;
554 procedure nogl_Quit;
555 begin
556 es_glVertexPointer := nil;
557 es_glColorPointer := nil;
558 es_glTexCoordPointer := nil;
559 es_glEnableClientState := nil;
560 es_glDisableClientState := nil;
561 es_glDrawArrays := nil;
562 // es_glActiveTexture := nil;
563 // es_glClientActiveTexture := nil;
564 es_glColor4f := nil;
566 es_glEnable := nil;
567 es_glDisable := nil;
568 es_glIsEnabled := nil;
569 es_glGetString := nil;
570 es_glClearColor := nil;
571 es_glClear := nil;
572 es_glAlphaFunc := nil;
573 es_glBlendFunc := nil;
574 es_glPointSize := nil;
575 es_glLineWidth := nil;
576 es_glGetIntegerv := nil;
577 es_glFlush := nil;
578 es_glFinish := nil;
580 es_glLoadIdentity := nil;
581 es_glMatrixMode := nil;
582 es_glLoadMatrixf := nil;
583 es_glPushMatrix := nil;
584 es_glPopMatrix := nil;
585 es_glTranslatef := nil;
586 es_glRotatef := nil;
587 es_glScalef := nil;
589 es_glReadPixels := nil;
591 es_glViewport := nil;
592 es_glScissor := nil;
593 es_glStencilMask := nil;
594 es_glStencilFunc := nil;
595 es_glStencilOp := nil;
596 es_glColorMask := nil;
598 es_glBindTexture := nil;
599 es_glGenTextures := nil;
600 es_glTexEnvi := nil;
601 es_glTexParameterf := nil;
602 es_glTexParameteri := nil;
603 es_glTexImage2D := nil;
604 es_glTexSubImage2D := nil;
605 es_glDeleteTextures := nil;
607 es_glGenFramebuffers := nil;
608 es_glBindFramebuffer := nil;
609 es_glFramebufferTexture2D := nil;
610 es_glFramebufferRenderbuffer := nil;
611 es_glCheckFramebufferStatus := nil;
612 es_glDeleteFramebuffers := nil;
614 es_glGenRenderbuffers := nil;
615 es_glBindRenderbuffer := nil;
616 es_glRenderbufferStorage := nil;
617 es_glDeleteRenderbuffers := nil;
618 end;
620 function nogl_ExtensionSupported(ext: string): Boolean;
621 begin
622 if (extList = '') and Assigned(es_glGetString) then
623 extList := glGetString(GL_EXTENSIONS);
624 result := pos(ext, extList) <> 0;
625 end;
627 initialization