protected override void LoadFromSource()
{
// generate a new display list
Gl.glNewList( programId, Gl.GL_COMPILE );
int pos = Source.IndexOf( "!!" );
while ( pos != -1 && pos != Source.Length )
{
int newPos = Source.IndexOf( "!!", pos + 1 );
if ( newPos == -1 )
{
newPos = Source.Length;
}
string script = Source.Substring( pos, newPos - pos );
nvparse( script );
string error = nvparse_get_errors();
if ( error != null && error.Length > 0 )
{
LogManager.Instance.Write( "nvparse error: {0}", error );
}
pos = newPos;
}
// ends the declaration of this display list
Gl.glEndList();
}