diff --git a/CMakeLists.txt b/CMakeLists.txt index bde82e07..96e5e734 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,9 @@ set(SOURCE_FILES MobileGL/MG_State/GLState/VertexArrayState/VertexArrayState.cpp MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp MobileGL/MG_State/GLState/TextureState/TextureObject.cpp + MobileGL/MG_State/GLState/TextureState/TextureObject1D.cpp + MobileGL/MG_State/GLState/TextureState/TextureObject2D.cpp + MobileGL/MG_State/GLState/TextureState/TextureObject3D.cpp MobileGL/MG_State/GLState/TextureState/TextureUnit.cpp MobileGL/MG_State/GLState/TextureState/TextureState.cpp MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp diff --git a/MobileGL/MG_Impl/GLImpl/Texture/ProxyTexture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/ProxyTexture.cpp index 5f338376..500b0725 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/ProxyTexture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/ProxyTexture.cpp @@ -1,5 +1,5 @@ #include "ProxyTexture.h" -#include "MG_State/GLState/TextureState/TextureObject.h" +#include "MG_State/GLState/TextureState/TextureObject2D.h" #include "MG_Util/Types.h" namespace MobileGL::MG_Impl::GLImpl { diff --git a/MobileGL/MG_Impl/Init.cpp b/MobileGL/MG_Impl/Init.cpp index 398ef3d6..88caf025 100644 --- a/MobileGL/MG_Impl/Init.cpp +++ b/MobileGL/MG_Impl/Init.cpp @@ -2,6 +2,10 @@ #include "GLImpl/Texture/ProxyTexture.h" #include "GLImpl/Framebuffer/GL_Framebuffer.h" +#include "MG_State/GLState/TextureState/TextureObject1D.h" +#include "MG_State/GLState/TextureState/TextureObject2D.h" +#include "MG_State/GLState/TextureState/TextureObject3D.h" + namespace MobileGL { namespace MG_Impl { void Init() { diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp b/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp index 32b28a18..27379880 100644 --- a/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp @@ -137,36 +137,6 @@ namespace MobileGL { m_levelRange.y() = maxLevel; } - // TextureObject1D - TextureObject1D::TextureObject1D(Uint externalIndex) - : TextureObjectBase(TextureTarget::Texture1D, externalIndex) {} - - void TextureObject1D::SetMipmapImpl(const MipmapLevelInput& level) { - if (level.size.x() > 0) { - m_mipmaps.push_back(MipmapLevelInternal(level)); - } - } - - // TextureObject2D - TextureObject2D::TextureObject2D(Uint externalIndex) - : TextureObjectBase(TextureTarget::Texture2D, externalIndex) {} - - void TextureObject2D::SetMipmapImpl(const MipmapLevelInput& level) { - if (level.size.x() > 0 && level.size.y() > 0) { - m_mipmaps.push_back(MipmapLevelInternal(level)); - } - } - - // TextureObject3D - TextureObject3D::TextureObject3D(Uint externalIndex) - : TextureObjectBase(TextureTarget::Texture3D, externalIndex) {} - - void TextureObject3D::SetMipmapImpl(const MipmapLevelInput& level) { - if (level.size.x() > 0 && level.size.y() > 0 && level.size.z() > 0) { - m_mipmaps.push_back(MipmapLevelInternal(level)); - } - } - // TODO: add other texture types as needed } // namespace GLState diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject.h b/MobileGL/MG_State/GLState/TextureState/TextureObject.h index 11c1ee11..ff23d652 100644 --- a/MobileGL/MG_State/GLState/TextureState/TextureObject.h +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject.h @@ -274,33 +274,6 @@ namespace MobileGL { TextureSwizzleParam::Blue, TextureSwizzleParam::Alpha}; UintVec2 m_levelRange = {0, 1000}; }; - - class TextureObject1D : public TextureObjectBase { - public: - explicit TextureObject1D(Uint externalIndex); - - protected: - void SetMipmapImpl(const MipmapLevelInput& level) override; - }; - - class TextureObject2D : public TextureObjectBase { - public: - explicit TextureObject2D(Uint externalIndex); - - protected: - void SetMipmapImpl(const MipmapLevelInput& level) override; - }; - - class TextureObject3D : public TextureObjectBase { - public: - explicit TextureObject3D(Uint externalIndex); - - protected: - void SetMipmapImpl(const MipmapLevelInput& level) override; - }; - - // TODO: add other texture types as needed - } // namespace GLState } // namespace MG_State } // namespace MobileGL diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject1D.cpp b/MobileGL/MG_State/GLState/TextureState/TextureObject1D.cpp new file mode 100644 index 00000000..3db2afbc --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject1D.cpp @@ -0,0 +1,16 @@ +#include "TextureObject1D.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + TextureObject1D::TextureObject1D(Uint externalIndex) + : TextureObjectBase(TextureTarget::Texture1D, externalIndex) {} + + void TextureObject1D::SetMipmapImpl(const MipmapLevelInput& level) { + if (level.size.x() > 0) { + m_mipmaps.push_back(MipmapLevelInternal(level)); + } + } + } + } +} \ No newline at end of file diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject1D.h b/MobileGL/MG_State/GLState/TextureState/TextureObject1D.h new file mode 100644 index 00000000..aff5cfd5 --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject1D.h @@ -0,0 +1,16 @@ +#pragma once +#include "TextureObject.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + class TextureObject1D : public TextureObjectBase { + public: + explicit TextureObject1D(Uint externalIndex); + + protected: + void SetMipmapImpl(const MipmapLevelInput& level) override; + }; + } + } +} diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject2D.cpp b/MobileGL/MG_State/GLState/TextureState/TextureObject2D.cpp new file mode 100644 index 00000000..270a96b9 --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject2D.cpp @@ -0,0 +1,16 @@ +#include "TextureObject2D.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + TextureObject2D::TextureObject2D(Uint externalIndex) + : TextureObjectBase(TextureTarget::Texture2D, externalIndex) {} + + void TextureObject2D::SetMipmapImpl(const MipmapLevelInput& level) { + if (level.size.x() > 0 && level.size.y() > 0) { + m_mipmaps.push_back(MipmapLevelInternal(level)); + } + } + } + } +} \ No newline at end of file diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject2D.h b/MobileGL/MG_State/GLState/TextureState/TextureObject2D.h new file mode 100644 index 00000000..f349f53b --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject2D.h @@ -0,0 +1,16 @@ +#pragma once +#include "TextureObject.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + class TextureObject2D : public TextureObjectBase { + public: + explicit TextureObject2D(Uint externalIndex); + + protected: + void SetMipmapImpl(const MipmapLevelInput& level) override; + }; + } + } +} diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject3D.cpp b/MobileGL/MG_State/GLState/TextureState/TextureObject3D.cpp new file mode 100644 index 00000000..6fda7f3b --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject3D.cpp @@ -0,0 +1,16 @@ +#include "TextureObject3D.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + TextureObject3D::TextureObject3D(Uint externalIndex) + : TextureObjectBase(TextureTarget::Texture3D, externalIndex) {} + + void TextureObject3D::SetMipmapImpl(const MipmapLevelInput& level) { + if (level.size.x() > 0 && level.size.y() > 0 && level.size.z() > 0) { + m_mipmaps.push_back(MipmapLevelInternal(level)); + } + } + } + } +} \ No newline at end of file diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject3D.h b/MobileGL/MG_State/GLState/TextureState/TextureObject3D.h new file mode 100644 index 00000000..45eeff20 --- /dev/null +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject3D.h @@ -0,0 +1,16 @@ +#pragma once +#include "TextureObject.h" + +namespace MobileGL { + namespace MG_State { + namespace GLState { + class TextureObject3D : public TextureObjectBase { + public: + explicit TextureObject3D(Uint externalIndex); + + protected: + void SetMipmapImpl(const MipmapLevelInput& level) override; + }; + } + } +} diff --git a/MobileGL/MG_State/GLState/TextureState/TextureState.cpp b/MobileGL/MG_State/GLState/TextureState/TextureState.cpp index 63e303b0..0e58996e 100644 --- a/MobileGL/MG_State/GLState/TextureState/TextureState.cpp +++ b/MobileGL/MG_State/GLState/TextureState/TextureState.cpp @@ -1,5 +1,8 @@ #include "TextureState.h" #include "MG_State/GLState/TextureState/TextureObject.h" +#include "MG_State/GLState/TextureState/TextureObject1D.h" +#include "MG_State/GLState/TextureState/TextureObject2D.h" +#include "MG_State/GLState/TextureState/TextureObject3D.h" #include "MG_Util/Types.h" namespace MobileGL {