mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Feat] (MG_State/Program): GetProgramInfoLog, GetShaderInfoLog
This commit is contained in:
@@ -14,6 +14,7 @@ namespace MobileGL {
|
||||
void Link();
|
||||
void MarkAsDeleted();
|
||||
Vector<SharedPtr<ShaderObject>>& GetAttachedShaders();
|
||||
const String& GetInfoLog() const { return m_infoLog; }
|
||||
private:
|
||||
const Uint m_id = 0;
|
||||
Vector<SharedPtr<ShaderObject>> m_shaders;
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
namespace MobileGL {
|
||||
namespace MG_State {
|
||||
namespace GLState {
|
||||
void ShaderObject::SetShaderSource(const std::string& source) {
|
||||
void ShaderObject::SetShaderSource(const String& source) {
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
void ShaderObject::SetShaderSource(std::string &&source) {
|
||||
void ShaderObject::SetShaderSource(String &&source) {
|
||||
m_source = Move(source);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,21 +57,22 @@ namespace MobileGL {
|
||||
class ShaderObject {
|
||||
public:
|
||||
ShaderObject(const ShaderStage stage, const Uint id) : m_stage(stage), m_id(id) {}
|
||||
void SetShaderSource(const std::string& source);
|
||||
void SetShaderSource(std::string&& source);
|
||||
void SetShaderSource(const String& source);
|
||||
void SetShaderSource(String&& source);
|
||||
void Compile();
|
||||
void MarkAsDeleted();
|
||||
|
||||
Uint GetId() const { return m_id; }
|
||||
ShaderStage GetShaderStage() const { return m_stage; }
|
||||
const std::string& GetShaderSource() const { return m_source; }
|
||||
const String& GetShaderSource() const { return m_source; }
|
||||
SharedPtr<glslang::TShader> GetCompiledShader() const { return m_shader; }
|
||||
const String& GetInfoLog() const { return m_infoLog; }
|
||||
private:
|
||||
const Uint m_id = 0;
|
||||
const ShaderStage m_stage;
|
||||
std::string m_source;
|
||||
String m_source;
|
||||
SharedPtr<glslang::TShader> m_shader;
|
||||
std::string m_infoLog;
|
||||
String m_infoLog;
|
||||
|
||||
Bool m_deleteStatus = false;
|
||||
Bool m_compileStatus = false;
|
||||
|
||||
Reference in New Issue
Block a user