2019-09-22 17:42:51 +02:00
|
|
|
// SPDX-License-Identifier: MIT
|
2018-12-08 18:35:13 +01:00
|
|
|
|
2022-11-13 05:24:54 +01:00
|
|
|
//go:build !android && !darwin && !js && !windows && !opengles
|
2018-12-08 18:35:13 +01:00
|
|
|
|
|
|
|
package gl
|
|
|
|
|
2022-08-12 05:40:23 +02:00
|
|
|
// #cgo linux,!nintendosdk freebsd,!nintendosdk openbsd,!nintendosdk pkg-config: gl
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2018-12-08 18:35:13 +01:00
|
|
|
// #ifndef APIENTRY
|
2019-10-06 15:59:08 +02:00
|
|
|
// #define APIENTRY
|
2018-12-08 18:35:13 +01:00
|
|
|
// #endif
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2018-12-08 18:35:13 +01:00
|
|
|
// #ifndef APIENTRYP
|
2019-10-06 15:59:08 +02:00
|
|
|
// #define APIENTRYP APIENTRY *
|
2018-12-08 18:35:13 +01:00
|
|
|
// #endif
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2018-12-08 18:35:13 +01:00
|
|
|
// #ifndef GLAPI
|
2019-10-06 15:59:08 +02:00
|
|
|
// #define GLAPI extern
|
2018-12-08 18:35:13 +01:00
|
|
|
// #endif
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2022-11-12 19:35:40 +01:00
|
|
|
// #include <stdint.h>
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef unsigned int GLenum;
|
|
|
|
// typedef unsigned char GLboolean;
|
|
|
|
// typedef unsigned int GLbitfield;
|
|
|
|
// typedef int GLint;
|
|
|
|
// typedef unsigned int GLuint;
|
|
|
|
// typedef int GLsizei;
|
|
|
|
// typedef float GLfloat;
|
|
|
|
// typedef char GLchar;
|
|
|
|
// typedef ptrdiff_t GLintptr;
|
|
|
|
// typedef ptrdiff_t GLsizeiptr;
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
|
|
|
// typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
|
|
|
// typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
|
|
|
// typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
|
|
|
|
// typedef unsigned short GLhalfNV;
|
|
|
|
// typedef GLintptr GLvdpauSurfaceNV;
|
2020-05-17 16:04:13 +02:00
|
|
|
//
|
|
|
|
// typedef void (APIENTRYP GPACTIVETEXTURE)(GLenum texture);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPATTACHSHADER)(GLuint program, GLuint shader);
|
|
|
|
// typedef void (APIENTRYP GPBINDATTRIBLOCATION)(GLuint program, GLuint index, const GLchar * name);
|
|
|
|
// typedef void (APIENTRYP GPBINDBUFFER)(GLenum target, GLuint buffer);
|
|
|
|
// typedef void (APIENTRYP GPBINDFRAMEBUFFEREXT)(GLenum target, GLuint framebuffer);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPBINDRENDERBUFFEREXT)(GLenum target, GLuint renderbuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPBINDTEXTURE)(GLenum target, GLuint texture);
|
2022-10-15 11:58:56 +02:00
|
|
|
// typedef void (APIENTRYP GPBLENDEQUATIONSEPARATE)(GLenum modeRGB, GLenum modeAlpha);
|
|
|
|
// typedef void (APIENTRYP GPBLENDFUNCSEPARATE)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPBUFFERDATA)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
|
|
|
|
// typedef void (APIENTRYP GPBUFFERSUBDATA)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
|
|
|
|
// typedef GLenum (APIENTRYP GPCHECKFRAMEBUFFERSTATUSEXT)(GLenum target);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPCLEAR)(GLbitfield mask);
|
|
|
|
// typedef void (APIENTRYP GPCOLORMASK)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPCOMPILESHADER)(GLuint shader);
|
|
|
|
// typedef GLuint (APIENTRYP GPCREATEPROGRAM)();
|
|
|
|
// typedef GLuint (APIENTRYP GPCREATESHADER)(GLenum type);
|
|
|
|
// typedef void (APIENTRYP GPDELETEBUFFERS)(GLsizei n, const GLuint * buffers);
|
|
|
|
// typedef void (APIENTRYP GPDELETEFRAMEBUFFERSEXT)(GLsizei n, const GLuint * framebuffers);
|
|
|
|
// typedef void (APIENTRYP GPDELETEPROGRAM)(GLuint program);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPDELETERENDERBUFFERSEXT)(GLsizei n, const GLuint * renderbuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPDELETESHADER)(GLuint shader);
|
|
|
|
// typedef void (APIENTRYP GPDELETETEXTURES)(GLsizei n, const GLuint * textures);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPDISABLE)(GLenum cap);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPDISABLEVERTEXATTRIBARRAY)(GLuint index);
|
2019-09-30 18:47:15 +02:00
|
|
|
// typedef void (APIENTRYP GPDRAWELEMENTS)(GLenum mode, GLsizei count, GLenum type, const uintptr_t indices);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPENABLE)(GLenum cap);
|
|
|
|
// typedef void (APIENTRYP GPENABLEVERTEXATTRIBARRAY)(GLuint index);
|
|
|
|
// typedef void (APIENTRYP GPFLUSH)();
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPFRAMEBUFFERRENDERBUFFEREXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
|
|
|
// typedef void (APIENTRYP GPGENBUFFERS)(GLsizei n, GLuint * buffers);
|
|
|
|
// typedef void (APIENTRYP GPGENFRAMEBUFFERSEXT)(GLsizei n, GLuint * framebuffers);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPGENRENDERBUFFERSEXT)(GLsizei n, GLuint * renderbuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPGENTEXTURES)(GLsizei n, GLuint * textures);
|
|
|
|
// typedef GLenum (APIENTRYP GPGETERROR)();
|
|
|
|
// typedef void (APIENTRYP GPGETINTEGERV)(GLenum pname, GLint * data);
|
2020-08-01 11:39:17 +02:00
|
|
|
// typedef void (APIENTRYP GPGETPROGRAMINFOLOG)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPGETPROGRAMIV)(GLuint program, GLenum pname, GLint * params);
|
|
|
|
// typedef void (APIENTRYP GPGETSHADERINFOLOG)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
|
|
|
|
// typedef void (APIENTRYP GPGETSHADERIV)(GLuint shader, GLenum pname, GLint * params);
|
|
|
|
// typedef GLint (APIENTRYP GPGETUNIFORMLOCATION)(GLuint program, const GLchar * name);
|
|
|
|
// typedef GLboolean (APIENTRYP GPISFRAMEBUFFEREXT)(GLuint framebuffer);
|
|
|
|
// typedef GLboolean (APIENTRYP GPISPROGRAM)(GLuint program);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef GLboolean (APIENTRYP GPISRENDERBUFFEREXT)(GLuint renderbuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef GLboolean (APIENTRYP GPISTEXTURE)(GLuint texture);
|
|
|
|
// typedef void (APIENTRYP GPLINKPROGRAM)(GLuint program);
|
|
|
|
// typedef void (APIENTRYP GPPIXELSTOREI)(GLenum pname, GLint param);
|
|
|
|
// typedef void (APIENTRYP GPREADPIXELS)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPRENDERBUFFERSTORAGEEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
2020-11-07 11:14:06 +01:00
|
|
|
// typedef void (APIENTRYP GPSCISSOR)(GLint x, GLint y, GLsizei width, GLsizei height);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPSHADERSOURCE)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
|
2021-07-04 17:10:48 +02:00
|
|
|
// typedef void (APIENTRYP GPSTENCILFUNC)(GLenum func, GLint ref, GLuint mask);
|
|
|
|
// typedef void (APIENTRYP GPSTENCILOP)(GLenum fail, GLenum zfail, GLenum zpass);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPTEXIMAGE2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
|
|
|
|
// typedef void (APIENTRYP GPTEXPARAMETERI)(GLenum target, GLenum pname, GLint param);
|
|
|
|
// typedef void (APIENTRYP GPTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
|
2020-07-30 19:52:25 +02:00
|
|
|
// typedef void (APIENTRYP GPUNIFORM1FV)(GLint location, GLsizei count, const GLfloat * value);
|
2022-11-12 10:38:15 +01:00
|
|
|
// typedef void (APIENTRYP GPUNIFORM1I)(GLint location, GLint v0);
|
|
|
|
// typedef void (APIENTRYP GPUNIFORM1IV)(GLint location, GLsizei count, const GLint * value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPUNIFORM2FV)(GLint location, GLsizei count, const GLfloat * value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// typedef void (APIENTRYP GPUNIFORM3FV)(GLint location, GLsizei count, const GLfloat * value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPUNIFORM4FV)(GLint location, GLsizei count, const GLfloat * value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// typedef void (APIENTRYP GPUNIFORMMATRIX2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
|
|
|
|
// typedef void (APIENTRYP GPUNIFORMMATRIX3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPUNIFORMMATRIX4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
|
|
|
|
// typedef void (APIENTRYP GPUSEPROGRAM)(GLuint program);
|
2019-09-30 18:47:15 +02:00
|
|
|
// typedef void (APIENTRYP GPVERTEXATTRIBPOINTER)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const uintptr_t pointer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// typedef void (APIENTRYP GPVIEWPORT)(GLint x, GLint y, GLsizei width, GLsizei height);
|
2019-10-06 15:59:08 +02:00
|
|
|
//
|
2020-05-17 16:04:13 +02:00
|
|
|
// static void glowActiveTexture(GPACTIVETEXTURE fnptr, GLenum texture) {
|
|
|
|
// (*fnptr)(texture);
|
|
|
|
// }
|
2018-12-08 18:35:13 +01:00
|
|
|
// static void glowAttachShader(GPATTACHSHADER fnptr, GLuint program, GLuint shader) {
|
|
|
|
// (*fnptr)(program, shader);
|
|
|
|
// }
|
|
|
|
// static void glowBindAttribLocation(GPBINDATTRIBLOCATION fnptr, GLuint program, GLuint index, const GLchar * name) {
|
|
|
|
// (*fnptr)(program, index, name);
|
|
|
|
// }
|
|
|
|
// static void glowBindBuffer(GPBINDBUFFER fnptr, GLenum target, GLuint buffer) {
|
|
|
|
// (*fnptr)(target, buffer);
|
|
|
|
// }
|
|
|
|
// static void glowBindFramebufferEXT(GPBINDFRAMEBUFFEREXT fnptr, GLenum target, GLuint framebuffer) {
|
|
|
|
// (*fnptr)(target, framebuffer);
|
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowBindRenderbufferEXT(GPBINDRENDERBUFFEREXT fnptr, GLenum target, GLuint renderbuffer) {
|
|
|
|
// (*fnptr)(target, renderbuffer);
|
|
|
|
// }
|
2018-12-08 18:35:13 +01:00
|
|
|
// static void glowBindTexture(GPBINDTEXTURE fnptr, GLenum target, GLuint texture) {
|
|
|
|
// (*fnptr)(target, texture);
|
|
|
|
// }
|
2022-10-15 11:58:56 +02:00
|
|
|
// static void glowBlendEquationSeparate(GPBLENDEQUATIONSEPARATE fnptr, GLenum modeRGB, GLenum modeAlpha) {
|
|
|
|
// (*fnptr)(modeRGB, modeAlpha);
|
|
|
|
// }
|
|
|
|
// static void glowBlendFuncSeparate(GPBLENDFUNCSEPARATE fnptr, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
|
|
|
|
// (*fnptr)(srcRGB, dstRGB, srcAlpha, dstAlpha);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
|
|
|
// static void glowBufferData(GPBUFFERDATA fnptr, GLenum target, GLsizeiptr size, const void * data, GLenum usage) {
|
|
|
|
// (*fnptr)(target, size, data, usage);
|
|
|
|
// }
|
|
|
|
// static void glowBufferSubData(GPBUFFERSUBDATA fnptr, GLenum target, GLintptr offset, GLsizeiptr size, const void * data) {
|
|
|
|
// (*fnptr)(target, offset, size, data);
|
|
|
|
// }
|
|
|
|
// static GLenum glowCheckFramebufferStatusEXT(GPCHECKFRAMEBUFFERSTATUSEXT fnptr, GLenum target) {
|
|
|
|
// return (*fnptr)(target);
|
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowClear(GPCLEAR fnptr, GLbitfield mask) {
|
|
|
|
// (*fnptr)(mask);
|
|
|
|
// }
|
|
|
|
// static void glowColorMask(GPCOLORMASK fnptr, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
|
|
|
|
// (*fnptr)(red, green, blue, alpha);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowCompileShader(GPCOMPILESHADER fnptr, GLuint shader) {
|
|
|
|
// (*fnptr)(shader);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLuint glowCreateProgram(GPCREATEPROGRAM fnptr) {
|
|
|
|
// return (*fnptr)();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLuint glowCreateShader(GPCREATESHADER fnptr, GLenum type) {
|
|
|
|
// return (*fnptr)(type);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDeleteBuffers(GPDELETEBUFFERS fnptr, GLsizei n, const GLuint * buffers) {
|
|
|
|
// (*fnptr)(n, buffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDeleteFramebuffersEXT(GPDELETEFRAMEBUFFERSEXT fnptr, GLsizei n, const GLuint * framebuffers) {
|
|
|
|
// (*fnptr)(n, framebuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDeleteProgram(GPDELETEPROGRAM fnptr, GLuint program) {
|
|
|
|
// (*fnptr)(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowDeleteRenderbuffersEXT(GPDELETERENDERBUFFERSEXT fnptr, GLsizei n, const GLuint * renderbuffers) {
|
|
|
|
// (*fnptr)(n, renderbuffers);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDeleteShader(GPDELETESHADER fnptr, GLuint shader) {
|
|
|
|
// (*fnptr)(shader);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDeleteTextures(GPDELETETEXTURES fnptr, GLsizei n, const GLuint * textures) {
|
|
|
|
// (*fnptr)(n, textures);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowDisable(GPDISABLE fnptr, GLenum cap) {
|
|
|
|
// (*fnptr)(cap);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDisableVertexAttribArray(GPDISABLEVERTEXATTRIBARRAY fnptr, GLuint index) {
|
|
|
|
// (*fnptr)(index);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowDrawElements(GPDRAWELEMENTS fnptr, GLenum mode, GLsizei count, GLenum type, const uintptr_t indices) {
|
|
|
|
// (*fnptr)(mode, count, type, indices);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowEnable(GPENABLE fnptr, GLenum cap) {
|
|
|
|
// (*fnptr)(cap);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowEnableVertexAttribArray(GPENABLEVERTEXATTRIBARRAY fnptr, GLuint index) {
|
|
|
|
// (*fnptr)(index);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowFlush(GPFLUSH fnptr) {
|
|
|
|
// (*fnptr)();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowFramebufferRenderbufferEXT(GPFRAMEBUFFERRENDERBUFFEREXT fnptr, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
|
|
|
// (*fnptr)(target, attachment, renderbuffertarget, renderbuffer);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowFramebufferTexture2DEXT(GPFRAMEBUFFERTEXTURE2DEXT fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
|
|
|
// (*fnptr)(target, attachment, textarget, texture, level);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGenBuffers(GPGENBUFFERS fnptr, GLsizei n, GLuint * buffers) {
|
|
|
|
// (*fnptr)(n, buffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGenFramebuffersEXT(GPGENFRAMEBUFFERSEXT fnptr, GLsizei n, GLuint * framebuffers) {
|
|
|
|
// (*fnptr)(n, framebuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowGenRenderbuffersEXT(GPGENRENDERBUFFERSEXT fnptr, GLsizei n, GLuint * renderbuffers) {
|
|
|
|
// (*fnptr)(n, renderbuffers);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGenTextures(GPGENTEXTURES fnptr, GLsizei n, GLuint * textures) {
|
|
|
|
// (*fnptr)(n, textures);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLenum glowGetError(GPGETERROR fnptr) {
|
|
|
|
// return (*fnptr)();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGetIntegerv(GPGETINTEGERV fnptr, GLenum pname, GLint * data) {
|
|
|
|
// (*fnptr)(pname, data);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2020-08-01 11:39:17 +02:00
|
|
|
// static void glowGetProgramInfoLog(GPGETPROGRAMINFOLOG fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
|
|
|
|
// (*fnptr)(program, bufSize, length, infoLog);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGetProgramiv(GPGETPROGRAMIV fnptr, GLuint program, GLenum pname, GLint * params) {
|
|
|
|
// (*fnptr)(program, pname, params);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGetShaderInfoLog(GPGETSHADERINFOLOG fnptr, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
|
|
|
|
// (*fnptr)(shader, bufSize, length, infoLog);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowGetShaderiv(GPGETSHADERIV fnptr, GLuint shader, GLenum pname, GLint * params) {
|
|
|
|
// (*fnptr)(shader, pname, params);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLint glowGetUniformLocation(GPGETUNIFORMLOCATION fnptr, GLuint program, const GLchar * name) {
|
|
|
|
// return (*fnptr)(program, name);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLboolean glowIsFramebufferEXT(GPISFRAMEBUFFEREXT fnptr, GLuint framebuffer) {
|
|
|
|
// return (*fnptr)(framebuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLboolean glowIsProgram(GPISPROGRAM fnptr, GLuint program) {
|
|
|
|
// return (*fnptr)(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static GLboolean glowIsRenderbufferEXT(GPISRENDERBUFFEREXT fnptr, GLuint renderbuffer) {
|
|
|
|
// return (*fnptr)(renderbuffer);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static GLboolean glowIsTexture(GPISTEXTURE fnptr, GLuint texture) {
|
|
|
|
// return (*fnptr)(texture);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowLinkProgram(GPLINKPROGRAM fnptr, GLuint program) {
|
|
|
|
// (*fnptr)(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowPixelStorei(GPPIXELSTOREI fnptr, GLenum pname, GLint param) {
|
|
|
|
// (*fnptr)(pname, param);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowReadPixels(GPREADPIXELS fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels) {
|
|
|
|
// (*fnptr)(x, y, width, height, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowRenderbufferStorageEXT(GPRENDERBUFFERSTORAGEEXT fnptr, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
|
|
|
// (*fnptr)(target, internalformat, width, height);
|
|
|
|
// }
|
2020-11-07 11:14:06 +01:00
|
|
|
// static void glowScissor(GPSCISSOR fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
// (*fnptr)(x, y, width, height);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowShaderSource(GPSHADERSOURCE fnptr, GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length) {
|
|
|
|
// (*fnptr)(shader, count, string, length);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2021-07-04 17:10:48 +02:00
|
|
|
// static void glowStencilFunc(GPSTENCILFUNC fnptr, GLenum func, GLint ref, GLuint mask) {
|
|
|
|
// (*fnptr)(func, ref, mask);
|
|
|
|
// }
|
|
|
|
// static void glowStencilOp(GPSTENCILOP fnptr, GLenum fail, GLenum zfail, GLenum zpass) {
|
|
|
|
// (*fnptr)(fail, zfail, zpass);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowTexImage2D(GPTEXIMAGE2D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) {
|
|
|
|
// (*fnptr)(target, level, internalformat, width, height, border, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowTexParameteri(GPTEXPARAMETERI fnptr, GLenum target, GLenum pname, GLint param) {
|
|
|
|
// (*fnptr)(target, pname, param);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowTexSubImage2D(GPTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
|
|
|
|
// (*fnptr)(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2022-11-12 10:38:15 +01:00
|
|
|
// static void glowUniform1fv(GPUNIFORM1FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, value);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowUniform1i(GPUNIFORM1I fnptr, GLint location, GLint v0) {
|
|
|
|
// (*fnptr)(location, v0);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2022-11-12 10:38:15 +01:00
|
|
|
// static void glowUniform1iv(GPUNIFORM1IV fnptr, GLint location, GLsizei count, const GLint * value) {
|
2020-07-30 19:52:25 +02:00
|
|
|
// (*fnptr)(location, count, value);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowUniform2fv(GPUNIFORM2FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2020-07-30 19:52:25 +02:00
|
|
|
// static void glowUniform3fv(GPUNIFORM3FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, value);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowUniform4fv(GPUNIFORM4FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2020-07-30 19:52:25 +02:00
|
|
|
// static void glowUniformMatrix2fv(GPUNIFORMMATRIX2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, transpose, value);
|
|
|
|
// }
|
|
|
|
// static void glowUniformMatrix3fv(GPUNIFORMMATRIX3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, transpose, value);
|
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowUniformMatrix4fv(GPUNIFORMMATRIX4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
|
|
|
|
// (*fnptr)(location, count, transpose, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowUseProgram(GPUSEPROGRAM fnptr, GLuint program) {
|
|
|
|
// (*fnptr)(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowVertexAttribPointer(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const uintptr_t pointer) {
|
|
|
|
// (*fnptr)(index, size, type, normalized, stride, pointer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
// static void glowViewport(GPVIEWPORT fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
// (*fnptr)(x, y, width, height);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2019-10-06 15:48:32 +02:00
|
|
|
import "C"
|
2019-10-06 15:59:08 +02:00
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-11-12 18:24:21 +01:00
|
|
|
gpActiveTexture C.GPACTIVETEXTURE
|
|
|
|
gpAttachShader C.GPATTACHSHADER
|
|
|
|
gpBindAttribLocation C.GPBINDATTRIBLOCATION
|
|
|
|
gpBindBuffer C.GPBINDBUFFER
|
|
|
|
gpBindFramebufferEXT C.GPBINDFRAMEBUFFEREXT
|
|
|
|
gpBindRenderbufferEXT C.GPBINDRENDERBUFFEREXT
|
|
|
|
gpBindTexture C.GPBINDTEXTURE
|
|
|
|
gpBlendEquationSeparate C.GPBLENDEQUATIONSEPARATE
|
|
|
|
gpBlendFuncSeparate C.GPBLENDFUNCSEPARATE
|
|
|
|
gpBufferData C.GPBUFFERDATA
|
|
|
|
gpBufferSubData C.GPBUFFERSUBDATA
|
|
|
|
gpCheckFramebufferStatusEXT C.GPCHECKFRAMEBUFFERSTATUSEXT
|
|
|
|
gpClear C.GPCLEAR
|
|
|
|
gpColorMask C.GPCOLORMASK
|
|
|
|
gpCompileShader C.GPCOMPILESHADER
|
|
|
|
gpCreateProgram C.GPCREATEPROGRAM
|
|
|
|
gpCreateShader C.GPCREATESHADER
|
|
|
|
gpDeleteBuffers C.GPDELETEBUFFERS
|
|
|
|
gpDeleteFramebuffersEXT C.GPDELETEFRAMEBUFFERSEXT
|
|
|
|
gpDeleteProgram C.GPDELETEPROGRAM
|
|
|
|
gpDeleteRenderbuffersEXT C.GPDELETERENDERBUFFERSEXT
|
|
|
|
gpDeleteShader C.GPDELETESHADER
|
|
|
|
gpDeleteTextures C.GPDELETETEXTURES
|
|
|
|
gpDisable C.GPDISABLE
|
|
|
|
gpDisableVertexAttribArray C.GPDISABLEVERTEXATTRIBARRAY
|
|
|
|
gpDrawElements C.GPDRAWELEMENTS
|
|
|
|
gpEnable C.GPENABLE
|
|
|
|
gpEnableVertexAttribArray C.GPENABLEVERTEXATTRIBARRAY
|
|
|
|
gpFlush C.GPFLUSH
|
|
|
|
gpFramebufferRenderbufferEXT C.GPFRAMEBUFFERRENDERBUFFEREXT
|
|
|
|
gpFramebufferTexture2DEXT C.GPFRAMEBUFFERTEXTURE2DEXT
|
|
|
|
gpGenBuffers C.GPGENBUFFERS
|
|
|
|
gpGenFramebuffersEXT C.GPGENFRAMEBUFFERSEXT
|
|
|
|
gpGenRenderbuffersEXT C.GPGENRENDERBUFFERSEXT
|
|
|
|
gpGenTextures C.GPGENTEXTURES
|
|
|
|
gpGetError C.GPGETERROR
|
|
|
|
gpGetIntegerv C.GPGETINTEGERV
|
|
|
|
gpGetProgramInfoLog C.GPGETPROGRAMINFOLOG
|
|
|
|
gpGetProgramiv C.GPGETPROGRAMIV
|
|
|
|
gpGetShaderInfoLog C.GPGETSHADERINFOLOG
|
|
|
|
gpGetShaderiv C.GPGETSHADERIV
|
|
|
|
gpGetUniformLocation C.GPGETUNIFORMLOCATION
|
|
|
|
gpIsFramebufferEXT C.GPISFRAMEBUFFEREXT
|
|
|
|
gpIsProgram C.GPISPROGRAM
|
|
|
|
gpIsRenderbufferEXT C.GPISRENDERBUFFEREXT
|
|
|
|
gpIsTexture C.GPISTEXTURE
|
|
|
|
gpLinkProgram C.GPLINKPROGRAM
|
|
|
|
gpPixelStorei C.GPPIXELSTOREI
|
|
|
|
gpReadPixels C.GPREADPIXELS
|
|
|
|
gpRenderbufferStorageEXT C.GPRENDERBUFFERSTORAGEEXT
|
|
|
|
gpScissor C.GPSCISSOR
|
|
|
|
gpShaderSource C.GPSHADERSOURCE
|
|
|
|
gpStencilFunc C.GPSTENCILFUNC
|
|
|
|
gpStencilOp C.GPSTENCILOP
|
|
|
|
gpTexImage2D C.GPTEXIMAGE2D
|
|
|
|
gpTexParameteri C.GPTEXPARAMETERI
|
|
|
|
gpTexSubImage2D C.GPTEXSUBIMAGE2D
|
|
|
|
gpUniform1fv C.GPUNIFORM1FV
|
|
|
|
gpUniform1i C.GPUNIFORM1I
|
|
|
|
gpUniform1iv C.GPUNIFORM1IV
|
|
|
|
gpUniform2fv C.GPUNIFORM2FV
|
|
|
|
gpUniform3fv C.GPUNIFORM3FV
|
|
|
|
gpUniform4fv C.GPUNIFORM4FV
|
|
|
|
gpUniformMatrix2fv C.GPUNIFORMMATRIX2FV
|
|
|
|
gpUniformMatrix3fv C.GPUNIFORMMATRIX3FV
|
|
|
|
gpUniformMatrix4fv C.GPUNIFORMMATRIX4FV
|
|
|
|
gpUseProgram C.GPUSEPROGRAM
|
|
|
|
gpVertexAttribPointer C.GPVERTEXATTRIBPOINTER
|
|
|
|
gpViewport C.GPVIEWPORT
|
2019-10-06 15:48:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func boolToInt(b bool) int {
|
|
|
|
if b {
|
|
|
|
return 1
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-05-17 16:04:13 +02:00
|
|
|
func ActiveTexture(texture uint32) {
|
|
|
|
C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func AttachShader(program uint32, shader uint32) {
|
|
|
|
C.glowAttachShader(gpAttachShader, (C.GLuint)(program), (C.GLuint)(shader))
|
|
|
|
}
|
|
|
|
|
|
|
|
func BindAttribLocation(program uint32, index uint32, name *uint8) {
|
|
|
|
C.glowBindAttribLocation(gpBindAttribLocation, (C.GLuint)(program), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func BindBuffer(target uint32, buffer uint32) {
|
|
|
|
C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer))
|
|
|
|
}
|
|
|
|
|
|
|
|
func BindFramebufferEXT(target uint32, framebuffer uint32) {
|
|
|
|
C.glowBindFramebufferEXT(gpBindFramebufferEXT, (C.GLenum)(target), (C.GLuint)(framebuffer))
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func BindRenderbufferEXT(target uint32, renderbuffer uint32) {
|
|
|
|
C.glowBindRenderbufferEXT(gpBindRenderbufferEXT, (C.GLenum)(target), (C.GLuint)(renderbuffer))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func BindTexture(target uint32, texture uint32) {
|
|
|
|
C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))
|
|
|
|
}
|
|
|
|
|
2022-10-15 11:58:56 +02:00
|
|
|
func BlendEquationSeparate(modeRGB uint32, modeAlpha uint32) {
|
|
|
|
C.glowBlendEquationSeparate(gpBlendEquationSeparate, (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha))
|
|
|
|
}
|
|
|
|
|
|
|
|
func BlendFuncSeparate(srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32) {
|
|
|
|
C.glowBlendFuncSeparate(gpBlendFuncSeparate, (C.GLenum)(srcRGB), (C.GLenum)(dstRGB), (C.GLenum)(srcAlpha), (C.GLenum)(dstAlpha))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
|
|
|
|
C.glowBufferData(gpBufferData, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLenum)(usage))
|
|
|
|
}
|
|
|
|
|
|
|
|
func BufferSubData(target uint32, offset int, size int, data unsafe.Pointer) {
|
|
|
|
C.glowBufferSubData(gpBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
|
|
|
|
}
|
|
|
|
|
|
|
|
func CheckFramebufferStatusEXT(target uint32) uint32 {
|
|
|
|
ret := C.glowCheckFramebufferStatusEXT(gpCheckFramebufferStatusEXT, (C.GLenum)(target))
|
|
|
|
return (uint32)(ret)
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func Clear(mask uint32) {
|
|
|
|
C.glowClear(gpClear, (C.GLbitfield)(mask))
|
|
|
|
}
|
|
|
|
|
|
|
|
func ColorMask(red bool, green bool, blue bool, alpha bool) {
|
|
|
|
C.glowColorMask(gpColorMask, (C.GLboolean)(boolToInt(red)), (C.GLboolean)(boolToInt(green)), (C.GLboolean)(boolToInt(blue)), (C.GLboolean)(boolToInt(alpha)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func CompileShader(shader uint32) {
|
|
|
|
C.glowCompileShader(gpCompileShader, (C.GLuint)(shader))
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateProgram() uint32 {
|
|
|
|
ret := C.glowCreateProgram(gpCreateProgram)
|
|
|
|
return (uint32)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateShader(xtype uint32) uint32 {
|
|
|
|
ret := C.glowCreateShader(gpCreateShader, (C.GLenum)(xtype))
|
|
|
|
return (uint32)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteBuffers(n int32, buffers *uint32) {
|
|
|
|
C.glowDeleteBuffers(gpDeleteBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteFramebuffersEXT(n int32, framebuffers *uint32) {
|
|
|
|
C.glowDeleteFramebuffersEXT(gpDeleteFramebuffersEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteProgram(program uint32) {
|
|
|
|
C.glowDeleteProgram(gpDeleteProgram, (C.GLuint)(program))
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func DeleteRenderbuffersEXT(n int32, renderbuffers *uint32) {
|
|
|
|
C.glowDeleteRenderbuffersEXT(gpDeleteRenderbuffersEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func DeleteShader(shader uint32) {
|
|
|
|
C.glowDeleteShader(gpDeleteShader, (C.GLuint)(shader))
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteTextures(n int32, textures *uint32) {
|
|
|
|
C.glowDeleteTextures(gpDeleteTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func Disable(cap uint32) {
|
|
|
|
C.glowDisable(gpDisable, (C.GLenum)(cap))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func DisableVertexAttribArray(index uint32) {
|
|
|
|
C.glowDisableVertexAttribArray(gpDisableVertexAttribArray, (C.GLuint)(index))
|
|
|
|
}
|
|
|
|
|
|
|
|
func DrawElements(mode uint32, count int32, xtype uint32, indices uintptr) {
|
|
|
|
C.glowDrawElements(gpDrawElements, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), C.uintptr_t(indices))
|
|
|
|
}
|
|
|
|
|
|
|
|
func Enable(cap uint32) {
|
|
|
|
C.glowEnable(gpEnable, (C.GLenum)(cap))
|
|
|
|
}
|
|
|
|
|
|
|
|
func EnableVertexAttribArray(index uint32) {
|
|
|
|
C.glowEnableVertexAttribArray(gpEnableVertexAttribArray, (C.GLuint)(index))
|
|
|
|
}
|
|
|
|
|
|
|
|
func Flush() {
|
|
|
|
C.glowFlush(gpFlush)
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func FramebufferRenderbufferEXT(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
|
|
|
|
C.glowFramebufferRenderbufferEXT(gpFramebufferRenderbufferEXT, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func FramebufferTexture2DEXT(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
|
|
|
|
C.glowFramebufferTexture2DEXT(gpFramebufferTexture2DEXT, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GenBuffers(n int32, buffers *uint32) {
|
|
|
|
C.glowGenBuffers(gpGenBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GenFramebuffersEXT(n int32, framebuffers *uint32) {
|
|
|
|
C.glowGenFramebuffersEXT(gpGenFramebuffersEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers)))
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func GenRenderbuffersEXT(n int32, renderbuffers *uint32) {
|
|
|
|
C.glowGenRenderbuffersEXT(gpGenRenderbuffersEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func GenTextures(n int32, textures *uint32) {
|
|
|
|
C.glowGenTextures(gpGenTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetError() uint32 {
|
|
|
|
ret := C.glowGetError(gpGetError)
|
|
|
|
return (uint32)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetIntegerv(pname uint32, data *int32) {
|
|
|
|
C.glowGetIntegerv(gpGetIntegerv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(data)))
|
|
|
|
}
|
|
|
|
|
2020-08-01 11:39:17 +02:00
|
|
|
func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) {
|
|
|
|
C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func GetProgramiv(program uint32, pname uint32, params *int32) {
|
|
|
|
C.glowGetProgramiv(gpGetProgramiv, (C.GLuint)(program), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8) {
|
|
|
|
C.glowGetShaderInfoLog(gpGetShaderInfoLog, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetShaderiv(shader uint32, pname uint32, params *int32) {
|
|
|
|
C.glowGetShaderiv(gpGetShaderiv, (C.GLuint)(shader), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetUniformLocation(program uint32, name *uint8) int32 {
|
|
|
|
ret := C.glowGetUniformLocation(gpGetUniformLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
|
|
|
|
return (int32)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func IsFramebufferEXT(framebuffer uint32) bool {
|
|
|
|
ret := C.glowIsFramebufferEXT(gpIsFramebufferEXT, (C.GLuint)(framebuffer))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func IsProgram(program uint32) bool {
|
|
|
|
ret := C.glowIsProgram(gpIsProgram, (C.GLuint)(program))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func IsRenderbufferEXT(renderbuffer uint32) bool {
|
|
|
|
ret := C.glowIsRenderbufferEXT(gpIsRenderbufferEXT, (C.GLuint)(renderbuffer))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func IsTexture(texture uint32) bool {
|
|
|
|
ret := C.glowIsTexture(gpIsTexture, (C.GLuint)(texture))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func LinkProgram(program uint32) {
|
|
|
|
C.glowLinkProgram(gpLinkProgram, (C.GLuint)(program))
|
|
|
|
}
|
|
|
|
|
|
|
|
func PixelStorei(pname uint32, param int32) {
|
|
|
|
C.glowPixelStorei(gpPixelStorei, (C.GLenum)(pname), (C.GLint)(param))
|
|
|
|
}
|
|
|
|
|
|
|
|
func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
|
|
|
|
C.glowReadPixels(gpReadPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func RenderbufferStorageEXT(target uint32, internalformat uint32, width int32, height int32) {
|
|
|
|
C.glowRenderbufferStorageEXT(gpRenderbufferStorageEXT, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
|
|
|
|
}
|
|
|
|
|
2020-11-07 11:14:06 +01:00
|
|
|
func Scissor(x int32, y int32, width int32, height int32) {
|
|
|
|
C.glowScissor(gpScissor, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func ShaderSource(shader uint32, count int32, xstring **uint8, length *int32) {
|
|
|
|
C.glowShaderSource(gpShaderSource, (C.GLuint)(shader), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(xstring)), (*C.GLint)(unsafe.Pointer(length)))
|
|
|
|
}
|
|
|
|
|
2021-07-04 17:10:48 +02:00
|
|
|
func StencilFunc(xfunc uint32, ref int32, mask uint32) {
|
|
|
|
C.glowStencilFunc(gpStencilFunc, (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask))
|
|
|
|
}
|
|
|
|
|
|
|
|
func StencilOp(fail uint32, zfail uint32, zpass uint32) {
|
|
|
|
C.glowStencilOp(gpStencilOp, (C.GLenum)(fail), (C.GLenum)(zfail), (C.GLenum)(zpass))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
|
|
|
|
C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TexParameteri(target uint32, pname uint32, param int32) {
|
|
|
|
C.glowTexParameteri(gpTexParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
|
|
|
|
}
|
|
|
|
|
|
|
|
func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
|
|
|
|
C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
|
|
|
|
}
|
|
|
|
|
2022-11-12 10:38:15 +01:00
|
|
|
func Uniform1fv(location int32, count int32, value *float32) {
|
|
|
|
C.glowUniform1fv(gpUniform1fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func Uniform1i(location int32, v0 int32) {
|
|
|
|
C.glowUniform1i(gpUniform1i, (C.GLint)(location), (C.GLint)(v0))
|
|
|
|
}
|
|
|
|
|
2022-11-12 10:38:15 +01:00
|
|
|
func Uniform1iv(location int32, count int32, value *int32) {
|
|
|
|
C.glowUniform1iv(gpUniform1iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func Uniform2fv(location int32, count int32, value *float32) {
|
|
|
|
C.glowUniform2fv(gpUniform2fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
2020-07-30 19:52:25 +02:00
|
|
|
func Uniform3fv(location int32, count int32, value *float32) {
|
|
|
|
C.glowUniform3fv(gpUniform3fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func Uniform4fv(location int32, count int32, value *float32) {
|
|
|
|
C.glowUniform4fv(gpUniform4fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
2020-07-30 19:52:25 +02:00
|
|
|
func UniformMatrix2fv(location int32, count int32, transpose bool, value *float32) {
|
|
|
|
C.glowUniformMatrix2fv(gpUniformMatrix2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
|
|
|
|
C.glowUniformMatrix3fv(gpUniformMatrix3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
2019-10-06 15:48:32 +02:00
|
|
|
func UniformMatrix4fv(location int32, count int32, transpose bool, value *float32) {
|
|
|
|
C.glowUniformMatrix4fv(gpUniformMatrix4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func UseProgram(program uint32) {
|
|
|
|
C.glowUseProgram(gpUseProgram, (C.GLuint)(program))
|
|
|
|
}
|
|
|
|
|
|
|
|
func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer uintptr) {
|
|
|
|
C.glowVertexAttribPointer(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), C.uintptr_t(pointer))
|
|
|
|
}
|
|
|
|
|
|
|
|
func Viewport(x int32, y int32, width int32, height int32) {
|
|
|
|
C.glowViewport(gpViewport, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
|
|
|
|
}
|
|
|
|
|
|
|
|
// InitWithProcAddrFunc intializes the package using the specified OpenGL
|
2020-09-29 09:55:39 +02:00
|
|
|
// function pointer loading function.
|
|
|
|
//
|
|
|
|
// For more cases Init should be used.
|
2019-10-06 15:48:32 +02:00
|
|
|
func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {
|
2020-05-17 16:04:13 +02:00
|
|
|
gpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr("glActiveTexture"))
|
|
|
|
if gpActiveTexture == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glActiveTexture is missing")
|
2020-05-17 16:04:13 +02:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpAttachShader = (C.GPATTACHSHADER)(getProcAddr("glAttachShader"))
|
|
|
|
if gpAttachShader == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glAttachShader is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr("glBindAttribLocation"))
|
|
|
|
if gpBindAttribLocation == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glBindAttribLocation is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBindBuffer = (C.GPBINDBUFFER)(getProcAddr("glBindBuffer"))
|
|
|
|
if gpBindBuffer == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glBindBuffer is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBindFramebufferEXT = (C.GPBINDFRAMEBUFFEREXT)(getProcAddr("glBindFramebufferEXT"))
|
2021-07-04 17:10:48 +02:00
|
|
|
gpBindRenderbufferEXT = (C.GPBINDRENDERBUFFEREXT)(getProcAddr("glBindRenderbufferEXT"))
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBindTexture = (C.GPBINDTEXTURE)(getProcAddr("glBindTexture"))
|
|
|
|
if gpBindTexture == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glBindTexture is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2022-10-15 11:58:56 +02:00
|
|
|
gpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr("glBlendEquationSeparate"))
|
|
|
|
if gpBlendEquationSeparate == nil {
|
|
|
|
return errors.New("gl: glBlendEquationSeparate is missing")
|
|
|
|
}
|
|
|
|
gpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr("glBlendFuncSeparate"))
|
|
|
|
if gpBlendFuncSeparate == nil {
|
|
|
|
return errors.New("gl: glBlendFuncSeparate is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBufferData = (C.GPBUFFERDATA)(getProcAddr("glBufferData"))
|
|
|
|
if gpBufferData == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glBufferData is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr("glBufferSubData"))
|
|
|
|
if gpBufferSubData == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glBufferSubData is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpCheckFramebufferStatusEXT = (C.GPCHECKFRAMEBUFFERSTATUSEXT)(getProcAddr("glCheckFramebufferStatusEXT"))
|
2021-07-04 17:10:48 +02:00
|
|
|
gpClear = (C.GPCLEAR)(getProcAddr("glClear"))
|
|
|
|
if gpClear == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glClear is missing")
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
gpColorMask = (C.GPCOLORMASK)(getProcAddr("glColorMask"))
|
|
|
|
if gpColorMask == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glColorMask is missing")
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpCompileShader = (C.GPCOMPILESHADER)(getProcAddr("glCompileShader"))
|
|
|
|
if gpCompileShader == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glCompileShader is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr("glCreateProgram"))
|
|
|
|
if gpCreateProgram == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glCreateProgram is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpCreateShader = (C.GPCREATESHADER)(getProcAddr("glCreateShader"))
|
|
|
|
if gpCreateShader == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glCreateShader is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr("glDeleteBuffers"))
|
|
|
|
if gpDeleteBuffers == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDeleteBuffers is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDeleteFramebuffersEXT = (C.GPDELETEFRAMEBUFFERSEXT)(getProcAddr("glDeleteFramebuffersEXT"))
|
|
|
|
gpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr("glDeleteProgram"))
|
|
|
|
if gpDeleteProgram == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDeleteProgram is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpDeleteRenderbuffersEXT = (C.GPDELETERENDERBUFFERSEXT)(getProcAddr("glDeleteRenderbuffersEXT"))
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDeleteShader = (C.GPDELETESHADER)(getProcAddr("glDeleteShader"))
|
|
|
|
if gpDeleteShader == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDeleteShader is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr("glDeleteTextures"))
|
|
|
|
if gpDeleteTextures == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDeleteTextures is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpDisable = (C.GPDISABLE)(getProcAddr("glDisable"))
|
|
|
|
if gpDisable == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDisable is missing")
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr("glDisableVertexAttribArray"))
|
|
|
|
if gpDisableVertexAttribArray == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDisableVertexAttribArray is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr("glDrawElements"))
|
|
|
|
if gpDrawElements == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glDrawElements is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpEnable = (C.GPENABLE)(getProcAddr("glEnable"))
|
|
|
|
if gpEnable == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glEnable is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr("glEnableVertexAttribArray"))
|
|
|
|
if gpEnableVertexAttribArray == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glEnableVertexAttribArray is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpFlush = (C.GPFLUSH)(getProcAddr("glFlush"))
|
|
|
|
if gpFlush == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glFlush is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpFramebufferRenderbufferEXT = (C.GPFRAMEBUFFERRENDERBUFFEREXT)(getProcAddr("glFramebufferRenderbufferEXT"))
|
2019-10-06 15:48:32 +02:00
|
|
|
gpFramebufferTexture2DEXT = (C.GPFRAMEBUFFERTEXTURE2DEXT)(getProcAddr("glFramebufferTexture2DEXT"))
|
|
|
|
gpGenBuffers = (C.GPGENBUFFERS)(getProcAddr("glGenBuffers"))
|
|
|
|
if gpGenBuffers == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGenBuffers is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGenFramebuffersEXT = (C.GPGENFRAMEBUFFERSEXT)(getProcAddr("glGenFramebuffersEXT"))
|
2021-07-04 17:10:48 +02:00
|
|
|
gpGenRenderbuffersEXT = (C.GPGENRENDERBUFFERSEXT)(getProcAddr("glGenRenderbuffersEXT"))
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGenTextures = (C.GPGENTEXTURES)(getProcAddr("glGenTextures"))
|
|
|
|
if gpGenTextures == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGenTextures is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetError = (C.GPGETERROR)(getProcAddr("glGetError"))
|
|
|
|
if gpGetError == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetError is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr("glGetIntegerv"))
|
|
|
|
if gpGetIntegerv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetIntegerv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2020-08-01 11:39:17 +02:00
|
|
|
gpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr("glGetProgramInfoLog"))
|
|
|
|
if gpGetProgramInfoLog == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetProgramInfoLog is missing")
|
2020-08-01 11:39:17 +02:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr("glGetProgramiv"))
|
|
|
|
if gpGetProgramiv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetProgramiv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr("glGetShaderInfoLog"))
|
|
|
|
if gpGetShaderInfoLog == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetShaderInfoLog is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr("glGetShaderiv"))
|
|
|
|
if gpGetShaderiv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetShaderiv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr("glGetUniformLocation"))
|
|
|
|
if gpGetUniformLocation == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glGetUniformLocation is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpIsFramebufferEXT = (C.GPISFRAMEBUFFEREXT)(getProcAddr("glIsFramebufferEXT"))
|
|
|
|
gpIsProgram = (C.GPISPROGRAM)(getProcAddr("glIsProgram"))
|
|
|
|
if gpIsProgram == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glIsProgram is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpIsRenderbufferEXT = (C.GPISRENDERBUFFEREXT)(getProcAddr("glIsRenderbufferEXT"))
|
2019-10-06 15:48:32 +02:00
|
|
|
gpIsTexture = (C.GPISTEXTURE)(getProcAddr("glIsTexture"))
|
|
|
|
if gpIsTexture == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glIsTexture is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr("glLinkProgram"))
|
|
|
|
if gpLinkProgram == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glLinkProgram is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr("glPixelStorei"))
|
|
|
|
if gpPixelStorei == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glPixelStorei is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpReadPixels = (C.GPREADPIXELS)(getProcAddr("glReadPixels"))
|
|
|
|
if gpReadPixels == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glReadPixels is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpRenderbufferStorageEXT = (C.GPRENDERBUFFERSTORAGEEXT)(getProcAddr("glRenderbufferStorageEXT"))
|
2020-11-07 11:14:06 +01:00
|
|
|
gpScissor = (C.GPSCISSOR)(getProcAddr("glScissor"))
|
|
|
|
if gpScissor == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glScissor is missing")
|
2020-11-07 11:14:06 +01:00
|
|
|
}
|
2019-10-06 15:48:32 +02:00
|
|
|
gpShaderSource = (C.GPSHADERSOURCE)(getProcAddr("glShaderSource"))
|
|
|
|
if gpShaderSource == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glShaderSource is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2021-07-04 17:10:48 +02:00
|
|
|
gpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr("glStencilFunc"))
|
|
|
|
if gpStencilFunc == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glStencilFunc is missing")
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
gpStencilOp = (C.GPSTENCILOP)(getProcAddr("glStencilOp"))
|
|
|
|
if gpStencilOp == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glStencilOp is missing")
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
2018-12-08 18:35:13 +01:00
|
|
|
gpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr("glTexImage2D"))
|
|
|
|
if gpTexImage2D == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glTexImage2D is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
gpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr("glTexParameteri"))
|
|
|
|
if gpTexParameteri == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glTexParameteri is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
gpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr("glTexSubImage2D"))
|
|
|
|
if gpTexSubImage2D == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glTexSubImage2D is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2022-11-12 10:38:15 +01:00
|
|
|
gpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr("glUniform1fv"))
|
|
|
|
if gpUniform1fv == nil {
|
|
|
|
return errors.New("gl: glUniform1fv is missing")
|
|
|
|
}
|
2018-12-08 18:35:13 +01:00
|
|
|
gpUniform1i = (C.GPUNIFORM1I)(getProcAddr("glUniform1i"))
|
|
|
|
if gpUniform1i == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniform1i is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2022-11-12 10:38:15 +01:00
|
|
|
gpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr("glUniform1iv"))
|
|
|
|
if gpUniform1iv == nil {
|
|
|
|
return errors.New("gl: glUniform1iv is missing")
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
2018-12-08 18:35:13 +01:00
|
|
|
gpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr("glUniform2fv"))
|
|
|
|
if gpUniform2fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniform2fv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2020-07-30 19:52:25 +02:00
|
|
|
gpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr("glUniform3fv"))
|
|
|
|
if gpUniform3fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniform3fv is missing")
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
2018-12-08 18:35:13 +01:00
|
|
|
gpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr("glUniform4fv"))
|
|
|
|
if gpUniform4fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniform4fv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
2020-07-30 19:52:25 +02:00
|
|
|
gpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr("glUniformMatrix2fv"))
|
|
|
|
if gpUniformMatrix2fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniformMatrix2fv is missing")
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
gpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr("glUniformMatrix3fv"))
|
|
|
|
if gpUniformMatrix3fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniformMatrix3fv is missing")
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
2018-12-08 18:35:13 +01:00
|
|
|
gpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr("glUniformMatrix4fv"))
|
|
|
|
if gpUniformMatrix4fv == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUniformMatrix4fv is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
gpUseProgram = (C.GPUSEPROGRAM)(getProcAddr("glUseProgram"))
|
|
|
|
if gpUseProgram == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glUseProgram is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
gpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr("glVertexAttribPointer"))
|
|
|
|
if gpVertexAttribPointer == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glVertexAttribPointer is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
gpViewport = (C.GPVIEWPORT)(getProcAddr("glViewport"))
|
|
|
|
if gpViewport == nil {
|
2022-09-10 07:21:59 +02:00
|
|
|
return errors.New("gl: glViewport is missing")
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|