Closed drsnuggles8 closed 1 year ago
Ah yeah I had a look at those, it did not really help me. [#319] had some possible solution that I'll try. Is there a changelog showing which features got added in glad2? I might just stay with glad1, was just going through all my dependencies and checked if there are any new versions out.
Is there a changelog showing which features got added in glad2?
Ah this should be in the README!
Quick Summary:
Managed to get it working, I'll post my solution here just in case anyone else will look for it here.
FetchContent_Declare(glad
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
GIT_TAG v2.0.2
SOURCE_SUBDIR cmake)
FetchContent_MakeAvailable(glad)
glad_add_library(glad STATIC API gl:core=4.6 LOCATION ${PROJECT_SOURCE_DIR}/vendor/glad-build/${TARGET})
target_include_directories(OloEngine PRIVATE vendor/glad-build/include)
target_link_libraries(OloEngine glad)
Had to change some other code from #include <glad/glad.h>
to #include <glad/gl.h>
and change my old OpenGL initialization
const int status = ::gladLoadGLLoader(reinterpret_cast<GLADloadproc>(GLFWAPI::glfwGetProcAddress));
OLO_CORE_ASSERT(status, "Failed to initialize Glad!");
OLO_CORE_INFO("OpenGL Info:");
OLO_CORE_INFO(" Vendor: {0}", glGetString(GL_VENDOR));
OLO_CORE_INFO(" Renderer: {0}", glGetString(GL_RENDERER));
OLO_CORE_INFO(" Version: {0}", glGetString(GL_VERSION));
OLO_CORE_ASSERT(GLVersion.major > 4 || (GLVersion.major == 4 && GLVersion.minor >= 5), "OloEngine requires at least OpenGL version 4.5!");
to
const int version = ::gladLoadGL(reinterpret_cast<GLADloadfunc>(GLFWAPI::glfwGetProcAddress));
OLO_CORE_ASSERT(version, "Failed to initialize Glad!");
OLO_CORE_INFO("OpenGL Info:");
OLO_CORE_INFO(" Vendor: {0}", glGetString(GL_VENDOR));
OLO_CORE_INFO(" Renderer: {0}", glGetString(GL_RENDERER));
OLO_CORE_INFO(" Version: {0}", glGetString(GL_VERSION));
OLO_CORE_ASSERT(GLAD_VERSION_MAJOR(version) == 4 && GLAD_VERSION_MINOR(version) >= 5, "OloEngine requires at least OpenGL version 4.5!");
Hello, I'm trying to update from v0.1.36 to v2.0.2. Previously, I was adding glad to my project using FetchContent:
However, this does not seem to work for the new version v2.0.2. How would this be doable?