From 7dd8e077267cee955415ba02b14485969ea9565f Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 12:26:25 -0400 Subject: [PATCH 01/17] add glad support --- cmake/Config.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index c210a767..4a0b2477 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -173,10 +173,16 @@ if(RENDER_OPENGL_CORE) set(GWK_PLATFORM_NAME "Cross") find_package(glm REQUIRED) - find_package(GLEW REQUIRED) - set(GWK_RENDER_INCLUDES "${GLM_INCLUDE_DIR}" "${GLEW_INCLUDE_DIR}") - set(GWK_RENDER_LIBRARIES ${GLM_LIBRARIES} ${GLEW_LIBRARIES}) + if(USE_GLEW) + find_package(GLEW REQUIRED) + set(GWK_RENDER_INCLUDES "${GLM_INCLUDE_DIR}" "${GLEW_INCLUDE_DIR}") + set(GWK_RENDER_LIBRARIES ${GLM_LIBRARIES} ${GLEW_LIBRARIES}) + elseif(USE_GLAD) + find_package(glad CONFIG REQUIRED) + set(GWK_RENDER_LIBRARIES ${GLM_LIBRARIES} glad::glad) + endif() + if(USE_GLFW) find_package(GLFW REQUIRED) From 98423d650900e73d993dbe22aa728e449e8171c8 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 12:43:24 -0400 Subject: [PATCH 02/17] add vcpkg flag for GLFW --- cmake/Config.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 4a0b2477..fdaa4e8a 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -186,6 +186,9 @@ if(RENDER_OPENGL_CORE) if(USE_GLFW) find_package(GLFW REQUIRED) + if(USE_VCPKG) + set(GLFW_LIBRARIES glfw) + endif() if (APPLE) set(GLFW_DEPENDENCIES "-framework OpenGL") elseif(UNIX) From 2a789733c4adef9810ddd177117217635df3ac78 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 12:45:08 -0400 Subject: [PATCH 03/17] add vcpkg flag for glfw --- cmake/Config.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index fdaa4e8a..2822a10c 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -185,8 +185,9 @@ if(RENDER_OPENGL_CORE) if(USE_GLFW) - find_package(GLFW REQUIRED) - if(USE_VCPKG) + if(NOT USE_VCPKG) + find_package(GLFW REQUIRED) + else() set(GLFW_LIBRARIES glfw) endif() if (APPLE) From be989e5be0b09f100adf651a2b7e99e059d5560a Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 12:56:43 -0400 Subject: [PATCH 04/17] add glad support with a vcpkg flag --- cmake/Config.cmake | 6 ++++++ source/platform/CMakeLists.txt | 5 +++++ source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 2822a10c..9690925d 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -174,6 +174,8 @@ if(RENDER_OPENGL_CORE) find_package(glm REQUIRED) + # MODIFIED: add glad support with a macro flag to enable in the OPENGL_CORE renderer. + if(USE_GLEW) find_package(GLEW REQUIRED) set(GWK_RENDER_INCLUDES "${GLM_INCLUDE_DIR}" "${GLEW_INCLUDE_DIR}") @@ -181,10 +183,14 @@ if(RENDER_OPENGL_CORE) elseif(USE_GLAD) find_package(glad CONFIG REQUIRED) set(GWK_RENDER_LIBRARIES ${GLM_LIBRARIES} glad::glad) + set(GWK_GL_API "GLAD") endif() if(USE_GLFW) + + # MODIFIED: add vcpkg flag for glfw + if(NOT USE_VCPKG) find_package(GLFW REQUIRED) else() diff --git a/source/platform/CMakeLists.txt b/source/platform/CMakeLists.txt index 14f00318..0b3b5784 100644 --- a/source/platform/CMakeLists.txt +++ b/source/platform/CMakeLists.txt @@ -44,6 +44,11 @@ source_group("${GWK_SOURCE_FOLDER}" add_definitions(${GWK_LIB_DEFINES}) +# MODIFIED: add definition flag for glad support +if(GWK_GL_API) +add_definitions("-DGWK_GL_GLAD=1") +endif() + # Gwork renderer & platform library add_library(Gwork${GWK_RENDER_NAME} STATIC ${GWK_PLATFORM_HEADERS} ${GWK_RENDERER_HEADERS} ${GWK_INPUT_HEADERS} diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index a3196d16..19f0be6f 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -6,10 +6,18 @@ #include #if defined(__APPLE__) +#if defined(GWK_GL_GLAD) +# include +#endif # include #else +#if defined(GWK_GL_GLAD) +# include +#endif # include #endif #include From c8a7f87fe36d5cd2b064f0181f80dc24775eaf69 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 12:59:40 -0400 Subject: [PATCH 05/17] fix typo --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index 19f0be6f..a11c1ae1 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -7,14 +7,14 @@ #include #if defined(__APPLE__) #if defined(GWK_GL_GLAD) -# include #else # include #endif # include #else #if defined(GWK_GL_GLAD) -# include #else # include #endif From 85448bb2a1c2156c294c6278e9547fd4dbe37e65 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 13:04:24 -0400 Subject: [PATCH 06/17] fixed typo --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index a11c1ae1..97ee4c7c 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -7,14 +7,14 @@ #include #if defined(__APPLE__) #if defined(GWK_GL_GLAD) -# include +# include #else # include #endif # include #else #if defined(GWK_GL_GLAD) -# include +# include #else # include #endif From 1a3a8e056ad09547ce50097d80d2c1c85ecc2157 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 15:46:48 -0400 Subject: [PATCH 07/17] test and util folders use GWK_SOURCE_DIR instead of CMAKE_SOURCE_DIR --- source/test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/test/CMakeLists.txt b/source/test/CMakeLists.txt index 75826129..3b3c0982 100644 --- a/source/test/CMakeLists.txt +++ b/source/test/CMakeLists.txt @@ -4,8 +4,8 @@ include_directories( ${GWK_SOURCE_DIR}/source/platform/include ${GWK_SOURCE_DIR}/source/gwork/include ${GWK_RENDER_INCLUDES} - ${CMAKE_SOURCE_DIR}/source/util/include - ${CMAKE_SOURCE_DIR}/source/test/include + ${GWK_SOURCE_DIR}/source/util/include + ${GWK_SOURCE_DIR}/source/test/include ${GWK_REFLECT_INCLUDE} ) From 0c1be63012fd8e58d5b6c7b9a91e881a213ab387 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 15:50:57 -0400 Subject: [PATCH 08/17] OpenGLCore sample uses the GLAD flag --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 2 ++ source/samples/OpenGLCore/OpenGLCoreSample.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index 97ee4c7c..18a073f8 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -4,6 +4,8 @@ * See license in Gwork.h */ +// MODIFIED: uses glad flag. + #include #if defined(__APPLE__) #if defined(GWK_GL_GLAD) diff --git a/source/samples/OpenGLCore/OpenGLCoreSample.cpp b/source/samples/OpenGLCore/OpenGLCoreSample.cpp index 1e65d1ad..a67b0d24 100644 --- a/source/samples/OpenGLCore/OpenGLCoreSample.cpp +++ b/source/samples/OpenGLCore/OpenGLCoreSample.cpp @@ -3,8 +3,14 @@ * Copyright (c) 2013-2018 Billy Quith * See license in Gwork.h */ + + // MODIFIED: uses glad flag. -#include +#if defined(GWK_GL_GLAD) +# include +#else +# include +#endif #ifdef USE_DEBUG_FONT # include #else From 951b81f83f75d53eb4efafdb1dee97b1ad512d50 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 16:18:47 -0400 Subject: [PATCH 09/17] bump cmake min version and add glad flag to samples --- CMakeLists.txt | 2 +- source/samples/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d614dcae..9da1c856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # CMake build instructions for Gwork # configure cmake -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) # MODIFIED: cmake 3.5 and below is deprecated. # we require C++11 - this set appropriate flags for compilers, which may not be portable set(CMAKE_CXX_STANDARD 14) diff --git a/source/samples/CMakeLists.txt b/source/samples/CMakeLists.txt index 47edb63a..ffccd27c 100644 --- a/source/samples/CMakeLists.txt +++ b/source/samples/CMakeLists.txt @@ -38,6 +38,11 @@ if(WITH_SAMPLE) add_definitions(-DGWK_SAMPLE -DGWK_SAMPLE_RESOURCE_DIR="${APP_RUNTIME_RESOURCE_DIR}") + # MODIFIED: add definition flag for glad support + if(GWK_GL_API) + add_definitions("-DGWK_GL_GLAD=1") + endif() + add_executable(${SAMPLE_NAME} ${APP_BUILD_TYPE} ${SAMPLE_SOURCES} ${SAMPLE_RESOURCES}) target_link_libraries(${SAMPLE_NAME} From 3a14490689fb8c55ac418cbb11d59d232b16ec06 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 16:24:22 -0400 Subject: [PATCH 10/17] use glad flag to adapt gl initilization --- source/samples/OpenGLCore/OpenGLCoreSample.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/samples/OpenGLCore/OpenGLCoreSample.cpp b/source/samples/OpenGLCore/OpenGLCoreSample.cpp index a67b0d24..d7ec477d 100644 --- a/source/samples/OpenGLCore/OpenGLCoreSample.cpp +++ b/source/samples/OpenGLCore/OpenGLCoreSample.cpp @@ -69,6 +69,15 @@ int main() } glfwMakeContextCurrent(window); + + #if defined(GWK_GL_GLAD) + if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) + { + std::cout << "Glad init error." << std::endl; + glfwTerminate(); + return EXIT_FAILURE; + } + #else glewExperimental = GL_TRUE; GLuint error; if ((error = glewInit()) != GLEW_OK) @@ -77,6 +86,7 @@ int main() glfwTerminate(); return EXIT_FAILURE; } + #endif Gwk::Platform::RelativeToExecutablePaths paths(GWK_SAMPLE_RESOURCE_DIR); From d54bf026394c21b6353b812b865235e3590c61b4 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 16:31:42 -0400 Subject: [PATCH 11/17] fixed typos --- source/samples/OpenGLCore/OpenGLCoreSample.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/samples/OpenGLCore/OpenGLCoreSample.cpp b/source/samples/OpenGLCore/OpenGLCoreSample.cpp index d7ec477d..3bef9599 100644 --- a/source/samples/OpenGLCore/OpenGLCoreSample.cpp +++ b/source/samples/OpenGLCore/OpenGLCoreSample.cpp @@ -69,6 +69,8 @@ int main() } glfwMakeContextCurrent(window); + + // MODIFIED: use glad flag to initialize opengl. #if defined(GWK_GL_GLAD) if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) @@ -111,7 +113,8 @@ int main() canvas->SetBackgroundColor(Gwk::Color(150, 170, 170, 255)); // Create our unittest control (which is a Window with controls in it) - auto unit = new TestFrame(canvas); + // MODIFIED: I think this errored because of my compiler settings. + auto unit = new Gwk::Test::TestFrame(canvas); GworkInput.Initialize(canvas); glfwSetKeyCallback(window, key_callback); From 1628fe020d4e91bb963633f7ff11094e887bb087 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Sat, 14 Oct 2023 23:02:07 -0400 Subject: [PATCH 12/17] tidy up --- CMakeLists.txt | 2 +- cmake/Config.cmake | 6 +----- source/platform/CMakeLists.txt | 3 +-- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 2 -- source/samples/CMakeLists.txt | 3 +-- source/samples/OpenGLCore/OpenGLCoreSample.cpp | 5 ----- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9da1c856..e9c00464 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # CMake build instructions for Gwork # configure cmake -cmake_minimum_required(VERSION 3.15) # MODIFIED: cmake 3.5 and below is deprecated. +cmake_minimum_required(VERSION 3.15) # we require C++11 - this set appropriate flags for compilers, which may not be portable set(CMAKE_CXX_STANDARD 14) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 9690925d..b1b9c074 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -174,8 +174,6 @@ if(RENDER_OPENGL_CORE) find_package(glm REQUIRED) - # MODIFIED: add glad support with a macro flag to enable in the OPENGL_CORE renderer. - if(USE_GLEW) find_package(GLEW REQUIRED) set(GWK_RENDER_INCLUDES "${GLM_INCLUDE_DIR}" "${GLEW_INCLUDE_DIR}") @@ -183,14 +181,12 @@ if(RENDER_OPENGL_CORE) elseif(USE_GLAD) find_package(glad CONFIG REQUIRED) set(GWK_RENDER_LIBRARIES ${GLM_LIBRARIES} glad::glad) - set(GWK_GL_API "GLAD") + set(GWK_GLAD_API "GLAD") endif() if(USE_GLFW) - # MODIFIED: add vcpkg flag for glfw - if(NOT USE_VCPKG) find_package(GLFW REQUIRED) else() diff --git a/source/platform/CMakeLists.txt b/source/platform/CMakeLists.txt index 0b3b5784..36a64c79 100644 --- a/source/platform/CMakeLists.txt +++ b/source/platform/CMakeLists.txt @@ -44,8 +44,7 @@ source_group("${GWK_SOURCE_FOLDER}" add_definitions(${GWK_LIB_DEFINES}) -# MODIFIED: add definition flag for glad support -if(GWK_GL_API) +if(GWK_GLAD_API) add_definitions("-DGWK_GL_GLAD=1") endif() diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index 18a073f8..97ee4c7c 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -4,8 +4,6 @@ * See license in Gwork.h */ -// MODIFIED: uses glad flag. - #include #if defined(__APPLE__) #if defined(GWK_GL_GLAD) diff --git a/source/samples/CMakeLists.txt b/source/samples/CMakeLists.txt index ffccd27c..6a78dad0 100644 --- a/source/samples/CMakeLists.txt +++ b/source/samples/CMakeLists.txt @@ -38,8 +38,7 @@ if(WITH_SAMPLE) add_definitions(-DGWK_SAMPLE -DGWK_SAMPLE_RESOURCE_DIR="${APP_RUNTIME_RESOURCE_DIR}") - # MODIFIED: add definition flag for glad support - if(GWK_GL_API) + if(GWK_GLAD_API) add_definitions("-DGWK_GL_GLAD=1") endif() diff --git a/source/samples/OpenGLCore/OpenGLCoreSample.cpp b/source/samples/OpenGLCore/OpenGLCoreSample.cpp index 3bef9599..23dc8dc6 100644 --- a/source/samples/OpenGLCore/OpenGLCoreSample.cpp +++ b/source/samples/OpenGLCore/OpenGLCoreSample.cpp @@ -4,8 +4,6 @@ * See license in Gwork.h */ - // MODIFIED: uses glad flag. - #if defined(GWK_GL_GLAD) # include #else @@ -70,8 +68,6 @@ int main() glfwMakeContextCurrent(window); - // MODIFIED: use glad flag to initialize opengl. - #if defined(GWK_GL_GLAD) if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { @@ -113,7 +109,6 @@ int main() canvas->SetBackgroundColor(Gwk::Color(150, 170, 170, 255)); // Create our unittest control (which is a Window with controls in it) - // MODIFIED: I think this errored because of my compiler settings. auto unit = new Gwk::Test::TestFrame(canvas); GworkInput.Initialize(canvas); From e3a5cd6f2e8318156cdeb996f7fdcd102ce0bf01 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Mon, 16 Oct 2023 20:28:22 -0400 Subject: [PATCH 13/17] refine checks for 64-bit Windows and mingw --- cmake/Config.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index b1b9c074..6d8528e4 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -66,7 +66,9 @@ if(WIN32 AND NOT UNIX) set(INSTALL_MISC_DIR .) # Determine the target architecture, which is useful for linking. - if (CMAKE_GENERATOR MATCHES "Win64") + cmake_host_system_information(RESULT host_is_64 QUERY IS_64BIT) + + if (host_is_64) set(GWK_TARGET_ARCH "x64") else() set(GWK_TARGET_ARCH "x86") @@ -275,7 +277,7 @@ endif() #----------------------------------------------------------- # MinGW problems -if (WIN32) +if (CMAKE_CXX_COMPILER_ID MATCHES MINGW) set(GWK_RENDER_LIBRARIES ${GWK_RENDER_LIBRARIES} -liconv) endif() From 365509c0cc7dac780fa1600d95d1177db7874573 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Thu, 19 Oct 2023 17:54:35 -0400 Subject: [PATCH 14/17] additional vcpkg support --- cmake/Config.cmake | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 6d8528e4..8bfceee6 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -174,7 +174,12 @@ if(RENDER_OPENGL_CORE) set(GWK_INPUT_NAME "GLFW3") set(GWK_PLATFORM_NAME "Cross") - find_package(glm REQUIRED) + if(USE_VCPKG) + find_package(glm CONFIG REQUIRED) + set(GLM_INCLUDE_DIR ${glm_DIR}) + else() + find_package(glm REQUIRED) + endif() if(USE_GLEW) find_package(GLEW REQUIRED) @@ -189,11 +194,17 @@ if(RENDER_OPENGL_CORE) if(USE_GLFW) - if(NOT USE_VCPKG) + if(USE_VCPKG) + find_package(glfw3 CONFIG REQUIRED) + elseif() find_package(GLFW REQUIRED) - else() + endif() + + if(USE_VCPKG) set(GLFW_LIBRARIES glfw) + set(GLFW_INCLUDE_DIR ${glfw3_DIR}) endif() + if (APPLE) set(GLFW_DEPENDENCIES "-framework OpenGL") elseif(UNIX) From 9a359403d98042c5460139fd1e93afc6d36c6a05 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Thu, 19 Oct 2023 17:55:37 -0400 Subject: [PATCH 15/17] use glGen* functions instead of glCreate* --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index 97ee4c7c..6d18b127 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -294,8 +294,8 @@ void OpenGLCore::Init() ); // Creating buffers - glCreateVertexArrays(1, &m_vao); - glCreateBuffers(1, &m_vbo); + glGenVertexArrays(1, &m_vao); + glGenBuffers(1, &m_vbo); // Loading shaders From 1d68cab6b75bb99aba24b874969b5f142304bb4c Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Thu, 19 Oct 2023 17:58:52 -0400 Subject: [PATCH 16/17] use the mored widely supported glBufferData --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index 6d18b127..a0c568c9 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -373,7 +373,7 @@ void OpenGLCore::Flush() glBindBuffer(GL_ARRAY_BUFFER, m_vbo); // Loading data into VBO - glNamedBufferData( + glBufferData( m_vbo, m_vertices.size() * sizeof(Vertex), m_vertices.data(), From dff1f4002d5987249403dc894fc01da1ecaec6b3 Mon Sep 17 00:00:00 2001 From: Samuel Bridgham Date: Thu, 19 Oct 2023 18:02:56 -0400 Subject: [PATCH 17/17] update OpenGLCoreSample to OpenGL version 4.5 --- source/platform/renderers/OpenGLCore/OpenGLCore.cpp | 6 +++--- source/samples/OpenGLCore/OpenGLCoreSample.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp index a0c568c9..97ee4c7c 100644 --- a/source/platform/renderers/OpenGLCore/OpenGLCore.cpp +++ b/source/platform/renderers/OpenGLCore/OpenGLCore.cpp @@ -294,8 +294,8 @@ void OpenGLCore::Init() ); // Creating buffers - glGenVertexArrays(1, &m_vao); - glGenBuffers(1, &m_vbo); + glCreateVertexArrays(1, &m_vao); + glCreateBuffers(1, &m_vbo); // Loading shaders @@ -373,7 +373,7 @@ void OpenGLCore::Flush() glBindBuffer(GL_ARRAY_BUFFER, m_vbo); // Loading data into VBO - glBufferData( + glNamedBufferData( m_vbo, m_vertices.size() * sizeof(Vertex), m_vertices.data(), diff --git a/source/samples/OpenGLCore/OpenGLCoreSample.cpp b/source/samples/OpenGLCore/OpenGLCoreSample.cpp index 23dc8dc6..1030dbcc 100644 --- a/source/samples/OpenGLCore/OpenGLCoreSample.cpp +++ b/source/samples/OpenGLCore/OpenGLCoreSample.cpp @@ -53,7 +53,7 @@ int main() return EXIT_FAILURE; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);