From 83b3fe86b1c13f40a6be4580b4079980030a54a7 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 30 Mar 2018 15:35:05 +0100 Subject: Simplify gl loading by removing m4 and merging gldefs.h m4 has been removed, loadgl.c.in is now gl.c, gldefs.h and loadgl.h.in have now been merged into gl.h. loadgl.m4 has been transformed into glfunc.h which is being used in the way of a bie index file to generate information at 3 places. lgl_load is now gl_load and doesn't return anything, the jongjmp.h method of error handling was pre-emptive and for now this much simpler system will suffice. This means that lgl_strerror is no longer neede. --- glfunc.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 glfunc.h (limited to 'glfunc.h') diff --git a/glfunc.h b/glfunc.h new file mode 100644 index 0000000..22a0021 --- /dev/null +++ b/glfunc.h @@ -0,0 +1,44 @@ +// Copyright (C) Tomasz Kramkowski +// SPDX-License-Identifier: MIT + +GL_FUNC(glGetError, GLenum, gl_error, void) +GL_FUNC(glViewport, void, gl_viewport, GLint x, GLint y, GLsizei width, GLsizei height) +GL_FUNC(glClearColor, void, gl_clearcolor, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +GL_FUNC(glClear, void, gl_clear, GLbitfield mask) +GL_FUNC(glGenBuffers, void, gl_buf_gen, GLsizei n, GLuint *buffers) +GL_FUNC(glBindBuffer, void, gl_buf_bind, GLenum target, GLuint buffer) +GL_FUNC(glBufferData, void, gl_buf_data, GLenum target, GLsizeiptr size, const void *data, GLenum usage) +GL_FUNC(glCreateShader, GLuint, gl_shdr_create, GLenum type) +GL_FUNC(glDeleteShader, void, gl_shdr_del, GLuint shader) +GL_FUNC(glShaderSource, void, gl_shdr_source, GLuint shader, GLsizei count, const char * const *string, const GLint *length) +GL_FUNC(glCompileShader, void, gl_shdr_compile, GLuint shader) +GL_FUNC(glGetShaderiv, void, gl_shdr_param, GLuint shader, GLenum pname, GLint *params) +GL_FUNC(glGetShaderInfoLog, void, gl_shdr_infolog, GLuint shader, GLsizei size, GLsizei *len, char *data) +GL_FUNC(glCreateProgram, GLuint, gl_prog_create, void) +GL_FUNC(glDeleteProgram, void, gl_prog_del, GLuint program) +GL_FUNC(glAttachShader, void, gl_prog_attachshdr, GLuint program, GLuint shader) +GL_FUNC(glDetachShader, void, gl_prog_detachshdr, GLuint program, GLuint shader) +GL_FUNC(glGetAttachedShaders, void, gl_prog_getshdrs, GLuint program, GLsizei max, GLsizei *count, GLuint *shaders) +GL_FUNC(glLinkProgram, void, gl_prog_link, GLuint program) +GL_FUNC(glUseProgram, void, gl_prog_use, GLuint program) +GL_FUNC(glGetProgramiv, void, gl_prog_param, GLuint prog, GLenum pname, GLint *params) +GL_FUNC(glGetProgramInfoLog, void, gl_prog_infolog, GLuint prog, GLsizei size, GLsizei *len, char *data) +GL_FUNC(glVertexAttribPointer, void, gl_va_define, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *data) +GL_FUNC(glEnableVertexAttribArray, void, gl_va_enable, GLuint index) +GL_FUNC(glDisableVertexAttribArray, void, gl_va_disable, GLuint index) +GL_FUNC(glGenVertexArrays, void, gl_va_gen, GLsizei n, GLuint *arrays) +GL_FUNC(glBindVertexArray, void, gl_va_bind, GLuint va) +GL_FUNC(glDrawArrays, void, gl_draw_arrays, GLenum mode, GLint first, GLsizei count) +GL_FUNC(glDrawElements, void, gl_draw_elems, GLenum mode, GLsizei count, GLenum type, const void *indices) +GL_FUNC(glPolygonMode, void, gl_poly_mode, GLenum face, GLenum mode) +GL_FUNC(glGetUniformLocation, GLint, gl_uni_loc, GLuint program, const char *name); +GL_FUNC(glGetUniformfv, void, gl_uni_getf, GLuint program, GLint location, GLfloat *params); +GL_FUNC(glGetUniformiv, void, gl_uni_geti, GLuint program, GLint location, GLint *params); +GL_FUNC(glUniform1i, void, gl_uni_set1i, GLint location, GLint v0) +GL_FUNC(glUniform1f, void, gl_uni_set1f, GLint location, GLfloat v0) +GL_FUNC(glUniform3f, void, gl_uni_set3f, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) +GL_FUNC(glUniform4f, void, gl_uni_set4f, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) +GL_FUNC(glUniform3fv, void, gl_uni_set3fv, GLint location, GLsizei count, const GLfloat *value) +GL_FUNC(glUniform4fv, void, gl_uni_set4fv, GLint location, GLsizei count, const GLfloat *value) +GL_FUNC(glUniformMatrix3fv, void, gl_uni_setm3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +GL_FUNC(glUniformMatrix4fv, void, gl_uni_setm4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) -- cgit v1.2.3-54-g00ecf