[Feat] (...): Add ProgramState while implementing these gl functions. Rename some functions in MG_State.

This commit is contained in:
BZLZHH
2025-05-03 02:26:03 +08:00
parent 282e2496da
commit 00140d8b57
16 changed files with 602 additions and 74 deletions
@@ -34,8 +34,8 @@ DECLARE_GL_FUNCTION_HEAD(const GLubyte*, GetString, GLenum name) DECLARE_GL_FUNC
DECLARE_GL_FUNCTION_HEAD(void*, MapBuffer, GLenum target, GLenum access) DECLARE_GL_FUNCTION_END(void*, MapBuffer, target, access)
DECLARE_GL_FUNCTION_HEAD(void, ClearDepth, GLclampd depth) DECLARE_GL_FUNCTION_END_NO_RETURN(void, ClearDepth, depth)
DECLARE_GL_FUNCTION_HEAD(void, ActiveTexture, GLenum texture) DECLARE_GL_FUNCTION_END_NO_RETURN(void, ActiveTexture, texture)
DECLARE_GL_FUNCTION_STUB_HEAD(void, AttachShader, GLuint program, GLuint shader) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, AttachShader, program,shader)
DECLARE_GL_FUNCTION_STUB_HEAD(void, BindAttribLocation, GLuint program, GLuint index, const GLchar *name) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, BindAttribLocation, program,index,name)
DECLARE_GL_FUNCTION_HEAD(void, AttachShader, GLuint program, GLuint shader) DECLARE_GL_FUNCTION_END_NO_RETURN(void, AttachShader, program,shader)
DECLARE_GL_FUNCTION_HEAD(void, BindAttribLocation, GLuint program, GLuint index, const GLchar *name) DECLARE_GL_FUNCTION_END_NO_RETURN(void, BindAttribLocation, program,index,name)
DECLARE_GL_FUNCTION_HEAD(void, BindBuffer, GLenum target, GLuint buffer) DECLARE_GL_FUNCTION_END_NO_RETURN(void, BindBuffer, target,buffer)
DECLARE_GL_FUNCTION_STUB_HEAD(void, BindFramebuffer, GLenum target, GLuint framebuffer) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, BindFramebuffer, target,framebuffer)
DECLARE_GL_FUNCTION_STUB_HEAD(void, BindRenderbuffer, GLenum target, GLuint renderbuffer) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, BindRenderbuffer, target,renderbuffer)
@@ -58,14 +58,14 @@ DECLARE_GL_FUNCTION_STUB_HEAD(void, CompressedTexImage2D, GLenum target, GLint l
DECLARE_GL_FUNCTION_STUB_HEAD(void, CompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, CompressedTexSubImage2D, target,level,xoffset,yoffset,width,height,format,imageSize,data)
DECLARE_GL_FUNCTION_STUB_HEAD(void, CopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, CopyTexImage2D, target,level,internalformat,x,y,width,height,border)
DECLARE_GL_FUNCTION_STUB_HEAD(void, CopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, CopyTexSubImage2D, target,level,xoffset,yoffset,x,y,width,height)
DECLARE_GL_FUNCTION_STUB_HEAD(GLuint, CreateProgram) DECLARE_GL_FUNCTION_STUB_END(GLuint, CreateProgram)
DECLARE_GL_FUNCTION_STUB_HEAD(GLuint, CreateShader, GLenum type) DECLARE_GL_FUNCTION_STUB_END(GLuint, CreateShader, type)
DECLARE_GL_FUNCTION_HEAD(GLuint, CreateProgram) DECLARE_GL_FUNCTION_END(GLuint, CreateProgram)
DECLARE_GL_FUNCTION_HEAD(GLuint, CreateShader, GLenum type) DECLARE_GL_FUNCTION_END(GLuint, CreateShader, type)
DECLARE_GL_FUNCTION_STUB_HEAD(void, CullFace, GLenum mode) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, CullFace, mode)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DeleteBuffers, GLsizei n, const GLuint *buffers) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DeleteBuffers, n,buffers)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DeleteFramebuffers, GLsizei n, const GLuint *framebuffers) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DeleteFramebuffers, n,framebuffers)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DeleteProgram, GLuint program) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DeleteProgram, program)
DECLARE_GL_FUNCTION_HEAD(void, DeleteProgram, GLuint program) DECLARE_GL_FUNCTION_END_NO_RETURN(void, DeleteProgram, program)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DeleteRenderbuffers, GLsizei n, const GLuint *renderbuffers) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DeleteRenderbuffers, n,renderbuffers)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DeleteShader, GLuint shader) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DeleteShader, shader)
DECLARE_GL_FUNCTION_HEAD(void, DeleteShader, GLuint shader) DECLARE_GL_FUNCTION_END_NO_RETURN(void, DeleteShader, shader)
DECLARE_GL_FUNCTION_HEAD(void, DeleteTextures, GLsizei n, const GLuint *textures) DECLARE_GL_FUNCTION_END_NO_RETURN(void, DeleteTextures, n,textures)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DepthFunc, GLenum func) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DepthFunc, func)
DECLARE_GL_FUNCTION_STUB_HEAD(void, DepthMask, GLboolean flag) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, DepthMask, flag)
@@ -90,7 +90,7 @@ DECLARE_GL_FUNCTION_HEAD(void, GenTextures, GLsizei n, GLuint *textures) DECLARE
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetActiveAttrib, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetActiveAttrib, program,index,bufSize,length,size,type,name)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetActiveUniform, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetActiveUniform, program,index,bufSize,length,size,type,name)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetAttachedShaders, GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetAttachedShaders, program,maxCount,count,shaders)
DECLARE_GL_FUNCTION_STUB_HEAD(GLint, GetAttribLocation, GLuint program, const GLchar *name) DECLARE_GL_FUNCTION_STUB_END(GLint, GetAttribLocation, program,name)
DECLARE_GL_FUNCTION_HEAD(GLint, GetAttribLocation, GLuint program, const GLchar *name) DECLARE_GL_FUNCTION_END(GLint, GetAttribLocation, program,name)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetBooleanv, GLenum pname, GLboolean *data) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetBooleanv, pname,data)
DECLARE_GL_FUNCTION_HEAD(void, GetBufferParameteriv, GLenum target, GLenum pname, GLint *params) DECLARE_GL_FUNCTION_END_NO_RETURN(void, GetBufferParameteriv, target,pname,params)
DECLARE_GL_FUNCTION_HEAD(GLenum, GetError) DECLARE_GL_FUNCTION_END(GLenum, GetError)
@@ -108,7 +108,7 @@ DECLARE_GL_FUNCTION_STUB_HEAD(void, GetTexParameterfv, GLenum target, GLenum pna
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetTexParameteriv, GLenum target, GLenum pname, GLint *params) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetTexParameteriv, target,pname,params)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetUniformfv, GLuint program, GLint location, GLfloat *params) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetUniformfv, program,location,params)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetUniformiv, GLuint program, GLint location, GLint *params) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetUniformiv, program,location,params)
DECLARE_GL_FUNCTION_STUB_HEAD(GLint, GetUniformLocation, GLuint program, const GLchar *name) DECLARE_GL_FUNCTION_STUB_END(GLint, GetUniformLocation, program,name)
DECLARE_GL_FUNCTION_HEAD(GLint, GetUniformLocation, GLuint program, const GLchar *name) DECLARE_GL_FUNCTION_END(GLint, GetUniformLocation, program,name)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetVertexAttribfv, GLuint index, GLenum pname, GLfloat *params) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetVertexAttribfv, index,pname,params)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetVertexAttribiv, GLuint index, GLenum pname, GLint *params) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetVertexAttribiv, index,pname,params)
DECLARE_GL_FUNCTION_STUB_HEAD(void, GetVertexAttribPointerv, GLuint index, GLenum pname, void **pointer) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, GetVertexAttribPointerv, index,pname,pointer)
@@ -121,7 +121,7 @@ DECLARE_GL_FUNCTION_STUB_HEAD(GLboolean, IsRenderbuffer, GLuint renderbuffer) DE
DECLARE_GL_FUNCTION_STUB_HEAD(GLboolean, IsShader, GLuint shader) DECLARE_GL_FUNCTION_STUB_END(GLboolean, IsShader, shader)
DECLARE_GL_FUNCTION_STUB_HEAD(GLboolean, IsTexture, GLuint texture) DECLARE_GL_FUNCTION_STUB_END(GLboolean, IsTexture, texture)
DECLARE_GL_FUNCTION_STUB_HEAD(void, LineWidth, GLfloat width) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, LineWidth, width)
DECLARE_GL_FUNCTION_STUB_HEAD(void, LinkProgram, GLuint program) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, LinkProgram, program)
DECLARE_GL_FUNCTION_HEAD(void, LinkProgram, GLuint program) DECLARE_GL_FUNCTION_END_NO_RETURN(void, LinkProgram, program)
DECLARE_GL_FUNCTION_HEAD(void, PixelStorei, GLenum pname, GLint param) DECLARE_GL_FUNCTION_END_NO_RETURN(void, PixelStorei, pname,param)
DECLARE_GL_FUNCTION_STUB_HEAD(void, PolygonOffset, GLfloat factor, GLfloat units) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, PolygonOffset, factor,units)
DECLARE_GL_FUNCTION_STUB_HEAD(void, ReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, ReadPixels, x,y,width,height,format,type,pixels)
@@ -130,7 +130,7 @@ DECLARE_GL_FUNCTION_STUB_HEAD(void, RenderbufferStorage, GLenum target, GLenum i
DECLARE_GL_FUNCTION_STUB_HEAD(void, SampleCoverage, GLfloat value, GLboolean invert) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, SampleCoverage, value,invert)
DECLARE_GL_FUNCTION_STUB_HEAD(void, Scissor, GLint x, GLint y, GLsizei width, GLsizei height) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, Scissor, x,y,width,height)
DECLARE_GL_FUNCTION_STUB_HEAD(void, ShaderBinary, GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, ShaderBinary, count,shaders,binaryformat,binary,length)
DECLARE_GL_FUNCTION_STUB_HEAD(void, ShaderSource, GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, ShaderSource, shader,count,string,length)
DECLARE_GL_FUNCTION_HEAD(void, ShaderSource, GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length) DECLARE_GL_FUNCTION_END_NO_RETURN(void, ShaderSource, shader,count,string,length)
DECLARE_GL_FUNCTION_STUB_HEAD(void, StencilFunc, GLenum func, GLint ref, GLuint mask) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, StencilFunc, func,ref,mask)
DECLARE_GL_FUNCTION_STUB_HEAD(void, StencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, StencilFuncSeparate, face,func,ref,mask)
DECLARE_GL_FUNCTION_STUB_HEAD(void, StencilMask, GLuint mask) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, StencilMask, mask)
@@ -162,7 +162,7 @@ DECLARE_GL_FUNCTION_STUB_HEAD(void, Uniform4iv, GLint location, GLsizei count, c
DECLARE_GL_FUNCTION_STUB_HEAD(void, UniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, UniformMatrix2fv, location,count,transpose,value)
DECLARE_GL_FUNCTION_STUB_HEAD(void, UniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, UniformMatrix3fv, location,count,transpose,value)
DECLARE_GL_FUNCTION_STUB_HEAD(void, UniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, UniformMatrix4fv, location,count,transpose,value)
DECLARE_GL_FUNCTION_STUB_HEAD(void, UseProgram, GLuint program) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, UseProgram, program)
DECLARE_GL_FUNCTION_HEAD(void, UseProgram, GLuint program) DECLARE_GL_FUNCTION_END_NO_RETURN(void, UseProgram, program)
DECLARE_GL_FUNCTION_STUB_HEAD(void, ValidateProgram, GLuint program) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, ValidateProgram, program)
DECLARE_GL_FUNCTION_STUB_HEAD(void, VertexAttrib1f, GLuint index, GLfloat x) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, VertexAttrib1f, index,x)
DECLARE_GL_FUNCTION_STUB_HEAD(void, VertexAttrib1fv, GLuint index, const GLfloat *v) DECLARE_GL_FUNCTION_STUB_END_NO_RETURN(void, VertexAttrib1fv, index,v)
@@ -5,8 +5,129 @@
#include "GL_Program.h"
namespace MG_GL::GL {
void GetProgramiv(GLuint program, GLenum pname, GLint *params) {
// TODO: Check if program linking is successful.
*params = GL_TRUE;
GLuint CreateShader(GLenum type) {
MG_Util::Debug::LogD("glCreateShader, type: %s", MG_Util::Debug::GLEnumToString(type));
GLuint shader;
GLenum result = MG_State::CreateShader(type, &shader);
if (result == GL_NO_ERROR) {
MG_Util::Debug::LogD("Created shader ID: %u", shader);
return shader;
}
MG_State::SetError(result);
MG_Util::Debug::LogE("Error creating shader: %s", MG_Util::Debug::GLEnumToString(result));
return 0;
}
GLuint CreateProgram() {
MG_Util::Debug::LogD("glCreateProgram");
GLuint program;
GLenum result = MG_State::CreateProgram(&program);
if (result == GL_NO_ERROR) {
MG_Util::Debug::LogD("Created program ID: %u", program);
return program;
}
MG_State::SetError(result);
MG_Util::Debug::LogE("Error creating program: %s", MG_Util::Debug::GLEnumToString(result));
return 0;
}
void DeleteShader(GLuint shader) {
MG_Util::Debug::LogD("glDeleteShader, shader: %u", shader);
GLenum result = MG_State::DeleteShader(shader);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error deleting shader: %s", MG_Util::Debug::GLEnumToString(result));
}
void DeleteProgram(GLuint program) {
MG_Util::Debug::LogD("glDeleteProgram, program: %u", program);
GLenum result = MG_State::DeleteProgram(program);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error deleting program: %s", MG_Util::Debug::GLEnumToString(result));
}
void AttachShader(GLuint program, GLuint shader) {
MG_Util::Debug::LogD("glAttachShader, program: %u, shader: %u", program, shader);
GLenum result = MG_State::LinkShaderToProgram(program, shader);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error attaching shader: %s", MG_Util::Debug::GLEnumToString(result));
}
void ShaderSource(GLuint shader, GLsizei count, const GLchar *const*string, const GLint* length) {
MG_Util::Debug::LogD("glShaderSource, shader: %u, count: %d", shader, count);
GLenum result = MG_State::UploadShaderSource(shader, count, (const GLchar **)string, length);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error setting shader source: %s", MG_Util::Debug::GLEnumToString(result));
}
void CompileShader(GLuint shader) {
MG_Util::Debug::LogD("glCompileShader, shader: %u", shader);
GLenum result = MG_State::BuildShaderStage(shader);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error compiling shader: %s", MG_Util::Debug::GLEnumToString(result));
}
void LinkProgram(GLuint program) {
MG_Util::Debug::LogD("glLinkProgram, program: %u", program);
GLenum result = MG_State::FinalizeProgramPipeline(program);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error linking program: %s", MG_Util::Debug::GLEnumToString(result));
}
void UseProgram(GLuint program) {
MG_Util::Debug::LogD("glUseProgram, program: %u", program);
GLenum result = MG_State::ActivateRenderProgram(program);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error using program: %s", MG_Util::Debug::GLEnumToString(result));
}
void BindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
MG_Util::Debug::LogD("glBindAttribLocation, program: %u, index: %u, name: %s", program, index, name);
GLenum result = MG_State::DefineProgramAttributeBinding(program, index, name);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error binding attribute: %s", MG_Util::Debug::GLEnumToString(result));
}
GLint GetAttribLocation(GLuint program, const GLchar* name) {
MG_Util::Debug::LogD("glGetAttribLocation, program: %u, name: %s", program, name);
GLint location = MG_State::QueryProgramAttributeBinding(program, name);
if (location != -1) return location;
MG_State::SetError(GL_INVALID_OPERATION);
MG_Util::Debug::LogE("Attribute not found: %s", name);
return -1;
}
GLint GetUniformLocation(GLuint program, const GLchar* name) {
MG_Util::Debug::LogD("glGetUniformLocation, program: %u, name: %s", program, name);
GLint location = MG_State::QueryProgramUniformLocation(program, name);
if (location != -1) return location;
MG_State::SetError(GL_INVALID_OPERATION);
MG_Util::Debug::LogE("Uniform not found: %s", name);
return -1;
}
void GetProgramiv(GLuint program, GLenum pname, GLint* params) {
MG_Util::Debug::LogD("glGetProgramiv, program: %u, pname: %s",
program, MG_Util::Debug::GLEnumToString(pname));
GLenum result = MG_State::QueryProgramStateIntVector(program, pname, params);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error getting program param: %s", MG_Util::Debug::GLEnumToString(result));
}
void GetShaderiv(GLuint shader, GLenum pname, GLint* params) {
MG_Util::Debug::LogD("glGetShaderiv, shader: %u, pname: %s",
shader, MG_Util::Debug::GLEnumToString(pname));
GLenum result = MG_State::QueryShaderStateIntVector(shader, pname, params);
if (result == GL_NO_ERROR) return;
MG_State::SetError(result);
MG_Util::Debug::LogE("Error getting shader param: %s", MG_Util::Debug::GLEnumToString(result));
}
}
@@ -8,7 +8,20 @@
#include "../../../../Includes.h"
namespace MG_GL::GL {
void GetProgramiv(GLuint program, GLenum pname, GLint *params);
GLuint CreateShader(GLenum type);
GLuint CreateProgram();
void DeleteShader(GLuint shader);
void DeleteProgram(GLuint program);
void AttachShader(GLuint program, GLuint shader);
void ShaderSource(GLuint shader, GLsizei count, const GLchar *const*string, const GLint* length);
void CompileShader(GLuint shader);
void LinkProgram(GLuint program);
void UseProgram(GLuint program);
void BindAttribLocation(GLuint program, GLuint index, const GLchar* name);
GLint GetAttribLocation(GLuint program, const GLchar* name);
GLint GetUniformLocation(GLuint program, const GLchar* name);
void GetProgramiv(GLuint program, GLenum pname, GLint* params);
void GetShaderiv(GLuint shader, GLenum pname, GLint* params);
}
#endif //MOBILEGL_GL_PROGRAM_H
@@ -1,12 +0,0 @@
//
// Created by BZLZHH on 2025/3/15.
//
#include "GL_Shader.h"
namespace MG_GL::GL {
void GetShaderiv(GLuint shader, GLenum pname, GLint *params) {
// TODO: Check if shader compilation is successful.
*params = GL_TRUE;
}
}
@@ -1,14 +0,0 @@
//
// Created by BZLZHH on 2025/3/15.
//
#ifndef MOBILEGL_GL_SHADER_H
#define MOBILEGL_GL_SHADER_H
#include "../../../../Includes.h"
namespace MG_GL::GL {
void GetShaderiv(GLuint shader, GLenum pname, GLint *params);
}
#endif //MOBILEGL_GL_SHADER_H
@@ -84,7 +84,7 @@ namespace MG_GL::GL {
void GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params) {
MG_Util::Debug::LogD("glGetTexLevelParameteriv, target: %d, level: %d, pname: %d, params: %p",
target, level, pname, params);
GLenum result = MG_State::GetTextureLevelPropertyIntVector(target, level, pname, params);
GLenum result = MG_State::QueryTextureLevelPropertyIntVector(target, level, pname, params);
if (result == GL_NO_ERROR)
return;
MG_State::SetError(result);