From 17f0f7de3965e2fd4e42f5ce097414bd500a2975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 14 May 2013 16:53:57 +0200 Subject: [PATCH] De-inline TextureState constructor/destructor. It is heavier than it looks. Also fixed some includes in Implementation subdir. --- src/CMakeLists.txt | 1 + src/Implementation/FramebufferState.h | 1 + src/Implementation/ShaderProgramState.h | 2 +- src/Implementation/TextureState.cpp | 33 +++++++++++++++++++++++++ src/Implementation/TextureState.h | 5 ++-- 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/Implementation/TextureState.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47f3f3e32..36b95f3f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,6 +66,7 @@ set(Magnum_SRCS Implementation/BufferState.cpp Implementation/State.cpp + Implementation/TextureState.cpp Trade/AbstractImageConverter.cpp Trade/AbstractImporter.cpp diff --git a/src/Implementation/FramebufferState.h b/src/Implementation/FramebufferState.h index df7464cff..e9748c788 100644 --- a/src/Implementation/FramebufferState.h +++ b/src/Implementation/FramebufferState.h @@ -26,6 +26,7 @@ #include "Math/Geometry/Rectangle.h" #include "Magnum.h" +#include "OpenGL.h" namespace Magnum { namespace Implementation { diff --git a/src/Implementation/ShaderProgramState.h b/src/Implementation/ShaderProgramState.h index 5313d7d6c..3dc2e5513 100644 --- a/src/Implementation/ShaderProgramState.h +++ b/src/Implementation/ShaderProgramState.h @@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum.h" +#include "OpenGL.h" namespace Magnum { namespace Implementation { diff --git a/src/Implementation/TextureState.cpp b/src/Implementation/TextureState.cpp new file mode 100644 index 000000000..7524d218b --- /dev/null +++ b/src/Implementation/TextureState.cpp @@ -0,0 +1,33 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include "TextureState.h" + +namespace Magnum { namespace Implementation { + +TextureState::TextureState(): maxSupportedLayerCount(0), maxSupportedAnisotropy(0.0f), currentLayer(0) {} + +TextureState::~TextureState() = default; + +}} diff --git a/src/Implementation/TextureState.h b/src/Implementation/TextureState.h index 25d0d0500..2e53176c1 100644 --- a/src/Implementation/TextureState.h +++ b/src/Implementation/TextureState.h @@ -26,12 +26,13 @@ #include -#include "Magnum.h" +#include "OpenGL.h" namespace Magnum { namespace Implementation { struct TextureState { - inline TextureState(): maxSupportedLayerCount(0), maxSupportedAnisotropy(0.0f), currentLayer(0) {} + explicit TextureState(); + ~TextureState(); GLint maxSupportedLayerCount; GLfloat maxSupportedAnisotropy;