From 1420669f3654f04afceb9d1c2693a3f2bab519d5 Mon Sep 17 00:00:00 2001 From: MiniTurtle Date: Mon, 10 Jun 2024 16:04:11 +0300 Subject: [PATCH] fix max vertex & index buffer. move to after initalization --- source/Irrlicht/CMakeLists.txt | 5 ++++- source/Irrlicht/COpenGLDriver.cpp | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 43ceac754..226cf203d 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -50,7 +50,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") endif() elseif(MSVC) - set(MSVCRT_LIB "$<$:msvcrtd.lib> $<$:msvcrt.lib>") + set(MSVCRT_LIB + "$<$:msvcrtd.lib>" + "$<$:msvcrt.lib>" + "$<$:msvcrt.lib>") # if(CMAKE_BUILD_TYPE STREQUAL "Debug") # message("HELLO WORLD") # string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " msvcrtd.lib") diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 76dcaf9eb..f2f0bf5a8 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -38,13 +38,6 @@ COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFil #ifdef _DEBUG setDebugName("COpenGLDriver"); #endif - - GLint maxVertexBufferSize; - glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &maxVertexBufferSize); - GLint maxIndexBufferSize; - glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &maxIndexBufferSize); - this->maxVertexBufferSize = maxVertexBufferSize; - this->maxIndexBufferSize = maxIndexBufferSize; } bool COpenGLDriver::initDriver() @@ -61,6 +54,13 @@ bool COpenGLDriver::initDriver() extGlSwapInterval(Params.Vsync ? 1 : 0); #endif + GLint maxVertexBufferSize; + glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &maxVertexBufferSize); + GLint maxIndexBufferSize; + glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &maxIndexBufferSize); + this->maxVertexBufferSize = maxVertexBufferSize; + this->maxIndexBufferSize = maxIndexBufferSize; + return true; }