From 7a6195991cc3924de590e1c14ecefb97308fcbcb Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 13 Jul 2014 09:29:12 +0200 Subject: [PATCH] Added Quaternion component type Not compatible with Vertex Declaration though Former-commit-id: 3174553981ab23fe59ed616c2ce1a27bf7db0108 --- include/Nazara/Utility/Enums.hpp | 3 ++- src/Nazara/Renderer/OpenGL.cpp | 5 +++-- src/Nazara/Renderer/Renderer.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/Nazara/Utility/Enums.hpp b/include/Nazara/Utility/Enums.hpp index 20a91f22d..52bc9cba6 100644 --- a/include/Nazara/Utility/Enums.hpp +++ b/include/Nazara/Utility/Enums.hpp @@ -65,8 +65,9 @@ enum nzComponentType nzComponentType_Int2, nzComponentType_Int3, nzComponentType_Int4, + nzComponentType_Quaternion, - nzComponentType_Max = nzComponentType_Int4 + nzComponentType_Max = nzComponentType_Quaternion }; enum nzCubemapFace diff --git a/src/Nazara/Renderer/OpenGL.cpp b/src/Nazara/Renderer/OpenGL.cpp index 7441b916b..3d57503a6 100644 --- a/src/Nazara/Renderer/OpenGL.cpp +++ b/src/Nazara/Renderer/OpenGL.cpp @@ -1931,10 +1931,11 @@ GLenum NzOpenGL::ComponentType[] = GL_INT, // nzComponentType_Int1 GL_INT, // nzComponentType_Int2 GL_INT, // nzComponentType_Int3 - GL_INT // nzComponentType_Int4 + GL_INT, // nzComponentType_Int4 + GL_FLOAT // nzComponentType_Quaternion }; -static_assert(nzComponentType_Max+1 == 13, "Attribute type array is incomplete"); +static_assert(nzComponentType_Max+1 == 14, "Attribute type array is incomplete"); GLenum NzOpenGL::CubemapFace[] = { diff --git a/src/Nazara/Renderer/Renderer.cpp b/src/Nazara/Renderer/Renderer.cpp index af9535f83..0fc62e782 100644 --- a/src/Nazara/Renderer/Renderer.cpp +++ b/src/Nazara/Renderer/Renderer.cpp @@ -919,6 +919,9 @@ bool NzRenderer::IsComponentTypeSupported(nzComponentType type) case nzComponentType_Int3: case nzComponentType_Int4: return glVertexAttribIPointer != nullptr; // Fonction requise pour envoyer des entiers + + case nzComponentType_Quaternion: + return false; } NazaraError("Attribute type out of enum (0x" + NzString::Number(type, 16) + ')'); @@ -1851,6 +1854,11 @@ bool NzRenderer::EnsureStateUpdate() break; } + default: + { + NazaraInternalError("Unsupported component type"); + break; + } } // Les attributs d'instancing ont un diviseur spécifique (pour dépendre de l'instance en cours) if (i == 1)