Port to web for free
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
#include "main.h"
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#ifdef GLAD
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glad.h>
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
@@ -15,12 +20,16 @@ void set_clean_color_context(unsigned char r, unsigned char g, unsigned char b)
|
||||
|
||||
int init_context(void)
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
return 1;
|
||||
#else
|
||||
#ifdef GLAD
|
||||
|
||||
return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
|
||||
#else
|
||||
return glewInit();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void clean_context(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); }
|
||||
|
||||
Reference in New Issue
Block a user