|
|
|
@ -11,6 +11,7 @@ namespace NL3D
|
|
|
|
|
if( !program )
|
|
|
|
|
{
|
|
|
|
|
_VertexProgramEnabled = false;
|
|
|
|
|
currentProgram = NULL;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -31,6 +32,7 @@ namespace NL3D
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
_VertexProgramEnabled = true;
|
|
|
|
|
currentProgram = program;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -51,6 +53,60 @@ namespace NL3D
|
|
|
|
|
return new CGLSLPixelProgram();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CDriverGL3::getUniformLocation( const char *name )
|
|
|
|
|
{
|
|
|
|
|
if( currentProgram == NULL )
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
return nglGetUniformLocation( currentProgram->getProgramId(), name );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform1f( uint index, float f )
|
|
|
|
|
{
|
|
|
|
|
nglUniform1f( index, f );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform4f( uint index, float f1, float f2, float f3, float f4 )
|
|
|
|
|
{
|
|
|
|
|
nglUniform4f( index, f1, f2, f3, f4 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform1i( uint index, int i )
|
|
|
|
|
{
|
|
|
|
|
nglUniform1i( index, i );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform4i( uint index, int i1, int i2, int i3, int i4 )
|
|
|
|
|
{
|
|
|
|
|
nglUniform4i( index, i1, i2, i3, i4 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform1u( uint index, uint u )
|
|
|
|
|
{
|
|
|
|
|
nglUniform1ui( index, u );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniform4u( uint index, uint u1, uint u2, uint u3, uint u4 )
|
|
|
|
|
{
|
|
|
|
|
nglUniform4ui( index, u1, u2, u3, u4 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniformMatrix2fv( uint index, uint count, bool transpose, const float *values )
|
|
|
|
|
{
|
|
|
|
|
nglUniformMatrix2fv( index, count, transpose, values );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniformMatrix3fv( uint index, uint count, bool transpose, const float *values )
|
|
|
|
|
{
|
|
|
|
|
nglUniformMatrix3fv( index, count, transpose, values );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDriverGL3::setUniformMatrix4fv( uint index, uint count, bool transpose, const float *values )
|
|
|
|
|
{
|
|
|
|
|
nglUniformMatrix4fv( index, count, transpose, values );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CDriverGL3::renderRawTriangles2( CMaterial &mat, uint32 startIndex, uint32 numTris )
|
|
|
|
|
{
|
|
|
|
|
glDrawArrays( GL_TRIANGLES, startIndex * 3, numTris * 3 );
|
|
|
|
|