project_files/hwc/rtl/GL.h
author sheepluva
Mon, 05 Aug 2019 00:20:45 +0200
changeset 15295 f382ec6dba11
parent 11793 80fe306460b2
permissions -rw-r--r--
In hindsight my emscripten-ifdef (70d416a8f63f) is nonsense. As fpcrtl_glShaderSource() would not be defined and lead to compiling issues. So either it's 3 ifdefs (in pas2cRedo, pas2cSystem and misc.c), in order to toggle between fpcrtl_ and the native function, or alternatively have no ifdef for it at all. I'm going with none at all, which means emscripten will compile with the original (const) function prototype, being wrapped by the fpcrtl_ function, same as non-emscripten builds.

#pragma once

#if defined(__APPLE__) && !defined(EMSCRIPTEN)
#include <OpenGL/gl.h>
#else
#include "GL/gl.h"
#endif

/* emscripten cannot find these functions */
#ifdef EMSCRIPTEN
void glGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog);
void glLinkProgram(GLuint program);
void glUniform1i(GLint location, GLint v0);
GLuint glCreateProgram(void);
void glUseProgram(GLuint program);
void glDeleteProgram(GLuint program);
void glGetProgramiv(GLuint program, GLenum pname, GLint *params);
void glDeleteShader(GLuint shader);
void glBindAttribLocation(GLuint program, GLuint index, const GLchar *name);
void glAttachShader(GLuint program, GLuint shader);
void glBindBuffer(GLenum target, GLuint buffer);
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void glEnableVertexAttribArray(GLuint index);
void glDisableVertexAttribArray(GLuint index);
void glGenBuffers(GLsizei n, GLuint * buffers);
void glDeleteBuffers(GLsizei n, const GLuint * buffers);
void glUniform4fv(GLint location, GLsizei count, const GLfloat *value);
void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer);
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
void glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
GLint glGetUniformLocation(GLuint program, const GLchar *name);
void glGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog);
void glGetShaderiv(GLuint shader, GLenum pname, GLint *params);
GLuint glCreateShader(GLenum shaderType);
void glCompileShader(GLuint shader);
//void glShaderSource(GLuint shader, GLsizei count,/* const dropped for pas2c compat */ GLchar **string, const GLint *length);
void glShaderSource(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
#endif