public void UseRL(ProgramRL program) { int blockIndex = program.UniformBlocks[data.UniformBlock.Name]; RL.UniformBlockBuffer(blockIndex, bufferRange.BufferRL.BufferObjectRL); /* \todo * RL.UniformBlockBuffer( * 0, * bufferRange.BufferRL.BufferObjectRL * ); * */ }
public static void Pop() { var program = programStack.Pop(); if (program != currentProgram) { if (program != null) { program.Use(0); } } currentProgram = program; }
public void Use(int baseInstance) { if (Valid) { RL.UseProgram(ProgramObject); #if DEBUG_PROGRAM Trace.WriteLine("Program.Use " + this.Name + " object " + ProgramObject); #endif } else { throw new Exception(); } currentProgram = this; }
public static ProgramRL Load(string filename) { #if !DEBUG try #endif { var program = new ProgramRL(); string fullpath = Configuration.ProgramSearchPathRL + filename; if (System.IO.File.Exists(filename)) { fullpath = filename; } //#if DEBUG_PROGRAM Trace.WriteLine("Loading program " + fullpath); //#endif program.Name = fullpath; program.LoadFromFiles( fullpath + ".rs", fullpath + ".vs", fullpath + ".fs" ); return(program); } #if !DEBUG catch (System.Exception e) { Trace.TraceError("ProgramRL.Load(" + filename + ") failed - exception " + e.ToString()); if (Configuration.throwProgramExceptions) { throw; } return(null); } #endif }