Skip to content

Commit

Permalink
fix max vertex & index buffer. move to after initalization
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniTurtle committed Jun 10, 2024
1 parent 68352b4 commit 1420669
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
endif()

elseif(MSVC)
set(MSVCRT_LIB "$<$<CONFIG:DEBUG>:msvcrtd.lib> $<$<CONFIG:RELEASE>:msvcrt.lib>")
set(MSVCRT_LIB
"$<$<CONFIG:DEBUG>:msvcrtd.lib>"
"$<$<CONFIG:RELEASE>:msvcrt.lib>"
"$<$<CONFIG:RELWITHDEBINFO>:msvcrt.lib>")
# if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# message("HELLO WORLD")
# string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " msvcrtd.lib")
Expand Down
14 changes: 7 additions & 7 deletions source/Irrlicht/COpenGLDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
}

Expand Down

0 comments on commit 1420669

Please sign in to comment.