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:
spartanj
2011-01-18 04:43:40 -03:00
parent ddb5dc1948
commit 2cc55ea68a
44 changed files with 884 additions and 481 deletions

View File

@@ -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;
}