2023-08-01 16:44:33 +02:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2022-11-13 07:37:18 +01:00
|
|
|
// SPDX-FileCopyrightText: 2014 Eric Woroshow
|
2023-07-07 19:47:27 +02:00
|
|
|
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
|
2018-12-08 18:35:13 +01:00
|
|
|
|
2023-12-19 17:52:03 +01:00
|
|
|
//go:build !darwin && !js && !windows && !playstation5
|
2018-12-08 18:35:13 +01:00
|
|
|
|
|
|
|
package gl
|
|
|
|
|
2022-11-12 19:35:40 +01:00
|
|
|
// #include <stdint.h>
|
2022-11-13 14:21:45 +01:00
|
|
|
// #include <stdlib.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
|
|
|
//
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowActiveTexture(uintptr_t fnptr, GLenum texture) {
|
|
|
|
// typedef void (*fn)(GLenum texture);
|
|
|
|
// ((fn)(fnptr))(texture);
|
2020-05-17 16:04:13 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowAttachShader(uintptr_t fnptr, GLuint program, GLuint shader) {
|
|
|
|
// typedef void (*fn)(GLuint program, GLuint shader);
|
|
|
|
// ((fn)(fnptr))(program, shader);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBindAttribLocation(uintptr_t fnptr, GLuint program, GLuint index, const GLchar* name) {
|
|
|
|
// typedef void (*fn)(GLuint program, GLuint index, const GLchar* name);
|
|
|
|
// ((fn)(fnptr))(program, index, name);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBindBuffer(uintptr_t fnptr, GLenum target, GLuint buffer) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLuint buffer);
|
|
|
|
// ((fn)(fnptr))(target, buffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowBindFramebuffer(uintptr_t fnptr, GLenum target, GLuint framebuffer) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLenum target, GLuint framebuffer);
|
|
|
|
// ((fn)(fnptr))(target, framebuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowBindRenderbuffer(uintptr_t fnptr, GLenum target, GLuint renderbuffer) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLenum target, GLuint renderbuffer);
|
|
|
|
// ((fn)(fnptr))(target, renderbuffer);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBindTexture(uintptr_t fnptr, GLenum target, GLuint texture) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLuint texture);
|
|
|
|
// ((fn)(fnptr))(target, texture);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowBindVertexArray(uintptr_t fnptr, GLuint array) {
|
|
|
|
// typedef void (*fn)(GLuint array);
|
|
|
|
// ((fn)(fnptr))(array);
|
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBlendEquationSeparate(uintptr_t fnptr, GLenum modeRGB, GLenum modeAlpha) {
|
|
|
|
// typedef void (*fn)(GLenum modeRGB, GLenum modeAlpha);
|
|
|
|
// ((fn)(fnptr))(modeRGB, modeAlpha);
|
2022-10-15 11:58:56 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBlendFuncSeparate(uintptr_t fnptr, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
|
|
|
|
// typedef void (*fn)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
|
|
|
// ((fn)(fnptr))(srcRGB, dstRGB, srcAlpha, dstAlpha);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBufferData(uintptr_t fnptr, GLenum target, GLsizeiptr size, const void* data, GLenum usage) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
|
|
|
|
// ((fn)(fnptr))(target, size, data, usage);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowBufferSubData(uintptr_t fnptr, GLenum target, GLintptr offset, GLsizeiptr size, const void* data) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
|
|
|
|
// ((fn)(fnptr))(target, offset, size, data);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static GLenum glowCheckFramebufferStatus(uintptr_t fnptr, GLenum target) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef GLenum (*fn)(GLenum target);
|
|
|
|
// return ((fn)(fnptr))(target);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowClear(uintptr_t fnptr, GLbitfield mask) {
|
|
|
|
// typedef void (*fn)(GLbitfield mask);
|
|
|
|
// ((fn)(fnptr))(mask);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowColorMask(uintptr_t fnptr, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
|
|
|
|
// typedef void (*fn)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
|
|
|
// ((fn)(fnptr))(red, green, blue, alpha);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowCompileShader(uintptr_t fnptr, GLuint shader) {
|
|
|
|
// typedef void (*fn)(GLuint shader);
|
|
|
|
// ((fn)(fnptr))(shader);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static GLuint glowCreateProgram(uintptr_t fnptr) {
|
|
|
|
// typedef GLuint (*fn)();
|
|
|
|
// return ((fn)(fnptr))();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static GLuint glowCreateShader(uintptr_t fnptr, GLenum type) {
|
|
|
|
// typedef GLuint (*fn)(GLenum type);
|
|
|
|
// return ((fn)(fnptr))(type);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDeleteBuffers(uintptr_t fnptr, GLsizei n, const GLuint* buffers) {
|
|
|
|
// typedef void (*fn)(GLsizei n, const GLuint* buffers);
|
|
|
|
// ((fn)(fnptr))(n, buffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowDeleteFramebuffers(uintptr_t fnptr, GLsizei n, const GLuint* framebuffers) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLsizei n, const GLuint* framebuffers);
|
|
|
|
// ((fn)(fnptr))(n, framebuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDeleteProgram(uintptr_t fnptr, GLuint program) {
|
|
|
|
// typedef void (*fn)(GLuint program);
|
|
|
|
// ((fn)(fnptr))(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowDeleteRenderbuffers(uintptr_t fnptr, GLsizei n, const GLuint* renderbuffers) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLsizei n, const GLuint* renderbuffers);
|
|
|
|
// ((fn)(fnptr))(n, renderbuffers);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDeleteShader(uintptr_t fnptr, GLuint shader) {
|
|
|
|
// typedef void (*fn)(GLuint shader);
|
|
|
|
// ((fn)(fnptr))(shader);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDeleteTextures(uintptr_t fnptr, GLsizei n, const GLuint* textures) {
|
|
|
|
// typedef void (*fn)(GLsizei n, const GLuint* textures);
|
|
|
|
// ((fn)(fnptr))(n, textures);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowDeleteVertexArrays(uintptr_t fnptr, GLsizei n, const GLuint* arrays) {
|
|
|
|
// typedef void (*fn)(GLsizei n, const GLuint* arrays);
|
|
|
|
// ((fn)(fnptr))(n, arrays);
|
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDisable(uintptr_t fnptr, GLenum cap) {
|
|
|
|
// typedef void (*fn)(GLenum cap);
|
|
|
|
// ((fn)(fnptr))(cap);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDisableVertexAttribArray(uintptr_t fnptr, GLuint index) {
|
|
|
|
// typedef void (*fn)(GLuint index);
|
|
|
|
// ((fn)(fnptr))(index);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2024-04-09 02:40:21 +02:00
|
|
|
// static void glowDrawBuffers(uintptr_t fnptr, GLsizei n, const GLenum* bufs) {
|
2024-04-09 02:26:29 +02:00
|
|
|
// typedef void (*fn)(GLsizei n, const GLenum* bufs);
|
|
|
|
// ((fn)(fnptr))(n, bufs);
|
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowDrawElements(uintptr_t fnptr, GLenum mode, GLsizei count, GLenum type, const uintptr_t indices) {
|
|
|
|
// typedef void (*fn)(GLenum mode, GLsizei count, GLenum type, const uintptr_t indices);
|
|
|
|
// ((fn)(fnptr))(mode, count, type, indices);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowEnable(uintptr_t fnptr, GLenum cap) {
|
|
|
|
// typedef void (*fn)(GLenum cap);
|
|
|
|
// ((fn)(fnptr))(cap);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowEnableVertexAttribArray(uintptr_t fnptr, GLuint index) {
|
|
|
|
// typedef void (*fn)(GLuint index);
|
|
|
|
// ((fn)(fnptr))(index);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowFlush(uintptr_t fnptr) {
|
|
|
|
// typedef void (*fn)();
|
|
|
|
// ((fn)(fnptr))();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowFramebufferRenderbuffer(uintptr_t fnptr, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
|
|
|
// ((fn)(fnptr))(target, attachment, renderbuffertarget, renderbuffer);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowFramebufferTexture2D(uintptr_t fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
|
|
|
// ((fn)(fnptr))(target, attachment, textarget, texture, level);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGenBuffers(uintptr_t fnptr, GLsizei n, GLuint* buffers) {
|
|
|
|
// typedef void (*fn)(GLsizei n, GLuint* buffers);
|
|
|
|
// ((fn)(fnptr))(n, buffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowGenFramebuffers(uintptr_t fnptr, GLsizei n, GLuint* framebuffers) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLsizei n, GLuint* framebuffers);
|
|
|
|
// ((fn)(fnptr))(n, framebuffers);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowGenRenderbuffers(uintptr_t fnptr, GLsizei n, GLuint* renderbuffers) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLsizei n, GLuint* renderbuffers);
|
|
|
|
// ((fn)(fnptr))(n, renderbuffers);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGenTextures(uintptr_t fnptr, GLsizei n, GLuint* textures) {
|
|
|
|
// typedef void (*fn)(GLsizei n, GLuint* textures);
|
|
|
|
// ((fn)(fnptr))(n, textures);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowGenVertexArrays(uintptr_t fnptr, GLsizei n, GLuint* arrays) {
|
|
|
|
// typedef void (*fn)(GLsizei n, GLuint* arrays);
|
|
|
|
// ((fn)(fnptr))(n, arrays);
|
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static GLenum glowGetError(uintptr_t fnptr) {
|
|
|
|
// typedef GLenum (*fn)();
|
|
|
|
// return ((fn)(fnptr))();
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGetIntegerv(uintptr_t fnptr, GLenum pname, GLint* data) {
|
|
|
|
// typedef void (*fn)(GLenum pname, GLint* data);
|
|
|
|
// ((fn)(fnptr))(pname, data);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGetProgramInfoLog(uintptr_t fnptr, GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
|
|
|
|
// typedef void (*fn)(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
|
|
|
|
// ((fn)(fnptr))(program, bufSize, length, infoLog);
|
2020-08-01 11:39:17 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGetProgramiv(uintptr_t fnptr, GLuint program, GLenum pname, GLint* params) {
|
|
|
|
// typedef void (*fn)(GLuint program, GLenum pname, GLint* params);
|
|
|
|
// ((fn)(fnptr))(program, pname, params);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGetShaderInfoLog(uintptr_t fnptr, GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
|
|
|
|
// typedef void (*fn)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
|
|
|
|
// ((fn)(fnptr))(shader, bufSize, length, infoLog);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowGetShaderiv(uintptr_t fnptr, GLuint shader, GLenum pname, GLint* params) {
|
|
|
|
// typedef void (*fn)(GLuint shader, GLenum pname, GLint* params);
|
|
|
|
// ((fn)(fnptr))(shader, pname, params);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static GLint glowGetUniformLocation(uintptr_t fnptr, GLuint program, const GLchar* name) {
|
|
|
|
// typedef GLint (*fn)(GLuint program, const GLchar* name);
|
|
|
|
// return ((fn)(fnptr))(program, name);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static GLboolean glowIsFramebuffer(uintptr_t fnptr, GLuint framebuffer) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef GLboolean (*fn)(GLuint framebuffer);
|
|
|
|
// return ((fn)(fnptr))(framebuffer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static GLboolean glowIsProgram(uintptr_t fnptr, GLuint program) {
|
|
|
|
// typedef GLboolean (*fn)(GLuint program);
|
|
|
|
// return ((fn)(fnptr))(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static GLboolean glowIsRenderbuffer(uintptr_t fnptr, GLuint renderbuffer) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef GLboolean (*fn)(GLuint renderbuffer);
|
|
|
|
// return ((fn)(fnptr))(renderbuffer);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowLinkProgram(uintptr_t fnptr, GLuint program) {
|
|
|
|
// typedef void (*fn)(GLuint program);
|
|
|
|
// ((fn)(fnptr))(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowPixelStorei(uintptr_t fnptr, GLenum pname, GLint param) {
|
|
|
|
// typedef void (*fn)(GLenum pname, GLint param);
|
|
|
|
// ((fn)(fnptr))(pname, param);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowReadPixels(uintptr_t fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) {
|
|
|
|
// typedef void (*fn)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
|
|
|
|
// ((fn)(fnptr))(x, y, width, height, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-19 15:56:53 +02:00
|
|
|
// static void glowRenderbufferStorage(uintptr_t fnptr, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
2023-04-22 09:37:56 +02:00
|
|
|
// typedef void (*fn)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
|
|
|
// ((fn)(fnptr))(target, internalformat, width, height);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowScissor(uintptr_t fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
// typedef void (*fn)(GLint x, GLint y, GLsizei width, GLsizei height);
|
|
|
|
// ((fn)(fnptr))(x, y, width, height);
|
2020-11-07 11:14:06 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowShaderSource(uintptr_t fnptr, GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length) {
|
|
|
|
// typedef void (*fn)(GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length);
|
|
|
|
// ((fn)(fnptr))(shader, count, string, length);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowStencilFunc(uintptr_t fnptr, GLenum func, GLint ref, GLuint mask) {
|
|
|
|
// typedef void (*fn)(GLenum func, GLint ref, GLuint mask);
|
|
|
|
// ((fn)(fnptr))(func, ref, mask);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-11-06 01:18:08 +01:00
|
|
|
// static void glowStencilOpSeparate(uintptr_t fnptr, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
|
|
|
|
// typedef void (*fn)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
|
|
|
// ((fn)(fnptr))(face, fail, zfail, zpass);
|
2021-07-04 17:10:48 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowTexImage2D(uintptr_t fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
|
|
|
|
// ((fn)(fnptr))(target, level, internalformat, width, height, border, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowTexParameteri(uintptr_t fnptr, GLenum target, GLenum pname, GLint param) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLenum pname, GLint param);
|
|
|
|
// ((fn)(fnptr))(target, pname, param);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowTexSubImage2D(uintptr_t fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) {
|
|
|
|
// typedef void (*fn)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
|
|
|
|
// ((fn)(fnptr))(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform1fv(uintptr_t fnptr, GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2022-11-12 10:38:15 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform1i(uintptr_t fnptr, GLint location, GLint v0) {
|
|
|
|
// typedef void (*fn)(GLint location, GLint v0);
|
|
|
|
// ((fn)(fnptr))(location, v0);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform1iv(uintptr_t fnptr, GLint location, GLsizei count, const GLint* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLint* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform2fv(uintptr_t fnptr, GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform2iv(uintptr_t fnptr, GLint location, GLsizei count, const GLint* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLint* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2022-11-20 07:36:07 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform3fv(uintptr_t fnptr, GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform3iv(uintptr_t fnptr, GLint location, GLsizei count, const GLint* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLint* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2022-11-20 07:36:07 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform4fv(uintptr_t fnptr, GLint location, GLsizei count, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniform4iv(uintptr_t fnptr, GLint location, GLsizei count, const GLint* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, const GLint* value);
|
|
|
|
// ((fn)(fnptr))(location, count, value);
|
2022-11-20 07:36:07 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniformMatrix2fv(uintptr_t fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, transpose, value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniformMatrix3fv(uintptr_t fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, transpose, value);
|
2020-07-30 19:52:25 +02:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUniformMatrix4fv(uintptr_t fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
|
|
|
|
// typedef void (*fn)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
|
|
// ((fn)(fnptr))(location, count, transpose, value);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowUseProgram(uintptr_t fnptr, GLuint program) {
|
|
|
|
// typedef void (*fn)(GLuint program);
|
|
|
|
// ((fn)(fnptr))(program);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowVertexAttribPointer(uintptr_t fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const uintptr_t pointer) {
|
|
|
|
// typedef void (*fn)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const uintptr_t pointer);
|
|
|
|
// ((fn)(fnptr))(index, size, type, normalized, stride, pointer);
|
2018-12-08 18:35:13 +01:00
|
|
|
// }
|
2023-04-22 09:37:56 +02:00
|
|
|
// static void glowViewport(uintptr_t fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
|
|
|
|
// typedef void (*fn)(GLint x, GLint y, GLsizei width, GLsizei height);
|
|
|
|
// ((fn)(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 (
|
2022-11-13 07:37:18 +01:00
|
|
|
"runtime"
|
2019-10-06 15:48:32 +02:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
type defaultContext struct {
|
2023-04-19 15:56:53 +02:00
|
|
|
gpActiveTexture C.uintptr_t
|
|
|
|
gpAttachShader C.uintptr_t
|
|
|
|
gpBindAttribLocation C.uintptr_t
|
|
|
|
gpBindBuffer C.uintptr_t
|
|
|
|
gpBindFramebuffer C.uintptr_t
|
|
|
|
gpBindRenderbuffer C.uintptr_t
|
|
|
|
gpBindTexture C.uintptr_t
|
|
|
|
gpBindVertexArray C.uintptr_t
|
|
|
|
gpBlendEquationSeparate C.uintptr_t
|
|
|
|
gpBlendFuncSeparate C.uintptr_t
|
|
|
|
gpBufferData C.uintptr_t
|
|
|
|
gpBufferSubData C.uintptr_t
|
|
|
|
gpCheckFramebufferStatus C.uintptr_t
|
|
|
|
gpClear C.uintptr_t
|
|
|
|
gpColorMask C.uintptr_t
|
|
|
|
gpCompileShader C.uintptr_t
|
|
|
|
gpCreateProgram C.uintptr_t
|
|
|
|
gpCreateShader C.uintptr_t
|
|
|
|
gpDeleteBuffers C.uintptr_t
|
|
|
|
gpDeleteFramebuffers C.uintptr_t
|
|
|
|
gpDeleteProgram C.uintptr_t
|
|
|
|
gpDeleteRenderbuffers C.uintptr_t
|
|
|
|
gpDeleteShader C.uintptr_t
|
|
|
|
gpDeleteTextures C.uintptr_t
|
|
|
|
gpDeleteVertexArrays C.uintptr_t
|
|
|
|
gpDisable C.uintptr_t
|
|
|
|
gpDisableVertexAttribArray C.uintptr_t
|
2024-04-09 02:26:29 +02:00
|
|
|
gpDrawBuffers C.uintptr_t
|
2023-04-19 15:56:53 +02:00
|
|
|
gpDrawElements C.uintptr_t
|
|
|
|
gpEnable C.uintptr_t
|
|
|
|
gpEnableVertexAttribArray C.uintptr_t
|
|
|
|
gpFlush C.uintptr_t
|
|
|
|
gpFramebufferRenderbuffer C.uintptr_t
|
|
|
|
gpFramebufferTexture2D C.uintptr_t
|
|
|
|
gpGenBuffers C.uintptr_t
|
|
|
|
gpGenFramebuffers C.uintptr_t
|
|
|
|
gpGenRenderbuffers C.uintptr_t
|
|
|
|
gpGenTextures C.uintptr_t
|
|
|
|
gpGenVertexArrays C.uintptr_t
|
|
|
|
gpGetError C.uintptr_t
|
|
|
|
gpGetIntegerv C.uintptr_t
|
|
|
|
gpGetProgramInfoLog C.uintptr_t
|
|
|
|
gpGetProgramiv C.uintptr_t
|
|
|
|
gpGetShaderInfoLog C.uintptr_t
|
|
|
|
gpGetShaderiv C.uintptr_t
|
|
|
|
gpGetUniformLocation C.uintptr_t
|
|
|
|
gpIsFramebuffer C.uintptr_t
|
|
|
|
gpIsProgram C.uintptr_t
|
|
|
|
gpIsRenderbuffer C.uintptr_t
|
|
|
|
gpLinkProgram C.uintptr_t
|
|
|
|
gpPixelStorei C.uintptr_t
|
|
|
|
gpReadPixels C.uintptr_t
|
|
|
|
gpRenderbufferStorage C.uintptr_t
|
|
|
|
gpScissor C.uintptr_t
|
|
|
|
gpShaderSource C.uintptr_t
|
|
|
|
gpStencilFunc C.uintptr_t
|
2023-11-06 01:18:08 +01:00
|
|
|
gpStencilOpSeparate C.uintptr_t
|
2023-04-19 15:56:53 +02:00
|
|
|
gpTexImage2D C.uintptr_t
|
|
|
|
gpTexParameteri C.uintptr_t
|
|
|
|
gpTexSubImage2D C.uintptr_t
|
|
|
|
gpUniform1fv C.uintptr_t
|
|
|
|
gpUniform1i C.uintptr_t
|
|
|
|
gpUniform1iv C.uintptr_t
|
|
|
|
gpUniform2fv C.uintptr_t
|
|
|
|
gpUniform2iv C.uintptr_t
|
|
|
|
gpUniform3fv C.uintptr_t
|
|
|
|
gpUniform3iv C.uintptr_t
|
|
|
|
gpUniform4fv C.uintptr_t
|
|
|
|
gpUniform4iv C.uintptr_t
|
|
|
|
gpUniformMatrix2fv C.uintptr_t
|
|
|
|
gpUniformMatrix3fv C.uintptr_t
|
|
|
|
gpUniformMatrix4fv C.uintptr_t
|
|
|
|
gpUseProgram C.uintptr_t
|
|
|
|
gpVertexAttribPointer C.uintptr_t
|
|
|
|
gpViewport C.uintptr_t
|
2022-11-13 19:42:37 +01:00
|
|
|
|
|
|
|
isES bool
|
2022-11-13 07:37:18 +01:00
|
|
|
}
|
|
|
|
|
2022-11-13 19:42:37 +01:00
|
|
|
func NewDefaultContext() (Context, error) {
|
|
|
|
ctx := &defaultContext{}
|
|
|
|
if err := ctx.init(); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return ctx, nil
|
2022-11-13 07:37:18 +01:00
|
|
|
}
|
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
|
|
|
|
}
|
|
|
|
|
2022-11-13 18:03:36 +01:00
|
|
|
func (c *defaultContext) IsES() bool {
|
2022-11-13 19:42:37 +01:00
|
|
|
return c.isES
|
2022-11-13 18:03:36 +01:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) ActiveTexture(texture uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowActiveTexture(c.gpActiveTexture, C.GLenum(texture))
|
2020-05-17 16:04:13 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) AttachShader(program uint32, shader uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowAttachShader(c.gpAttachShader, C.GLuint(program), C.GLuint(shader))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BindAttribLocation(program uint32, index uint32, name string) {
|
2022-11-13 14:21:45 +01:00
|
|
|
cname := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(cname))
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBindAttribLocation(c.gpBindAttribLocation, C.GLuint(program), C.GLuint(index), (*C.GLchar)(unsafe.Pointer(cname)))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BindBuffer(target uint32, buffer uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBindBuffer(c.gpBindBuffer, C.GLenum(target), C.GLuint(buffer))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BindFramebuffer(target uint32, framebuffer uint32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowBindFramebuffer(c.gpBindFramebuffer, C.GLenum(target), C.GLuint(framebuffer))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BindRenderbuffer(target uint32, renderbuffer uint32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowBindRenderbuffer(c.gpBindRenderbuffer, C.GLenum(target), C.GLuint(renderbuffer))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BindTexture(target uint32, texture uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBindTexture(c.gpBindTexture, C.GLenum(target), C.GLuint(texture))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2023-04-19 15:56:53 +02:00
|
|
|
func (c *defaultContext) BindVertexArray(array uint32) {
|
|
|
|
C.glowBindVertexArray(c.gpBindVertexArray, C.GLuint(array))
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BlendEquationSeparate(modeRGB uint32, modeAlpha uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBlendEquationSeparate(c.gpBlendEquationSeparate, C.GLenum(modeRGB), C.GLenum(modeAlpha))
|
2022-10-15 11:58:56 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BlendFuncSeparate(srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBlendFuncSeparate(c.gpBlendFuncSeparate, C.GLenum(srcRGB), C.GLenum(dstRGB), C.GLenum(srcAlpha), C.GLenum(dstAlpha))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) BufferInit(target uint32, size int, usage uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBufferData(c.gpBufferData, C.GLenum(target), C.GLsizeiptr(size), nil, C.GLenum(usage))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) BufferSubData(target uint32, offset int, data []byte) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowBufferSubData(c.gpBufferSubData, C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(len(data)), unsafe.Pointer(&data[0]))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(data)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) CheckFramebufferStatus(target uint32) uint32 {
|
2023-04-19 15:56:53 +02:00
|
|
|
ret := C.glowCheckFramebufferStatus(c.gpCheckFramebufferStatus, C.GLenum(target))
|
2022-11-13 07:37:18 +01:00
|
|
|
return uint32(ret)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Clear(mask uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowClear(c.gpClear, C.GLbitfield(mask))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) ColorMask(red bool, green bool, blue bool, alpha bool) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowColorMask(c.gpColorMask, C.GLboolean(boolToInt(red)), C.GLboolean(boolToInt(green)), C.GLboolean(boolToInt(blue)), C.GLboolean(boolToInt(alpha)))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) CompileShader(shader uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowCompileShader(c.gpCompileShader, C.GLuint(shader))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) CreateBuffer() uint32 {
|
|
|
|
var buffer uint32
|
|
|
|
C.glowGenBuffers(c.gpGenBuffers, 1, (*C.GLuint)(unsafe.Pointer(&buffer)))
|
|
|
|
return buffer
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *defaultContext) CreateFramebuffer() uint32 {
|
|
|
|
var framebuffer uint32
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowGenFramebuffers(c.gpGenFramebuffers, 1, (*C.GLuint)(unsafe.Pointer(&framebuffer)))
|
2022-11-16 16:55:16 +01:00
|
|
|
return framebuffer
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) CreateProgram() uint32 {
|
|
|
|
ret := C.glowCreateProgram(c.gpCreateProgram)
|
|
|
|
return uint32(ret)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) CreateRenderbuffer() uint32 {
|
|
|
|
var renderbuffer uint32
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowGenRenderbuffers(c.gpGenRenderbuffers, 1, (*C.GLuint)(unsafe.Pointer(&renderbuffer)))
|
2022-11-16 16:55:16 +01:00
|
|
|
return renderbuffer
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) CreateShader(xtype uint32) uint32 {
|
2023-04-22 09:37:56 +02:00
|
|
|
ret := C.glowCreateShader(c.gpCreateShader, C.GLenum(xtype))
|
2022-11-13 07:37:18 +01:00
|
|
|
return uint32(ret)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) CreateTexture() uint32 {
|
|
|
|
var texture uint32
|
|
|
|
C.glowGenTextures(c.gpGenTextures, 1, (*C.GLuint)(unsafe.Pointer(&texture)))
|
|
|
|
return texture
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2023-04-19 15:56:53 +02:00
|
|
|
func (c *defaultContext) CreateVertexArray() uint32 {
|
|
|
|
var array uint32
|
|
|
|
C.glowGenVertexArrays(c.gpGenVertexArrays, 1, (*C.GLuint)(unsafe.Pointer(&array)))
|
|
|
|
return array
|
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) DeleteBuffer(buffer uint32) {
|
|
|
|
C.glowDeleteBuffers(c.gpDeleteBuffers, 1, (*C.GLuint)(unsafe.Pointer(&buffer)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *defaultContext) DeleteFramebuffer(framebuffer uint32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowDeleteFramebuffers(c.gpDeleteFramebuffers, 1, (*C.GLuint)(unsafe.Pointer(&framebuffer)))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) DeleteProgram(program uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowDeleteProgram(c.gpDeleteProgram, C.GLuint(program))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) DeleteRenderbuffer(renderbuffer uint32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowDeleteRenderbuffers(c.gpDeleteRenderbuffers, 1, (*C.GLuint)(unsafe.Pointer(&renderbuffer)))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) DeleteShader(shader uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowDeleteShader(c.gpDeleteShader, C.GLuint(shader))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) DeleteTexture(texture uint32) {
|
|
|
|
C.glowDeleteTextures(c.gpDeleteTextures, 1, (*C.GLuint)(unsafe.Pointer(&texture)))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2023-04-19 15:56:53 +02:00
|
|
|
func (c *defaultContext) DeleteVertexArray(array uint32) {
|
|
|
|
C.glowDeleteVertexArrays(c.gpDeleteVertexArrays, 1, (*C.GLuint)(unsafe.Pointer(&array)))
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Disable(cap uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowDisable(c.gpDisable, C.GLenum(cap))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) DisableVertexAttribArray(index uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowDisableVertexAttribArray(c.gpDisableVertexAttribArray, C.GLuint(index))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2024-04-09 02:26:29 +02:00
|
|
|
func (c *defaultContext) DrawBuffers(bufs []uint32) {
|
|
|
|
C.glowDrawBuffers(c.gpDrawBuffers, C.GLsizei(len(bufs)), (*C.GLenum)(unsafe.Pointer(&bufs[0])))
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) DrawElements(mode uint32, count int32, xtype uint32, offset int) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowDrawElements(c.gpDrawElements, C.GLenum(mode), C.GLsizei(count), C.GLenum(xtype), C.uintptr_t(offset))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Enable(cap uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowEnable(c.gpEnable, C.GLenum(cap))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) EnableVertexAttribArray(index uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowEnableVertexAttribArray(c.gpEnableVertexAttribArray, C.GLuint(index))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Flush() {
|
|
|
|
C.glowFlush(c.gpFlush)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowFramebufferRenderbuffer(c.gpFramebufferRenderbuffer, C.GLenum(target), C.GLenum(attachment), C.GLenum(renderbuffertarget), C.GLuint(renderbuffer))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) FramebufferTexture2D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowFramebufferTexture2D(c.gpFramebufferTexture2D, C.GLenum(target), C.GLenum(attachment), C.GLenum(textarget), C.GLuint(texture), C.GLint(level))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) GetError() uint32 {
|
|
|
|
ret := C.glowGetError(c.gpGetError)
|
|
|
|
return uint32(ret)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 15:59:28 +01:00
|
|
|
func (c *defaultContext) GetInteger(pname uint32) int {
|
2022-11-16 16:26:26 +01:00
|
|
|
var dst int32
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowGetIntegerv(c.gpGetIntegerv, C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst)))
|
2022-11-16 16:26:26 +01:00
|
|
|
return int(dst)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) GetProgramInfoLog(program uint32) string {
|
2022-11-16 16:26:26 +01:00
|
|
|
bufSize := c.GetProgrami(program, INFO_LOG_LENGTH)
|
|
|
|
infoLog := make([]byte, bufSize)
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowGetProgramInfoLog(c.gpGetProgramInfoLog, C.GLuint(program), C.GLsizei(bufSize), nil, (*C.GLchar)(unsafe.Pointer(&infoLog[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
return string(infoLog)
|
2020-08-01 11:39:17 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:26:26 +01:00
|
|
|
func (c *defaultContext) GetProgrami(program uint32, pname uint32) int {
|
|
|
|
var dst int32
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowGetProgramiv(c.gpGetProgramiv, C.GLuint(program), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst)))
|
2022-11-16 16:26:26 +01:00
|
|
|
return int(dst)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) GetShaderInfoLog(shader uint32) string {
|
2022-11-16 16:26:26 +01:00
|
|
|
bufSize := c.GetShaderi(shader, INFO_LOG_LENGTH)
|
|
|
|
infoLog := make([]byte, bufSize)
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowGetShaderInfoLog(c.gpGetShaderInfoLog, C.GLuint(shader), C.GLsizei(bufSize), nil, (*C.GLchar)(unsafe.Pointer(&infoLog[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
return string(infoLog)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:26:26 +01:00
|
|
|
func (c *defaultContext) GetShaderi(shader uint32, pname uint32) int {
|
|
|
|
var dst int32
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowGetShaderiv(c.gpGetShaderiv, C.GLuint(shader), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst)))
|
2022-11-16 16:26:26 +01:00
|
|
|
return int(dst)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) GetUniformLocation(program uint32, name string) int32 {
|
2022-11-13 14:21:45 +01:00
|
|
|
cname := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(cname))
|
2023-04-22 09:37:56 +02:00
|
|
|
ret := C.glowGetUniformLocation(c.gpGetUniformLocation, C.GLuint(program), (*C.GLchar)(unsafe.Pointer(cname)))
|
2022-11-13 07:37:18 +01:00
|
|
|
return int32(ret)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) IsFramebuffer(framebuffer uint32) bool {
|
2023-04-19 15:56:53 +02:00
|
|
|
ret := C.glowIsFramebuffer(c.gpIsFramebuffer, C.GLuint(framebuffer))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) IsProgram(program uint32) bool {
|
2023-04-22 09:37:56 +02:00
|
|
|
ret := C.glowIsProgram(c.gpIsProgram, C.GLuint(program))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
|
2023-04-19 15:56:53 +02:00
|
|
|
ret := C.glowIsRenderbuffer(c.gpIsRenderbuffer, C.GLuint(renderbuffer))
|
2022-11-13 05:24:54 +01:00
|
|
|
return ret == TRUE
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) LinkProgram(program uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowLinkProgram(c.gpLinkProgram, C.GLuint(program))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) PixelStorei(pname uint32, param int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowPixelStorei(c.gpPixelStorei, C.GLenum(pname), C.GLint(param))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) ReadPixels(dst []byte, x int32, y int32, width int32, height int32, format uint32, xtype uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowReadPixels(c.gpReadPixels, C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height), C.GLenum(format), C.GLenum(xtype), unsafe.Pointer(&dst[0]))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
|
2023-04-19 15:56:53 +02:00
|
|
|
C.glowRenderbufferStorage(c.gpRenderbufferStorage, C.GLenum(target), C.GLenum(internalformat), C.GLsizei(width), C.GLsizei(height))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Scissor(x int32, y int32, width int32, height int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowScissor(c.gpScissor, C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
|
2020-11-07 11:14:06 +01:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) ShaderSource(shader uint32, xstring string) {
|
2022-11-13 14:21:45 +01:00
|
|
|
cstring := C.CString(xstring)
|
|
|
|
defer C.free(unsafe.Pointer(cstring))
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowShaderSource(c.gpShaderSource, C.GLuint(shader), 1, (**C.GLchar)(unsafe.Pointer(&cstring)), nil)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) StencilFunc(xfunc uint32, ref int32, mask uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowStencilFunc(c.gpStencilFunc, C.GLenum(xfunc), C.GLint(ref), C.GLuint(mask))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2023-11-06 01:18:08 +01:00
|
|
|
func (c *defaultContext) StencilOpSeparate(face uint32, fail uint32, zfail uint32, zpass uint32) {
|
|
|
|
C.glowStencilOpSeparate(c.gpStencilOpSeparate, C.GLenum(face), C.GLenum(fail), C.GLenum(zfail), C.GLenum(zpass))
|
2021-07-04 17:10:48 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, format uint32, xtype uint32, pixels []byte) {
|
|
|
|
var ptr *byte
|
|
|
|
if len(pixels) > 0 {
|
|
|
|
ptr = &pixels[0]
|
|
|
|
}
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowTexImage2D(c.gpTexImage2D, C.GLenum(target), C.GLint(level), C.GLint(internalformat), C.GLsizei(width), C.GLsizei(height), 0, C.GLenum(format), C.GLenum(xtype), unsafe.Pointer(ptr))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(pixels)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) TexParameteri(target uint32, pname uint32, param int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowTexParameteri(c.gpTexParameteri, C.GLenum(target), C.GLenum(pname), C.GLint(param))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels []byte) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowTexSubImage2D(c.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), unsafe.Pointer(&pixels[0]))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(pixels)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform1fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform1fv(c.gpUniform1fv, C.GLint(location), C.GLsizei(len(value)), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2022-11-12 10:38:15 +01:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform1i(location int32, v0 int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform1i(c.gpUniform1i, C.GLint(location), C.GLint(v0))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform1iv(location int32, value []int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform1iv(c.gpUniform1iv, C.GLint(location), C.GLsizei(len(value)), (*C.GLint)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform2fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform2fv(c.gpUniform2fv, C.GLint(location), C.GLsizei(len(value)/2), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-20 07:36:07 +01:00
|
|
|
func (c *defaultContext) Uniform2iv(location int32, value []int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform2iv(c.gpUniform2iv, C.GLint(location), C.GLsizei(len(value)/2), (*C.GLint)(unsafe.Pointer(&value[0])))
|
2022-11-20 07:36:07 +01:00
|
|
|
runtime.KeepAlive(value)
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform3fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform3fv(c.gpUniform3fv, C.GLint(location), C.GLsizei(len(value)/3), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
|
2022-11-20 07:36:07 +01:00
|
|
|
func (c *defaultContext) Uniform3iv(location int32, value []int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform3iv(c.gpUniform3iv, C.GLint(location), C.GLsizei(len(value)/3), (*C.GLint)(unsafe.Pointer(&value[0])))
|
2022-11-20 07:36:07 +01:00
|
|
|
runtime.KeepAlive(value)
|
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Uniform4fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform4fv(c.gpUniform4fv, C.GLint(location), C.GLsizei(len(value)/4), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-20 07:36:07 +01:00
|
|
|
func (c *defaultContext) Uniform4iv(location int32, value []int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniform4iv(c.gpUniform4iv, C.GLint(location), C.GLsizei(len(value)/4), (*C.GLint)(unsafe.Pointer(&value[0])))
|
2022-11-20 07:36:07 +01:00
|
|
|
runtime.KeepAlive(value)
|
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) UniformMatrix2fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniformMatrix2fv(c.gpUniformMatrix2fv, C.GLint(location), C.GLsizei(len(value)/4), 0, (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) UniformMatrix3fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniformMatrix3fv(c.gpUniformMatrix3fv, C.GLint(location), C.GLsizei(len(value)/9), 0, (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2020-07-30 19:52:25 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:55:16 +01:00
|
|
|
func (c *defaultContext) UniformMatrix4fv(location int32, value []float32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUniformMatrix4fv(c.gpUniformMatrix4fv, C.GLint(location), C.GLsizei(len(value)/16), 0, (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
2022-11-13 07:37:18 +01:00
|
|
|
runtime.KeepAlive(value)
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) UseProgram(program uint32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowUseProgram(c.gpUseProgram, C.GLuint(program))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset int) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowVertexAttribPointer(c.gpVertexAttribPointer, C.GLuint(index), C.GLint(size), C.GLenum(xtype), C.GLboolean(boolToInt(normalized)), C.GLsizei(stride), C.uintptr_t(offset))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 07:37:18 +01:00
|
|
|
func (c *defaultContext) Viewport(x int32, y int32, width int32, height int32) {
|
2023-04-22 09:37:56 +02:00
|
|
|
C.glowViewport(c.gpViewport, C.GLint(x), C.GLint(y), C.GLsizei(width), C.GLsizei(height))
|
2019-10-06 15:48:32 +02:00
|
|
|
}
|
|
|
|
|
2022-11-13 19:42:37 +01:00
|
|
|
func (c *defaultContext) LoadFunctions() error {
|
2023-04-22 08:09:24 +02:00
|
|
|
g := procAddressGetter{ctx: c}
|
|
|
|
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpActiveTexture = C.uintptr_t(g.get("glActiveTexture"))
|
|
|
|
c.gpAttachShader = C.uintptr_t(g.get("glAttachShader"))
|
|
|
|
c.gpBindAttribLocation = C.uintptr_t(g.get("glBindAttribLocation"))
|
|
|
|
c.gpBindBuffer = C.uintptr_t(g.get("glBindBuffer"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpBindFramebuffer = C.uintptr_t(g.get("glBindFramebuffer"))
|
|
|
|
c.gpBindRenderbuffer = C.uintptr_t(g.get("glBindRenderbuffer"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpBindTexture = C.uintptr_t(g.get("glBindTexture"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpBindVertexArray = C.uintptr_t(g.get("glBindVertexArray"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpBlendEquationSeparate = C.uintptr_t(g.get("glBlendEquationSeparate"))
|
|
|
|
c.gpBlendFuncSeparate = C.uintptr_t(g.get("glBlendFuncSeparate"))
|
|
|
|
c.gpBufferData = C.uintptr_t(g.get("glBufferData"))
|
|
|
|
c.gpBufferSubData = C.uintptr_t(g.get("glBufferSubData"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpCheckFramebufferStatus = C.uintptr_t(g.get("glCheckFramebufferStatus"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpClear = C.uintptr_t(g.get("glClear"))
|
|
|
|
c.gpColorMask = C.uintptr_t(g.get("glColorMask"))
|
|
|
|
c.gpCompileShader = C.uintptr_t(g.get("glCompileShader"))
|
|
|
|
c.gpCreateProgram = C.uintptr_t(g.get("glCreateProgram"))
|
|
|
|
c.gpCreateShader = C.uintptr_t(g.get("glCreateShader"))
|
|
|
|
c.gpDeleteBuffers = C.uintptr_t(g.get("glDeleteBuffers"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpDeleteFramebuffers = C.uintptr_t(g.get("glDeleteFramebuffers"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpDeleteProgram = C.uintptr_t(g.get("glDeleteProgram"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpDeleteRenderbuffers = C.uintptr_t(g.get("glDeleteRenderbuffers"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpDeleteShader = C.uintptr_t(g.get("glDeleteShader"))
|
|
|
|
c.gpDeleteTextures = C.uintptr_t(g.get("glDeleteTextures"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpDeleteVertexArrays = C.uintptr_t(g.get("glDeleteVertexArrays"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpDisable = C.uintptr_t(g.get("glDisable"))
|
|
|
|
c.gpDisableVertexAttribArray = C.uintptr_t(g.get("glDisableVertexAttribArray"))
|
2024-04-09 02:26:29 +02:00
|
|
|
c.gpDrawBuffers = C.uintptr_t(g.get("glDrawBuffers"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpDrawElements = C.uintptr_t(g.get("glDrawElements"))
|
|
|
|
c.gpEnable = C.uintptr_t(g.get("glEnable"))
|
|
|
|
c.gpEnableVertexAttribArray = C.uintptr_t(g.get("glEnableVertexAttribArray"))
|
|
|
|
c.gpFlush = C.uintptr_t(g.get("glFlush"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpFramebufferRenderbuffer = C.uintptr_t(g.get("glFramebufferRenderbuffer"))
|
|
|
|
c.gpFramebufferTexture2D = C.uintptr_t(g.get("glFramebufferTexture2D"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpGenBuffers = C.uintptr_t(g.get("glGenBuffers"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpGenFramebuffers = C.uintptr_t(g.get("glGenFramebuffers"))
|
|
|
|
c.gpGenRenderbuffers = C.uintptr_t(g.get("glGenRenderbuffers"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpGenTextures = C.uintptr_t(g.get("glGenTextures"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpGenVertexArrays = C.uintptr_t(g.get("glGenVertexArrays"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpGetError = C.uintptr_t(g.get("glGetError"))
|
|
|
|
c.gpGetIntegerv = C.uintptr_t(g.get("glGetIntegerv"))
|
|
|
|
c.gpGetProgramInfoLog = C.uintptr_t(g.get("glGetProgramInfoLog"))
|
|
|
|
c.gpGetProgramiv = C.uintptr_t(g.get("glGetProgramiv"))
|
|
|
|
c.gpGetShaderInfoLog = C.uintptr_t(g.get("glGetShaderInfoLog"))
|
|
|
|
c.gpGetShaderiv = C.uintptr_t(g.get("glGetShaderiv"))
|
|
|
|
c.gpGetUniformLocation = C.uintptr_t(g.get("glGetUniformLocation"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpIsFramebuffer = C.uintptr_t(g.get("glIsFramebuffer"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpIsProgram = C.uintptr_t(g.get("glIsProgram"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpIsRenderbuffer = C.uintptr_t(g.get("glIsRenderbuffer"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpLinkProgram = C.uintptr_t(g.get("glLinkProgram"))
|
|
|
|
c.gpPixelStorei = C.uintptr_t(g.get("glPixelStorei"))
|
|
|
|
c.gpReadPixels = C.uintptr_t(g.get("glReadPixels"))
|
2023-04-19 15:56:53 +02:00
|
|
|
c.gpRenderbufferStorage = C.uintptr_t(g.get("glRenderbufferStorage"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpScissor = C.uintptr_t(g.get("glScissor"))
|
|
|
|
c.gpShaderSource = C.uintptr_t(g.get("glShaderSource"))
|
|
|
|
c.gpStencilFunc = C.uintptr_t(g.get("glStencilFunc"))
|
2023-11-06 01:18:08 +01:00
|
|
|
c.gpStencilOpSeparate = C.uintptr_t(g.get("glStencilOpSeparate"))
|
2023-04-22 09:37:56 +02:00
|
|
|
c.gpTexImage2D = C.uintptr_t(g.get("glTexImage2D"))
|
|
|
|
c.gpTexParameteri = C.uintptr_t(g.get("glTexParameteri"))
|
|
|
|
c.gpTexSubImage2D = C.uintptr_t(g.get("glTexSubImage2D"))
|
|
|
|
c.gpUniform1fv = C.uintptr_t(g.get("glUniform1fv"))
|
|
|
|
c.gpUniform1i = C.uintptr_t(g.get("glUniform1i"))
|
|
|
|
c.gpUniform1iv = C.uintptr_t(g.get("glUniform1iv"))
|
|
|
|
c.gpUniform2fv = C.uintptr_t(g.get("glUniform2fv"))
|
|
|
|
c.gpUniform2iv = C.uintptr_t(g.get("glUniform2iv"))
|
|
|
|
c.gpUniform3fv = C.uintptr_t(g.get("glUniform3fv"))
|
|
|
|
c.gpUniform3iv = C.uintptr_t(g.get("glUniform3iv"))
|
|
|
|
c.gpUniform4fv = C.uintptr_t(g.get("glUniform4fv"))
|
|
|
|
c.gpUniform4iv = C.uintptr_t(g.get("glUniform4iv"))
|
|
|
|
c.gpUniformMatrix2fv = C.uintptr_t(g.get("glUniformMatrix2fv"))
|
|
|
|
c.gpUniformMatrix3fv = C.uintptr_t(g.get("glUniformMatrix3fv"))
|
|
|
|
c.gpUniformMatrix4fv = C.uintptr_t(g.get("glUniformMatrix4fv"))
|
|
|
|
c.gpUseProgram = C.uintptr_t(g.get("glUseProgram"))
|
|
|
|
c.gpVertexAttribPointer = C.uintptr_t(g.get("glVertexAttribPointer"))
|
|
|
|
c.gpViewport = C.uintptr_t(g.get("glViewport"))
|
2023-04-22 08:09:24 +02:00
|
|
|
|
|
|
|
return g.error()
|
2018-12-08 18:35:13 +01:00
|
|
|
}
|