[Refactor] (All): Restructure include system.

This commit is contained in:
BZLZHH
2025-08-09 23:10:34 +08:00
parent a8914c09ce
commit 93ca669929
75 changed files with 3605 additions and 3339 deletions
+48 -43
View File
@@ -1,53 +1,58 @@
#pragma once
#include <Includes.h>
#include "BufferState/BufferState.h"
#include "VertexArrayState/VertexArrayState.h"
#include "ErrorState/Error.h"
#include "ProgramState/ProgramState.h"
namespace MobileGL {
namespace MG_State {
namespace GLState {
class GLContext {
public:
GLContext() = default;
namespace MG_State {
namespace GLState {
class GLContext {
public:
GLContext() = default;
// Error
void RecordError(ErrorCode code, SharedPtr<ErrorInfo> info = nullptr);
bool HasGLError() const;
Optional<const Error> PeekGLError() const;
Optional<Error> PopGLError();
bool HasNonGLError() const;
Optional<const Error> PeekNonGLError() const;
Optional<Error> PopNonGLError();
void ClearErrors();
// Error
void RecordError(ErrorCode code, SharedPtr<ErrorInfo> info = nullptr);
bool HasGLError() const;
Optional<const Error> PeekGLError() const;
Optional<Error> PopGLError();
bool HasNonGLError() const;
Optional<const Error> PeekNonGLError() const;
Optional<Error> PopNonGLError();
void ClearErrors();
// Buffer
Vector<Uint> GenBufferNames(Uint number);
SharedPtr<BufferObject> GetBufferObject(Uint index);
BindingSlot<BufferObject>& GetBufferBindingSlot(BufferTarget target);
SharedPtr<BufferObject> CreateBufferObject(Uint index);
void MarkBufferObjectForDeletion(Uint index);
bool ValidateBufferName(Uint index) const;
bool ValidateBufferObject(Uint index) const;
// Buffer
Vector<Uint> GenBufferNames(Uint number);
SharedPtr<BufferObject> GetBufferObject(Uint index);
BindingSlot<BufferObject>& GetBufferBindingSlot(BufferTarget target);
SharedPtr<BufferObject> CreateBufferObject(Uint index);
void MarkBufferObjectForDeletion(Uint index);
bool ValidateBufferName(Uint index) const;
bool ValidateBufferObject(Uint index) const;
// VertexArray
Vector<Uint> GenVertexArrayNames(Uint number);
SharedPtr<VertexArrayObject> GetVertexArrayObject(Uint index);
void BindVertexArray(Uint index);
SharedPtr<VertexArrayObject> CreateVertexArrayObject(Uint index);
void MarkVertexArrayForDeletion(Uint index);
bool ValidateVertexArrayName(Uint index) const;
bool ValidateVertexArrayObject(Uint index) const;
SharedPtr<VertexArrayObject> GetBoundVertexArray();
// VertexArray
Vector<Uint> GenVertexArrayNames(Uint number);
SharedPtr<VertexArrayObject> GetVertexArrayObject(Uint index);
void BindVertexArray(Uint index);
SharedPtr<VertexArrayObject> CreateVertexArrayObject(Uint index);
void MarkVertexArrayForDeletion(Uint index);
bool ValidateVertexArrayName(Uint index) const;
bool ValidateVertexArrayObject(Uint index) const;
SharedPtr<VertexArrayObject> GetBoundVertexArray();
private:
// Error
ErrorState m_errorState;
private:
// Error
ErrorState m_errorState;
// Buffer
BufferState m_bufferState;
// Buffer
BufferState m_bufferState;
// VertexArray
VertexArrayState m_vertexArrayState;
};
}
// VertexArray
VertexArrayState m_vertexArrayState;
};
} // namespace GLState
extern GLState::GLContext* pGLContext;
}
}
extern GLState::GLContext* pGLContext;
} // namespace MG_State
} // namespace MobileGL