public void loadFromDisk(string filename, ShaderManagerCallbackType callback) { mFilename = filename; mCallbackFunction = callback; loadInternalFromDisk(filename); }
public void loadFromString(string shaderFile, ShaderManagerCallbackType callback) { mFilename = "loadedFromString"; mCallbackFunction = callback; loadInternalFromString(shaderFile); }
//--------------------------------------------- //--------------------------------------------- //CLM call this if you want a Shader to be watched, but not loaded (useful for volume Shaders & Shader arrays) public WatchedShaderHandle addWatchedShader(string filename, ShaderManagerCallbackType callback) { for (int i = 0; i < mWatchedShaders.Count; i++) { if (mWatchedShaders[i].mFilename == filename) { return(mWatchedShaders[i]); //we've already got it in the list } } WatchedShaderHandle handle = new WatchedShaderHandle(); handle.mFilename = filename; handle.mCallbackFunction = callback; mWatchedShaders.Add(handle); return(mWatchedShaders[mWatchedShaders.Count - 1]); }
public ShaderHandle getShader(string filename, ShaderManagerCallbackType callback) { int index = giveLoadedShaderIndex(filename); if (index != -1) { return(mShaderHandles[index]); } //Shader not found... ShaderHandle handle = new ShaderHandle(); if (!File.Exists(filename)) { MessageBox.Show(filename + " Not found"); return(null); } handle.loadFromDisk(filename, callback); mShaderHandles.Add(handle); return(mShaderHandles[mShaderHandles.Count - 1]); }