OpenGLRenderer: Fix Y flipping for FBOs
This commit is contained in:
@@ -26,10 +26,14 @@ namespace Nz::GL
|
||||
|
||||
inline void AttachShader(GLuint shader);
|
||||
|
||||
inline bool GetLinkStatus(std::string* error = nullptr);
|
||||
inline bool GetLinkStatus(std::string* error = nullptr) const;
|
||||
inline GLint GetUniformLocation(const char* uniformName) const;
|
||||
inline GLint GetUniformLocation(const std::string& uniformName) const;
|
||||
|
||||
inline void Link();
|
||||
|
||||
inline void Uniform(GLint uniformLocation, float value) const;
|
||||
|
||||
Program& operator=(const Program&) = delete;
|
||||
Program& operator=(Program&&) noexcept = default;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Nz::GL
|
||||
context.glAttachShader(m_objectId, shader);
|
||||
}
|
||||
|
||||
inline bool Program::GetLinkStatus(std::string* error)
|
||||
inline bool Program::GetLinkStatus(std::string* error) const
|
||||
{
|
||||
assert(m_objectId);
|
||||
const Context& context = EnsureDeviceContext();
|
||||
@@ -45,6 +45,19 @@ namespace Nz::GL
|
||||
return true;
|
||||
}
|
||||
|
||||
inline GLint Program::GetUniformLocation(const char* uniformName) const
|
||||
{
|
||||
assert(m_objectId);
|
||||
const Context& context = EnsureDeviceContext();
|
||||
|
||||
return context.glGetUniformLocation(m_objectId, uniformName);
|
||||
}
|
||||
|
||||
inline GLint Program::GetUniformLocation(const std::string& uniformName) const
|
||||
{
|
||||
return GetUniformLocation(uniformName.c_str());
|
||||
}
|
||||
|
||||
inline void Program::Link()
|
||||
{
|
||||
assert(m_objectId);
|
||||
@@ -53,6 +66,15 @@ namespace Nz::GL
|
||||
context.glLinkProgram(m_objectId);
|
||||
}
|
||||
|
||||
inline void Program::Uniform(GLint uniformLocation, float value) const
|
||||
{
|
||||
assert(m_objectId);
|
||||
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.BindProgram(m_objectId);
|
||||
context.glUniform1f(uniformLocation, value);
|
||||
}
|
||||
|
||||
inline GLuint Program::CreateHelper(OpenGLDevice& /*device*/, const Context& context)
|
||||
{
|
||||
return context.glCreateProgram();
|
||||
|
||||
Reference in New Issue
Block a user