mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Feat] (...): Add global OpenGL state. Add gl texture state (almost complete for Minecraft) and implementation gl texture functions that Minecraft would use. Add gl error state.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Created by BZLZHH on 2025/4/4.
|
||||
//
|
||||
|
||||
#ifndef MOBILEGL_GLSTATE_H
|
||||
#define MOBILEGL_GLSTATE_H
|
||||
|
||||
#include "../../../Includes.h"
|
||||
|
||||
struct MG_State_T {
|
||||
static std::queue<GLenum> glErrorQueue;
|
||||
static TextureState* textureState;
|
||||
};
|
||||
|
||||
namespace MG_State {
|
||||
extern MG_State_T* MG_State_O;
|
||||
|
||||
void Init();
|
||||
void Destroy();
|
||||
void SetError(GLenum error);
|
||||
GLenum GetError();
|
||||
|
||||
//Texture
|
||||
GLenum BindTextureUnit(GLenum textureUnit);
|
||||
GLenum CreateTexture(GLuint* texture);
|
||||
GLenum CreateTextures(GLsizei n, GLuint* textures);
|
||||
GLenum BindTexture(GLenum target, GLuint texture);
|
||||
GLenum UploadTexture2D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, const void* data);
|
||||
GLenum UpdateTextureRegion2D(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid* data);
|
||||
GLenum SetTexturePropertyInt(GLenum target, GLenum pname, GLint param);
|
||||
GLenum SetTexturePropertyFloat(GLenum target, GLenum pname, GLfloat param);
|
||||
GLenum DeleteTexture(GLuint texture);
|
||||
GLenum DeleteTextures(GLsizei n, const GLuint* textures);
|
||||
GLenum GetTextureLevelPropertyIntVector(GLenum target, GLint level, GLenum pname, GLint* params);
|
||||
}
|
||||
|
||||
|
||||
#endif //MOBILEGL_GLSTATE_H
|
||||
Reference in New Issue
Block a user