mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Fix] (MG_State/FramebufferState): Fix missing functions.
This commit is contained in:
@@ -11,6 +11,7 @@ namespace MobileGL {
|
||||
: m_renderbuffer(renderbuffer) {}
|
||||
FramebufferAttachment::FramebufferAttachment(std::nullptr_t)
|
||||
: m_texture(nullptr), m_renderbuffer(nullptr) {}
|
||||
FramebufferAttachment::FramebufferAttachment() : m_texture(nullptr), m_renderbuffer(nullptr) {}
|
||||
|
||||
Bool FramebufferAttachment::IsTexture() const {
|
||||
return m_texture != nullptr;
|
||||
@@ -55,6 +56,10 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
// FramebufferObject
|
||||
FramebufferObject::FramebufferObject() {
|
||||
m_attachments.fill(FramebufferAttachment(nullptr));
|
||||
}
|
||||
|
||||
void FramebufferObject::AttachTexture(FramebufferAttachmentType type, SharedPtr<ITextureObject> texture,
|
||||
int level) {
|
||||
m_attachments[static_cast<SizeT>(type)] = FramebufferAttachment(std::move(texture), level);
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace MobileGL {
|
||||
explicit FramebufferAttachment(SharedPtr<MG_State::GLState::ITextureObject> texture, Int level = 0);
|
||||
explicit FramebufferAttachment(SharedPtr<RenderbufferObjectStub> renderbuffer);
|
||||
explicit FramebufferAttachment(std::nullptr_t);
|
||||
explicit FramebufferAttachment();
|
||||
|
||||
Bool IsTexture() const;
|
||||
Bool IsRenderbuffer() const;
|
||||
@@ -72,8 +73,8 @@ namespace MobileGL {
|
||||
IntVec3 GetSize() const;
|
||||
|
||||
private:
|
||||
SharedPtr<MG_State::GLState::ITextureObject> m_texture;
|
||||
SharedPtr<RenderbufferObjectStub> m_renderbuffer;
|
||||
SharedPtr<MG_State::GLState::ITextureObject> m_texture = nullptr;
|
||||
SharedPtr<RenderbufferObjectStub> m_renderbuffer = nullptr;
|
||||
Int m_textureLevel = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user