26 lines
505 B
C
26 lines
505 B
C
#include "main.h"
|
|
|
|
#ifdef EMSCRIPTEN
|
|
#include <GL/gl.h>
|
|
#else
|
|
#include <glad.h>
|
|
#include <GLFW/glfw3.h>
|
|
#endif
|
|
|
|
void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b)
|
|
{
|
|
glEnable(GL_DEPTH_TEST);
|
|
glClearColor((float)r / 0xff, (float)g / 0xff, (float)b / 0xff, 1.0);
|
|
}
|
|
|
|
int init_context(void)
|
|
{
|
|
#ifdef EMSCRIPTEN
|
|
return 1;
|
|
#else
|
|
return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
|
|
#endif
|
|
}
|
|
|
|
void clean_context(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); }
|