[Feat|Fix] (...): Add/Fix lots of stuff, being able not to crash in MC.

This commit is contained in:
BZLZHH
2025-10-06 16:08:35 +08:00
parent e37dedb72d
commit bd1056f9c9
36 changed files with 1164 additions and 201 deletions
@@ -46,7 +46,6 @@ namespace MobileGL {
Color31,
Depth,
Stencil,
DepthStencil,
FramebufferAttachmentTypeCount,
Unknown = -1
};
@@ -60,8 +59,7 @@ namespace MobileGL {
// TODO: add Renderbuffer when it is implemented
explicit FramebufferAttachment(SharedPtr<MG_State::GLState::ITextureObject> texture, Int level = 0);
explicit FramebufferAttachment(SharedPtr<RenderbufferObjectStub> renderbuffer);
explicit FramebufferAttachment(std::nullptr_t);
explicit FramebufferAttachment();
explicit FramebufferAttachment(Bool IsValid = true);
Bool IsTexture() const;
Bool IsRenderbuffer() const;
@@ -71,11 +69,13 @@ namespace MobileGL {
Int GetTextureLevel() const;
Bool IsComplete() const;
IntVec3 GetSize() const;
Bool IsValid() const;
private:
SharedPtr<MG_State::GLState::ITextureObject> m_texture = nullptr;
SharedPtr<RenderbufferObjectStub> m_renderbuffer = nullptr;
Int m_textureLevel = 0;
Bool m_isValid = true;
};
class FramebufferObject {