#include "glad/glad.h" #include "StgSharpGraphic.h" glIOpackage pack; SSGAPI_OUT glIOpackage loadGLApi(void) { pack.createWindow = glfwCreateWindow; pack.makeContextCurrent = glfwMakeContextCurrent; pack.swapInterval = glfwSwapInterval; pack.clearColor = glClearColor; pack.getProcAddress = glfwGetProcAddress; return pack; } SSGAPI_OUT void initGL(void) { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); #ifdef __APPLE__ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); #endif // __APPLE__ } SSGAPI_OUT int initGLAD(void) { return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); }