public TextureHandle getTexture(string filename, TextureManagerCallbackType callback, int mipLevelToUse) { //filename = EditorCore.CoreGlobals.getWorkPaths().mBlankTextureName; int index = giveLoadedTextureIndex(filename); if (index != -1) { return(mTextureHandles[index]); } //texture not found... TextureHandle handle = new TextureHandle(); if (!File.Exists(filename)) { filename = EditorCore.CoreGlobals.getWorkPaths().mBlankTextureName; } handle.loadFromDisk(filename, callback, mipLevelToUse); mTextureHandles.Add(handle); return(mTextureHandles[mTextureHandles.Count - 1]); }
public void loadFromDisk(string filename, TextureManagerCallbackType callback) { mFilename = filename; mTexture = TextureLoader.FromFile(BRenderDevice.getDevice(), filename); mCallbackFunction = callback; //Debug.Print("TextureManager loaded: " + filename); }
public void loadFromDisk(string filename, TextureManagerCallbackType callback, int mipLevelToUse) { mMipLevelUsedFromFile = mipLevelToUse; mFilename = filename; loadAndGrabMip(filename, mipLevelToUse);// TextureLoader.FromFile(BRenderDevice.getDevice(), filename, 0, 0, 1, 0, 0, 0, Filter.Linear, Filter.Linear, 0);// .FromFile(BRenderDevice.getDevice(), filename); mCallbackFunction = callback; }
//--------------------------------------------- //CLM call this if you want a texture to be watched, but not loaded (useful for volume textures & texture arrays) public WatchedTextureHandle addWatchedTexture(string filename, TextureManagerCallbackType callback) { for (int i = 0; i < mWatchedTextures.Count; i++) { if (mWatchedTextures[i].mFilename == filename) { return(mWatchedTextures[i]); //we've already got it in the list } } WatchedTextureHandle handle = new WatchedTextureHandle(); handle.mFilename = filename; handle.mCallbackFunction = callback; mWatchedTextures.Add(handle); return(mWatchedTextures[mWatchedTextures.Count - 1]); }
public TextureHandle getTexture(string filename, TextureManagerCallbackType callback) { int index = giveLoadedTextureIndex(filename); if (index != -1) { return(mTextureHandles[index]); } //texture not found... TextureHandle handle = new TextureHandle(); if (!File.Exists(filename)) { return(null); } handle.loadFromDisk(filename, callback); mTextureHandles.Add(handle); return(mTextureHandles[mTextureHandles.Count - 1]); }
public TextureHandle getTexture(string filename, TextureManagerCallbackType callback) { return(getTexture(filename, callback, 0)); }
public void loadFromDisk(string filename, TextureManagerCallbackType callback) { loadFromDisk(filename, callback, 0); }