Setup Manigraph for glad

This commit is contained in:
PedroEdiaz
2024-10-30 22:42:13 -06:00
parent 303f16d155
commit 88495c1068
9 changed files with 5178 additions and 7 deletions

View File

@@ -1,5 +1,10 @@
#include "main.h"
#ifdef GLAD
#include <glad.h>
#include <GLFW/glfw3.h>
#else
#include <GL/glew.h>
#endif
void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b)
{
@@ -8,6 +13,15 @@ void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b)
glClearColor((float)r / 0xff, (float)g / 0xff, (float)b / 0xff, 1.0);
}
int init_context(void) { return glewInit() == GLEW_OK; }
int init_context(void)
{
#ifdef GLAD
return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
#else
return glewInit() == GLEW_OK;
#endif
}
void clean_context(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); }