public void Dispose() { RocketInterface.Instance.TextureLoaded -= renderOnNextFrame; if (RocketWidgetDisposing != null) { RocketWidgetDisposing.Invoke(this); } RocketWidgetManager.rocketWidgetDisposed(name); imageBox.MouseButtonPressed -= imageBox_MouseButtonPressed; imageBox.MouseButtonReleased -= imageBox_MouseButtonReleased; imageBox.MouseMove -= imageBox_MouseMove; imageBox.MouseDrag -= imageBox_MouseMove; imageBox.MouseWheel -= imageBox_MouseWheel; imageBox.KeyButtonPressed -= imageBox_KeyButtonPressed; imageBox.KeyButtonReleased -= imageBox_KeyButtonReleased; imageBox.EventScrollGesture -= imageBox_EventScrollGesture; //In mygui lost/got focus is mouse entered / left imageBox.MouseSetFocus -= imageBox_MouseSetFocus; imageBox.MouseLostFocus -= imageBox_MouseLostFocus; imageBox.RootKeyChangeFocus -= imageBox_RootKeyChangeFocus; if (context != null) { context.Dispose(); } if (vp != null) { renderTexture.destroyViewport(vp); } if (pixelBuffer != null) { pixelBuffer.Dispose(); } if (texture != null) { texture.Dispose(); RenderManager.Instance.destroyTexture(textureName); } if (camera != null) { sceneManager.destroyCamera(camera); } if (sceneManager != null) { Root.getSingleton().destroySceneManager(sceneManager); } }
public void Dispose() { Reset(); pixelBuffer.Dispose(); TextureManager.getInstance().remove(texture); texture.Dispose(); }
private bool queueBackgroundImageLoad(String source, IntPtr rocketTexture, ref Vector2i size) { try { //On main thread, load image info var streamPtr = OgreResourceGroupManager.getInstance().openResource(source, "Rocket.Common", true); int width, height; ImageUtility.ImageFormat format = ImageUtility.GetImageInfo(streamPtr.Value, out width, out height); size = new Vector2i(width, height); ThreadManager.RunInBackground(() => { //Process the image itself in a background thread Image image = new Image(); try { image.load(streamPtr.Value, format.ToString().ToLowerInvariant()); ThreadManager.invoke(() => { //Commit the texture to ogre and alert libRocket we are done loading, back in the main thread TexturePtr texture = null; try { texture = TextureManager.getInstance().loadImage(source, "Rocket.Common", image); } catch (OgreException) { } finally { RenderInterfaceOgre3D_finishTextureLoad(rocketTexture, texture != null ? texture.HeapSharedPtr : IntPtr.Zero); if (image != null) { image.Dispose(); } if (texture != null) { texture.Dispose(); } RocketInterface.Instance.fireTextureLoaded(); } }); } finally { if (streamPtr != null) { streamPtr.Dispose(); } } }); return(true); } catch (OgreException ex) { return(false); } }
public void Dispose() { renderTexture.Dispose(); renderTexture = null; pixelBuffer.Dispose(); TextureManager.getInstance().remove(texture); texture.Dispose(); fullBitmapBox.Dispose(); fullBitmap.Dispose(); }
private void destroyTexture() { if (physicalTexture != null) { buffer.Dispose(); TextureManager.getInstance().remove(physicalTexture); physicalTexture.Dispose(); physicalTexture = null; } }
private void destroyColorTexture() { if (colorTexture != null) { sensorManager.SensorColorFrameReady -= sensorManager_SensorColorFrameReady; setColorImageIcon(); //Because we set this to something with an actual texture, it will replace the texture set when created (that happens in the function called). RenderManager.Instance.destroyTexture(colorTexture.Value.getName()); pixelBox.Dispose(); hwBuffer.Dispose(); colorTexture.Dispose(); colorTexture = null; } }
public void Dispose() { Stream.GetFrameClose(); PixelBuffer.Dispose(); screen.Dispose(); videoMat.Dispose(); videoTex.Dispose(); videoTex = null; videoMat = null; screen = null; PixelBuffer = null; FrameNum = 0; }
public override void Dispose() { base.Dispose(); resourceLoader.Dispose(); if (pixelBuffer != null) { pixelBuffer.Dispose(); } if (texture != null) { TextureManager.getInstance().remove(texture); texture.Dispose(); } }
public void Dispose() { lock (pooledIds) { pooledIds.Add(id); //Return id to list of pooled ids. } TextureManager.getInstance().remove(indirectionTexture); indirectionTexture.Dispose(); for (int i = 0; i < highestMip; ++i) { pixelBox[i].Dispose(); buffer[i].Dispose(); fiBitmap[i].Dispose(); } }
protected void DisposeRenderTarget() { if (_renTarget != null) { CompositorManager.Singleton.RemoveCompositorChain(_viewport); _renTarget.RemoveAllListeners(); _renTarget.RemoveAllViewports(); _root.RenderSystem.DestroyRenderTarget(_renTarget.Name); _renTarget = null; _viewport = null; } if (_texture != null) { TextureManager.Singleton.Remove(_texture.Handle); _texture.Dispose(); _texture = null; } }
protected void DisposeRenderTarget() { if (_renTarget != null) { CompositorManager.getSingleton().removeCompositorChain(_viewport); _renTarget.removeAllListeners(); _renTarget.removeAllViewports(); _root.getRenderSystem().destroyRenderTarget(_renTarget.getName()); _renTarget = null; _viewport = null; } if (_texture != null) { TextureManager.getSingleton().remove(_texture.getHandle()); _texture.Dispose(); _texture = null; } }
public void Dispose() { TextureManager.getInstance().remove(testTexture); testTexture.Dispose(); textureLoader.Dispose(); opaqueFeedbackBuffer.Dispose(); transparentFeedbackBuffer.Dispose(); foreach (var physicalTexture in physicalTextures.Values) { physicalTexture.Dispose(); } //Dispose all new textures lock (newIndirectionTextures) { foreach (var newTex in newIndirectionTextures) { newTex.Dispose(); } } //Be sure to dispose all retired textures lock (retiredIndirectionTextures) { foreach (var indirectionTex in retiredIndirectionTextures) { indirectionTex.Dispose(); } } foreach (var indirectionTexture in indirectionTextures.Values) { indirectionTexture.Dispose(); } sharedFeedbackParameters.Dispose(); }