mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Feat] (MG_State/TextureState): Implement GetMipmap for TextureObject.
This commit is contained in:
@@ -34,6 +34,14 @@ namespace MobileGL {
|
|||||||
return m_mipmaps;
|
return m_mipmaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MipmapLevelInternal& TextureObjectBase::GetMipmap(Int index) {
|
||||||
|
if (index > m_mipmaps.size()) {
|
||||||
|
// fallback to the last mipmap
|
||||||
|
index = static_cast<Int>(m_mipmaps.size() - 1);
|
||||||
|
}
|
||||||
|
return m_mipmaps[index];
|
||||||
|
}
|
||||||
|
|
||||||
void TextureObjectBase::SetInternalFormat(TextureInternalFormat format) {
|
void TextureObjectBase::SetInternalFormat(TextureInternalFormat format) {
|
||||||
m_internalFormat = format;
|
m_internalFormat = format;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ namespace MobileGL {
|
|||||||
virtual IntVec3 GetBaseSize() const = 0;
|
virtual IntVec3 GetBaseSize() const = 0;
|
||||||
virtual SharedPtr<SamplerObject> GetSamplerObject() const = 0;
|
virtual SharedPtr<SamplerObject> GetSamplerObject() const = 0;
|
||||||
virtual const Vector<MipmapLevelInternal>& GetMipmaps() const = 0;
|
virtual const Vector<MipmapLevelInternal>& GetMipmaps() const = 0;
|
||||||
|
virtual MipmapLevelInternal& GetMipmap(Int index) = 0;
|
||||||
virtual void SetInternalFormat(TextureInternalFormat format) = 0;
|
virtual void SetInternalFormat(TextureInternalFormat format) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -221,6 +222,7 @@ namespace MobileGL {
|
|||||||
IntVec3 GetBaseSize() const override;
|
IntVec3 GetBaseSize() const override;
|
||||||
SharedPtr<SamplerObject> GetSamplerObject() const override;
|
SharedPtr<SamplerObject> GetSamplerObject() const override;
|
||||||
const Vector<MipmapLevelInternal>& GetMipmaps() const override;
|
const Vector<MipmapLevelInternal>& GetMipmaps() const override;
|
||||||
|
MipmapLevelInternal& GetMipmap(Int index) override;
|
||||||
void SetInternalFormat(TextureInternalFormat format) override;
|
void SetInternalFormat(TextureInternalFormat format) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user