[Feat] (...): Add BufferState and VertexBufferState while implementing these gl functions.

This commit is contained in:
BZLZHH
2025-05-01 22:20:34 +08:00
parent 369b9b320b
commit 33104f699a
16 changed files with 702 additions and 23 deletions
+28 -1
View File
@@ -11,6 +11,8 @@ struct MG_State_T {
static std::queue<GLenum> glErrorQueue;
static TextureState* textureState;
static CommonState* commonState;
static BufferState* bufferState;
static VertexArrayState* vertexArrayState;
};
namespace MG_State {
@@ -35,9 +37,34 @@ namespace MG_State {
GLenum DeleteTexture(GLuint texture);
GLenum DeleteTextures(GLsizei n, const GLuint* textures);
GLenum GetTextureLevelPropertyIntVector(GLenum target, GLint level, GLenum pname, GLint* params);
// Common
GLenum SetPixelStoreInt(GLenum pname, GLint param);
GLint GetPixelStoreInt(GLenum pname);
// Buffer
GLenum AcquireBufferMemory(GLenum target, GLenum access, void** mappedPtr);
GLenum ReleaseBufferMemory(GLenum target);
GLenum CreateBuffer(GLuint* buffer);
GLenum CreateBuffers(GLsizei n, GLuint* buffers);
GLenum BindBuffer(GLenum target, GLuint buffer);
GLenum CommitBufferStorage(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
bool ValidateBufferHandle(GLuint buffer);
void DeleteBuffer(GLuint buffer);
GLenum QueryBufferPropertyIntVector(GLenum target, GLenum pname, GLint* params);
// VertexArray
GLenum CreateVertexArray(GLuint* array);
GLenum CreateVertexArrays(GLsizei n, GLuint* arrays);
GLenum BindVertexArray(GLuint array);
GLenum EnableVertexAttribArray(GLuint index);
GLenum DisableVertexAttribArray(GLuint index);
GLenum SetVertexAttributeLayout(GLuint index, GLint size, GLenum type,
GLboolean normalized, GLsizei stride,
const void* pointer);
GLenum SetVertexAttributeLayoutInt(GLuint index, GLint size, GLenum type,
GLsizei stride, const void* pointer);
}