protected override void Dispose(bool disposeManaged) { if (disposeManaged) { if (indexBuffer != null) { indexBuffer.Dispose(); indexBuffer = null; } if (vertexBuffer != null) { vertexBuffer.Dispose(); vertexBuffer = null; } if (vertexDecl != null) { vertexDecl.Dispose(); vertexDecl = null; } if (pgrps != null) { pgrps.ForEach(x => x.Dispose()); pgrps = null; } } }
public void Dispose() { vbuffer.Dispose(); ibuffer.Dispose(); declaration.Dispose(); effect.Dispose(); }
/// <summary> /// Frees resources used by this object. /// </summary> protected virtual void Dispose(bool disposing) { if (disposing) { if (vertexDeclaration != null) { vertexDeclaration.Dispose(); } if (vertexBuffer != null) { vertexBuffer.Dispose(); } if (indexBuffer != null) { indexBuffer.Dispose(); } if (basicEffect != null) { basicEffect.Dispose(); } if (basicEffectShadow != null) { basicEffectShadow.Dispose(); } } }
protected virtual void Dispose(bool disposing) { if (disposing == true && isDisposed == false) { if (Disposing != null) { Disposing(this, EventArgs.Empty); } if (vertexDeclaration != null) { vertexDeclaration.Dispose(); } if (vertexShader != null) { vertexShader.Dispose(); } if (pixelShader != null) { pixelShader.Dispose(); } if (vertexBuffer != null) { vertexBuffer.Dispose(); } if (indexBuffer != null) { indexBuffer.Dispose(); } isDisposed = true; } }
/// <summary> /// Frees resources used by this object. /// </summary> public void Dispose() { if (vertexDeclaration != null) { vertexDeclaration.Dispose(); } if (vertexBuffer != null) { vertexBuffer.Dispose(); } if (indexBuffer != null) { indexBuffer.Dispose(); } if (basicEffect != null) { basicEffect.Dispose(); } if (basicEffectShadow != null) { basicEffectShadow.Dispose(); } }
static Circle() { VertexBuffer = new VertexBuffer(Render.Device, Utilities.SizeOf <Vector4>() * 3, Usage.WriteOnly, VertexFormat.None, Pool.Managed); using (var ds = VertexBuffer.Lock(0, 0, LockFlags.None)) { ds.WriteRange(new[] { new Vector4(-Radius, 0f, -Radius, 1.0f), new Vector4(0f, 0f, Radius, 1.0f), new Vector4(Radius, 0f, -Radius, 1.0f) }); } VertexBuffer.Unlock(); var vertexElements = new[] { new VertexElement(0, 0, DeclarationType.Float4, DeclarationMethod.Default, DeclarationUsage.Position, 0), VertexElement.VertexDeclarationEnd }; VertexDeclaration = new VertexDeclaration(Render.Device, vertexElements); Effect = Effect.FromMemory(Render.Device, Resources.RenderEffectCompiled, ShaderFlags.None); EffectHandle = Effect.GetTechnique(0); Render.OnLostDevice += Effect.OnLostDevice; Render.OnResetDevice += Effect.OnResetDevice; Render.OnDispose += () => { Effect.Dispose(); EffectHandle.Dispose(); VertexBuffer.Dispose(); VertexDeclaration.Dispose(); }; }
protected override void Dispose(bool disposing) { if (this.vertexBuffer != null) { this.vertexBuffer.Dispose(); this.vertexBuffer = null; } if (this.indexBuffer != null) { this.indexBuffer.Dispose(); this.indexBuffer = null; } if (vertexDeclaration != null) { vertexDeclaration.Dispose(); vertexDeclaration = null; } if (basicEffect != null) { basicEffect.Dispose(); basicEffect = null; } base.Dispose(disposing); }
void DisposeReferences() { if (Device != null) { if (state_old != null) { state_old.Dispose(); } if (vb_cube != null) { vb_cube.Dispose(); } if (vert_decl_nocolor != null) { vert_decl_nocolor.Dispose(); } foreach (var font in fontCache) { font.Value.Dispose(); } Device.Dispose(); Device = null; vert_decl_nocolor = null; vb_cube = null; state_old = null; fontCache.Clear(); } }
/// <summary> /// Frees resources used by this object. /// </summary> protected virtual void Dispose(bool disposing) { if (disposing) { if (vertexDeclaration != null) { vertexDeclaration.Dispose(); } if (vertexBuffer != null) { vertexBuffer.Dispose(); } if (indexBuffer != null) { indexBuffer.Dispose(); } if (shader != null) { shader.Dispose(); } } }
/// <summary> /// Unload content /// </summary> public void UnloadContent() { // unload effect and parameters effectTexture = null; effectFrameOffset = null; effectFrameSize = null; effectFrameBlend = null; effectViewProjection = null; effectTechnique = null; effect = null; // unload vertex buffer and declaration if (vertexBuffer[0] != null) { vertexBuffer[0].Dispose(); vertexBuffer[0] = null; } if (vertexBuffer[1] != null) { vertexBuffer[1].Dispose(); vertexBuffer[1] = null; } if (vertexDeclaration != null) { vertexDeclaration.Dispose(); vertexDeclaration = null; } }
protected override void unload() { if (vtxBuffer != null) { vtxBuffer.Dispose(); vtxBuffer = null; } if (idxBuffer != null) { for (int i = 0; i < idxBuffer.Length; i++) { if (idxBuffer[i] != null && !idxBuffer[i].Disposed) { idxBuffer[i].Dispose(); } } idxBuffer = null; } if (vtxDecl != null) { vtxDecl.Dispose(); vtxDecl = null; } }
public void Dispose() { if (_isDisposed) { return; } _isDisposed = true; if (_effect != null) { _effect.Dispose(); _effect = null; } if (_buffer != null) { _buffer.Dispose(); _buffer = null; } if (_vertexDecl != null) { _vertexDecl.Dispose(); _vertexDecl = null; } ClearStarMaps(); }
/// <summary> /// Dispose /// </summary> /// <param name="disposing">Disposing</param> protected virtual void Dispose(bool disposing) { if (disposing) { decl.Dispose(); } }
public static void DisposeDeclaration() { if (_Declaration != null && !_Declaration.Disposed) { _Declaration.Dispose(); _Declaration = null; } }
/// <summary> /// Liberar recursos /// </summary> public void dispose() { texture.dispose(); particlesAlive = null; particlesDead = null; particles = null; vertexDeclaration.Dispose(); }
} // Load() #endregion #region Dispose /// <summary> /// Dispose /// </summary> public void Dispose() { if (decl != null) { decl.Dispose(); } decl = null; } // Dispose()
public void Dispose() { if (initialized) { vertexBuffer.Dispose(); indexBuffer.Dispose(); vertexDeclaration.Dispose(); } }
public virtual void Dispose() { if (vertexBuffer == null) { return; } vertexBuffer.Dispose(); vertexDecl.Dispose(); }
public override void Dispose() { disposeChilderen(); if (layout != null) { layout.Dispose(); layout = null; } base.Dispose(); }
public override void close() { vertexBuffer.Dispose(); indexBuffer.Dispose(); effect.Dispose(); vertexDeclaration.Dispose(); texture0.Dispose(); texture1.Dispose(); texture2.Dispose(); }
protected override void UnloadGraphicsContent(bool unloadAllContent) { base.UnloadGraphicsContent(unloadAllContent); if (unloadAllContent) { vertexDecl.Dispose(); vertexDecl = null; } }
private void ExtendVertexDeclaration(VertexElement[] extraElements) { _vertexDeclaration.Dispose(); int length = originalVertexDeclaration.Length + extraElements.Length; VertexElement[] elements = new VertexElement[length]; originalVertexDeclaration.CopyTo(elements, 0); extraElements.CopyTo(elements, originalVertexDeclaration.Length); _vertexDeclaration = new VertexDeclaration(game.GraphicsDevice, elements); }
public virtual void Uninitialize() { _vertexBuffer.Dispose(); _vertexBuffer = null; vertexDeclaration.Dispose(); vertexDeclaration = null; _basicEffect.Dispose(); _basicEffect = null; }
private void Unitialize() { _vertexBuffer.Dispose(); _vertexBuffer = null; vertexDeclaration.Dispose(); vertexDeclaration = null; _basicEffect.Dispose(); _basicEffect = null; }
/// <summary> /// Clear all stored data for this drawTerrain, getting rid of all textures and other loaded things. /// </summary> public void Clear() { vertexDeclaration?.Dispose(); textureManager?.Dispose(); loadedTerrainTiles.Clear(); terrainTiles.Clear(); vertexDeclaration = new VertexDeclaration(device, VertexPositionTexture.VertexElements); textureManager = new TerrainTextureManager(terrtexPath, device, messageDelegate); SetTerrainReduction(); DiscardVertexBuffers(); }
public void Dispose() { for (int i = 0; i < meshFrames.Count; i++) { MeshContainer mesh = meshFrames[i].MeshContainer; while (mesh != null) { if ((mesh.MeshData != null) && (mesh.MeshData.Mesh != null)) { mesh.MeshData.Mesh.Dispose(); } if (mesh is MorphMeshContainer) { MorphMeshContainer morphMesh = (MorphMeshContainer)mesh; if (morphMesh.StartBuffer != morphMesh.EndBuffer) { morphMesh.StartBuffer.Dispose(); } if (morphMesh.EndBuffer != null) { morphMesh.EndBuffer.Dispose(); } if (morphMesh.CommonBuffer != null) { morphMesh.CommonBuffer.Dispose(); } if (morphMesh.IndexBuffer != null) { morphMesh.IndexBuffer.Dispose(); } } for (int j = 0; j < Textures.Length; j++) { Texture tex = Textures[j]; if ((tex != null) && !tex.Disposed) { tex.Dispose(); } } mesh = mesh.NextMeshContainer; } } rootFrame.Dispose(); AnimationController.Dispose(); tweeningVertDec.Dispose(); IsDisposed = true; }
/// <summary> /// Libera los recursos de la malla. /// Si la malla es una instancia se deshabilita pero no se liberan recursos. /// Si la malla es el original y tiene varias instancias adjuntadas, se hace dispose() también de las instancias. /// </summary> public void dispose() { this.enabled = false; if (boundingBox != null) { boundingBox.dispose(); } //Si es una instancia no liberar nada, lo hace el original. if (parentInstance != null) { parentInstance = null; return; } //hacer dispose de instancias if (meshInstances != null) { foreach (TgcMesh meshInstance in meshInstances) { meshInstance.dispose(); } meshInstances = null; } //Dispose de mesh this.d3dMesh.Dispose(); this.d3dMesh = null; //Dispose de texturas if (diffuseMaps != null) { for (int i = 0; i < diffuseMaps.Length; i++) { if (diffuseMaps[i] != null) { diffuseMaps[i].dispose(); } } diffuseMaps = null; } if (lightMap != null) { lightMap.dispose(); lightMap = null; } //VertexDeclaration vertexDeclaration.Dispose(); vertexDeclaration = null; }
/// <summary> /// Disposes of the object, cleanly releasing graphics resources. /// </summary> public void Dispose() { if (effect != null) { effect.Dispose(); effect = null; } if (vertexDeclaration != null) { vertexDeclaration.Dispose(); vertexDeclaration = null; } }
public void Dispose() { if (_Buffer != null) { _Buffer.Dispose(); _Buffer = null; } if (_Decl != null) { _Decl.Dispose(); _Decl = null; } }
protected virtual void Dispose(bool all) { if (vDecl != null) { vDecl.Dispose(); vDecl = null; } if (vBuffer != null) { vBuffer.Dispose(); vBuffer = null; } }