private ITextureHandle RegisterNewTexture(Texture texture) { // Configure newly created TextureHandle to reflect Texture's properties on GPU (allocate buffers) ITextureHandle textureHandle = _renderContextImp.CreateTexture(texture); // Setup handler to observe changes of the texture data and dispose event (deallocation) texture.TextureChanged += TextureChanged; _identifierToTextureHandleDictionary.Add(texture.SessionUniqueIdentifier, textureHandle); return(textureHandle); }
/// <summary> /// Call this method on the main thread after RenderContext.Render in order to cleanup all not used Buffers from GPU memory. /// </summary> public void Cleanup() { if (_toBeDeletedTextureHandles == null || _toBeDeletedTextureHandles.Count == 0) { return; } while (_toBeDeletedTextureHandles.Count > 0) { ITextureHandle tobeDeletedTextureHandle = _toBeDeletedTextureHandles.Pop(); Remove(tobeDeletedTextureHandle); } }
private void Remove(ITextureHandle textureHandle) { _renderContextImp.RemoveTextureHandle(textureHandle); }
public void SetCubeMapRenderTarget(ITextureHandle texture, int position) { throw new NotImplementedException(); }
public void SetShaderParamTexture(IShaderParam param, ITextureHandle texId) { throw new System.NotImplementedException(); }
public void GetBufferContent(Rectangle quad, ITextureHandle texId) { throw new System.NotImplementedException(); }
public void SetRenderTarget(ITextureHandle texture) { throw new NotImplementedException(); }
public void CopyDepthBufferFromDeferredBuffer(ITextureHandle texture) { throw new NotImplementedException(); }
public void RemoveTextureHandle(ITextureHandle textureHandle) { throw new NotImplementedException(); }
public void UpdateTextureRegion(ITextureHandle tex, ITexture img, int startX, int startY, int width, int height) { throw new System.NotImplementedException(); }
public void UpdateTextureFromVideoStream(IVideoStreamImp stream, ITextureHandle tex) { throw new System.NotImplementedException(); }
public void SetShaderParamTexture(IShaderParam param, ITextureHandle texId, GBufferHandle gHandle) { throw new NotImplementedException(); }