diff --git a/CMakeLists.txt b/CMakeLists.txt index faa0596..6dd6e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,12 +40,12 @@ SET(obs-stream-effects_HEADERS "${PROJECT_SOURCE_DIR}/source/gs-helper.h" "${PROJECT_SOURCE_DIR}/source/gs-effect.h" "${PROJECT_SOURCE_DIR}/source/gs-indexbuffer.h" - "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.h" + "${PROJECT_SOURCE_DIR}/source/gs-limits.h" +# "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.h" "${PROJECT_SOURCE_DIR}/source/gs-rendertarget.h" "${PROJECT_SOURCE_DIR}/source/gs-texture.h" "${PROJECT_SOURCE_DIR}/source/gs-vertex.h" "${PROJECT_SOURCE_DIR}/source/gs-vertexbuffer.h" - "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.h" "${PROJECT_BINARY_DIR}/source/version.h" "${PROJECT_SOURCE_DIR}/source/strings.h" "${PROJECT_SOURCE_DIR}/source/util-math.h" @@ -61,12 +61,11 @@ SET(obs-stream-effects_SOURCES "${PROJECT_SOURCE_DIR}/source/gs-helper.cpp" "${PROJECT_SOURCE_DIR}/source/gs-effect.cpp" "${PROJECT_SOURCE_DIR}/source/gs-indexbuffer.cpp" - "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.cpp" +# "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.cpp" "${PROJECT_SOURCE_DIR}/source/gs-rendertarget.cpp" "${PROJECT_SOURCE_DIR}/source/gs-texture.cpp" "${PROJECT_SOURCE_DIR}/source/gs-vertex.cpp" "${PROJECT_SOURCE_DIR}/source/gs-vertexbuffer.cpp" - "${PROJECT_SOURCE_DIR}/source/gs-mipmapper.cpp" "${PROJECT_SOURCE_DIR}/source/util-math.cpp" "${PROJECT_SOURCE_DIR}/source/util-memory.cpp" ) diff --git a/source/gs-indexbuffer.cpp b/source/gs-indexbuffer.cpp index 8c30848..e47e95c 100644 --- a/source/gs-indexbuffer.cpp +++ b/source/gs-indexbuffer.cpp @@ -18,6 +18,7 @@ */ #include "gs-indexbuffer.h" +#include "gs-limits.h" extern "C" { #pragma warning( push ) #pragma warning( disable: 4201 ) @@ -25,8 +26,6 @@ extern "C" { #pragma warning( pop ) } -const uint32_t defaultMaximumVertices = 65535u; - GS::IndexBuffer::IndexBuffer(uint32_t maximumVertices) { this->reserve(maximumVertices); @@ -35,7 +34,7 @@ GS::IndexBuffer::IndexBuffer(uint32_t maximumVertices) { obs_leave_graphics(); } -GS::IndexBuffer::IndexBuffer() : IndexBuffer(defaultMaximumVertices) {} +GS::IndexBuffer::IndexBuffer() : IndexBuffer(MAXIMUM_VERTICES) {} GS::IndexBuffer::IndexBuffer(IndexBuffer& other) : IndexBuffer((uint32_t)other.size()) { std::copy(other.begin(), other.end(), this->end()); diff --git a/source/gs-limits.h b/source/gs-limits.h new file mode 100644 index 0000000..6c54798 --- /dev/null +++ b/source/gs-limits.h @@ -0,0 +1,26 @@ +/* +* Modern effects for a modern Streamer +* Copyright (C) 2017 Michael Fabian Dirks +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +#pragma once +#include + +namespace GS { + static const uint32_t MAXIMUM_VERTICES = 0xFFFFFFu; + static const uint32_t MAXIMUM_UVW_LAYERS = 8u; +} \ No newline at end of file