daily update on 20230623 by nitload youmu, SSG lib rewrite
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user