From c5f8474eb0e942a829d409c7fa75be4127f019c3 Mon Sep 17 00:00:00 2001 From: LHoG <1476261+lhog@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:07:50 +0400 Subject: [PATCH] Fix MSVC compilation of b60cb19622c95cac90b73415498b620c6a3a14d9 --- rts/Rendering/GL/glHelpers.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rts/Rendering/GL/glHelpers.h b/rts/Rendering/GL/glHelpers.h index 23a110116f..f6cf1d125b 100644 --- a/rts/Rendering/GL/glHelpers.h +++ b/rts/Rendering/GL/glHelpers.h @@ -13,9 +13,10 @@ template inline void glGetAny(GLenum paramName, GLType* data, const int expectedValuesN = -1) { - GLint ints[expectedValuesN]; + GLint ints[1024]; + assert(expectedValuesN > 0 && expectedValuesN < 1024); glGetIntegerv(paramName, ints); - std::move(ints, ints+expectedValuesN, data); + std::copy(ints, ints+expectedValuesN, data); } template<> inline void glGetAny(GLenum paramName, GLint* data, const int) @@ -84,7 +85,7 @@ inline void glSetAny(AttribValuesTupleType newValues) { if constexpr(DedicatedGLFuncPtrPtr) { - std::apply(*DedicatedGLFuncPtrPtr, newValues); + std::apply(DedicatedGLFuncPtrPtr, newValues); } else // glEnable/glDisable(attribute) {