mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-03 03:56:30 +03:00
I made some structural changes, and i'm trying to encapsulate a little the renderer to in a future implement an OpenGL3 render, and remove the fixed pipeline.
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
#include "cglobalbatchrenderer.hpp"
|
||||
#include "glhelper.hpp"
|
||||
|
||||
using namespace EE::Graphics::Private;
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
cShaderProgram::cShaderProgram( const std::string& name ) :
|
||||
@@ -117,7 +115,7 @@ void cShaderProgram::RemoveFromManager() {
|
||||
}
|
||||
|
||||
void cShaderProgram::Init() {
|
||||
if ( cGL::instance()->ShadersSupported() && 0 == Handler() ) {
|
||||
if ( GLi->ShadersSupported() && 0 == Handler() ) {
|
||||
mHandler = glCreateProgram();
|
||||
mValid = false;
|
||||
mUniformLocations.clear();
|
||||
@@ -258,6 +256,21 @@ bool cShaderProgram::SetUniform( const std::string& Name, Int32 Value ) {
|
||||
return ( Location >= 0 );
|
||||
}
|
||||
|
||||
bool SetUniformMatrix( const Int32& Id, const eeFloat * Value ) {
|
||||
glUniformMatrix4fv( Id, 1, false, Value );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cShaderProgram::SetUniformMatrix( const std::string Name, const eeFloat * Value ) {
|
||||
Int32 Location = UniformLocation( Name );
|
||||
|
||||
if ( Location >= 0 )
|
||||
glUniformMatrix4fv( Location, 1, false, Value );
|
||||
|
||||
return ( Location >= 0 );
|
||||
}
|
||||
|
||||
const std::string& cShaderProgram::Name() const {
|
||||
return mName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user