get the OpenGL renderer going.

sorta.

(also make the blackmagic_II branch obsolete in the process)
This commit is contained in:
Arisotura
2020-05-25 18:25:50 +02:00
parent 10f9eda58a
commit 36f4cdbbbf
13 changed files with 1241 additions and 42 deletions

View File

@ -21,6 +21,8 @@
#include <stdio.h>
#include <string.h>
// TODO: different includes for each platform
#include <GL/gl.h>
#include <GL/glext.h>
@ -45,23 +47,11 @@
// if you need more OpenGL functions, add them to the macronator here
// TODO: handle conditionally loading certain functions for different GL versions
#ifndef __WIN32__
#define DO_PROCLIST_1_3(func)
#else
#define DO_PROCLIST_1_3(func) \
func(GLACTIVETEXTURE, glActiveTexture); \
func(GLBLENDCOLOR, glBlendColor); \
#endif
#define DO_PROCLIST(func) \
DO_PROCLIST_1_3(func) \
func(GLACTIVETEXTURE, glActiveTexture); \
func(GLBLENDCOLOR, glBlendColor); \
\
func(GLGENFRAMEBUFFERS, glGenFramebuffers); \
func(GLDELETEFRAMEBUFFERS, glDeleteFramebuffers); \
@ -122,14 +112,18 @@
func(GLGETSTRINGI, glGetStringi); \
namespace OpenGL
{
DO_PROCLIST(DECLPROC_EXT);
bool Init();
bool OpenGL_Init();
bool BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, const char* name);
bool LinkShaderProgram(GLuint* ids);
void DeleteShaderProgram(GLuint* ids);
void UseShaderProgram(GLuint* ids);
bool OpenGL_BuildShaderProgram(const char* vs, const char* fs, GLuint* ids, const char* name);
bool OpenGL_LinkShaderProgram(GLuint* ids);
void OpenGL_DeleteShaderProgram(GLuint* ids);
void OpenGL_UseShaderProgram(GLuint* ids);
}
#endif // OPENGLSUPPORT_H