daily update on 20230911 by nitload youmu, uncertain bug of gl api loading
This commit is contained in:
@@ -5,34 +5,15 @@
|
||||
#include "GLenv/include/glad/glad.h"
|
||||
#include "GLenv/include/GLFW/glfw3.h"
|
||||
#include "framework.h"
|
||||
#include <stdio.h>
|
||||
#include "StgSharpGraphic.h"
|
||||
|
||||
|
||||
|
||||
extern glIOpackage pack;
|
||||
|
||||
SSGC_API glIOpackage loadGLApi(void)
|
||||
{
|
||||
|
||||
pack.createWindow = glfwCreateWindow;
|
||||
pack.makeContextCurrent = glfwMakeContextCurrent;
|
||||
pack.swapInterval = glfwSwapInterval;
|
||||
pack.clearColor = glClearColor;
|
||||
pack.windowShouldClose = glfwWindowShouldClose;
|
||||
pack.swapBuffer = glfwSwapBuffers;
|
||||
|
||||
//these are for callback
|
||||
pack.SetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
|
||||
|
||||
|
||||
return pack;
|
||||
}
|
||||
|
||||
SSGC_API void initGL(void)
|
||||
SSGC_API void initGL(int majorVersion, int minorVersion)
|
||||
{
|
||||
glfwInit();
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -45,4 +26,3 @@ SSGC_API int initGLAD(void)
|
||||
{
|
||||
return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user