void elem_OnLoadComplete(DX11FileTexturePoolElement element) { if (this.OnElementLoaded != null) { this.OnElementLoaded(this, new EventArgs()); } }
public bool TryGetFile(DX11RenderContext context, string path, bool domips, bool async, out DX11Texture2D texture) { lock (m_lock) { foreach (DX11FileTexturePoolElement element in this.pool) { if (element.DoMips == domips && element.FileName == path) { if (element.Status == eDX11SheduleTaskStatus.Completed) { element.IncrementCounter(); texture = element.Texture; return(true); } else { element.IncrementCounter(); texture = null; return(false); } } } } DX11FileTexturePoolElement elem = new DX11FileTexturePoolElement(context, path, domips, async); elem.OnLoadComplete += elem_OnLoadComplete; lock (m_lock) { if (elem.Status != eDX11SheduleTaskStatus.Error) { this.pool.Add(elem); if (elem.Status == eDX11SheduleTaskStatus.Completed) { texture = elem.Texture; return(true); } else { texture = null; return(false); } } else { texture = null; return(false); } } }
public bool TryGetFile(DX11RenderContext context, string path, bool domips,bool async, out DX11Texture2D texture) { lock (m_lock) { foreach (DX11FileTexturePoolElement element in this.pool) { if (element.DoMips == domips && element.FileName == path) { if (element.Status == eDX11SheduleTaskStatus.Completed) { element.IncrementCounter(); texture = element.Texture; return true; } else { element.IncrementCounter(); texture = null; return false; } } } } DX11FileTexturePoolElement elem = new DX11FileTexturePoolElement(context, path, domips,async); elem.OnLoadComplete += elem_OnLoadComplete; lock (m_lock) { if (elem.Status != eDX11SheduleTaskStatus.Error) { this.pool.Add(elem); if (elem.Status == eDX11SheduleTaskStatus.Completed) { texture = elem.Texture; return true; } else { texture = null; return false; } } else { texture = null; return false; } } }
void elem_OnLoadComplete(DX11FileTexturePoolElement element) { if (this.OnElementLoaded != null) { this.OnElementLoaded(this, new EventArgs()); } }