divert(-1) # Copyright (C) Tomasz Kramkowski # SPDX-License # Macros # LOAD(glname, rtype, name, args) define(`LOAD', `divert(1)LGL_INTERFACE(shift($@)); divert(2)LGL_FUNC($3, $1); divert(3)LGL_LOAD($3); divert(-1)') m4wrap(`m4exit') # 1 - LGL_INTERFACE(rtype, name, args); define(`INTERFACES', `undivert(1)') # 2 - LGL_FUNC(name, glname); define(`FUNCS', `undivert(2)') # 3 - LGL_LOAD(name); define(`LOADS', `undivert(3)') # Functions LOAD(glViewport, void, gl_viewport, GLint x, GLint y, GLsizei width, GLsizei height) LOAD(glClearColor, void, gl_clearcolor, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) LOAD(glClear, void, gl_clear, GLbitfield mask) LOAD(glGenBuffers, void, gl_buf_gen, GLsizei n, GLuint *buffers) LOAD(glBindBuffer, void, gl_buf_bind, GLenum target, GLuint buffer) LOAD(glBufferData, void, gl_buf_data, GLenum target, GLsizeiptr size, const void *data, GLenum usage) LOAD(glCreateShader, GLuint, gl_shdr_create, GLenum type) LOAD(glDeleteShader, void, gl_shdr_del, GLuint shader) LOAD(glShaderSource, void, gl_shdr_source, GLuint shader, GLsizei count, const char * const *string, const GLint *length) LOAD(glCompileShader, void, gl_shdr_compile, GLuint shader) LOAD(glGetShaderiv, void, gl_shdr_param, GLuint shader, GLenum pname, GLint *params) LOAD(glGetShaderInfoLog, void, gl_shdr_infolog, GLuint shader, GLsizei size, GLsizei *len, char *data) LOAD(glCreateProgram, GLuint, gl_prog_create, void) LOAD(glDeleteProgram, void, gl_prog_del, GLuint program) LOAD(glAttachShader, void, gl_prog_attachshdr, GLuint program, GLuint shader) LOAD(glLinkProgram, void, gl_prog_link, GLuint program) LOAD(glUseProgram, void, gl_prog_use, GLuint program) LOAD(glGetProgramiv, void, gl_prog_param, GLuint prog, GLenum pname, GLint *params) LOAD(glGetProgramInfoLog, void, gl_prog_infolog, GLuint prog, GLsizei size, GLsizei *len, char *data) LOAD(glVertexAttribPointer, void, gl_va_define, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *data) LOAD(glEnableVertexAttribArray, void, gl_va_enable, GLuint index) LOAD(glDisableVertexAttribArray, void, gl_va_disable, GLuint index) LOAD(glGenVertexArrays, void, gl_va_gen, GLsizei n, GLuint *arrays) LOAD(glBindVertexArray, void, gl_va_bind, GLuint va) LOAD(glDrawArrays, void, gl_draw_arrays, GLenum mode, GLint first, GLsizei count) LOAD(glDrawElements, void, gl_draw_elems, GLenum mode, GLsizei count, GLenum type, const void *indices) LOAD(glPolygonMode, void, gl_poly_mode, GLenum face, GLenum mode) divert(0)dnl