public void Dispose() { if (mTexCoordVertexBuffer != null) { mTexCoordVertexBuffer.Dispose(); mTexCoordVertexBuffer = null; } if (mPositionVertexBuffer != null) { mPositionVertexBuffer.Dispose(); mPositionVertexBuffer = null; } if (mInputLayout != null) { mInputLayout.Dispose(); mInputLayout = null; } if (mEffect != null) { mEffect.Dispose(); mEffect = null; } //if ( mTinyTextContext != null ) //{ // mTinyTextContext.Dispose(); // mTinyTextContext = null; //} if (mTileManager != null) { mTileManager.Dispose(); mTileManager = null; } if (mDebugRenderer != null) { mDebugRenderer.Dispose(); mDebugRenderer = null; } }
public MergeSegmentationRenderingStrategy(SlimDX.Direct3D11.Device device, DeviceContext deviceContext, TileManager tileManager) { mTileManager = tileManager; mDebugRenderer = new DebugRenderer(device); mEffect = EffectUtil.CompileEffect(device, @"Shaders\MergeRenderer2D.fx"); var positionTexcoordInputElements = new[] { new InputElement("POSITION", 0, POSITION_FORMAT, POSITION_SLOT), new InputElement("TEXCOORD", 0, TEXCOORD_FORMAT, TEXCOORD_SLOT) }; EffectTechnique effectTechnique = mEffect.GetTechniqueByName("TileManager2D"); mPass = effectTechnique.GetPassByName("TileManager2D"); mInputLayout = new InputLayout(device, mPass.Description.Signature, positionTexcoordInputElements); mPositionVertexBuffer = new Buffer(device, null, QUAD_NUM_VERTICES * POSITION_NUM_COMPONENTS_PER_VERTEX * POSITION_NUM_BYTES_PER_COMPONENT, ResourceUsage.Dynamic, BindFlags.VertexBuffer, CpuAccessFlags.Write, ResourceOptionFlags.None, 0); mTexCoordVertexBuffer = new Buffer(device, null, QUAD_NUM_VERTICES * TEXCOORD_NUM_COMPONENTS_PER_VERTEX * TEXCOORD_NUM_BYTES_PER_COMPONENT, ResourceUsage.Dynamic, BindFlags.VertexBuffer, CpuAccessFlags.Write, ResourceOptionFlags.None, 0); //bool result; //mTinyTextContext = new Context( device, deviceContext, Constants.MAX_NUM_TINY_TEXT_CHARACTERS, out result ); //Release.Assert( result ); mStopwatch.Start(); }
public AdjustSegmentationRenderingStrategy( SlimDX.Direct3D11.Device device, DeviceContext deviceContext, TileManager tileManager ) { mTileManager = tileManager; mDebugRenderer = new DebugRenderer( device ); mEffect = EffectUtil.CompileEffect( device, @"Shaders\AdjustRenderer2D.fx" ); var positionTexcoordInputElements = new[] { new InputElement( "POSITION", 0, POSITION_FORMAT, POSITION_SLOT ), new InputElement( "TEXCOORD", 0, TEXCOORD_FORMAT, TEXCOORD_SLOT ) }; EffectTechnique effectTechnique = mEffect.GetTechniqueByName( "TileManager2D" ); mPass = effectTechnique.GetPassByName( "TileManager2D" ); mInputLayout = new InputLayout( device, mPass.Description.Signature, positionTexcoordInputElements ); mPositionVertexBuffer = new Buffer( device, null, QUAD_NUM_VERTICES * POSITION_NUM_COMPONENTS_PER_VERTEX * POSITION_NUM_BYTES_PER_COMPONENT, ResourceUsage.Dynamic, BindFlags.VertexBuffer, CpuAccessFlags.Write, ResourceOptionFlags.None, 0 ); mTexCoordVertexBuffer = new Buffer( device, null, QUAD_NUM_VERTICES * TEXCOORD_NUM_COMPONENTS_PER_VERTEX * TEXCOORD_NUM_BYTES_PER_COMPONENT, ResourceUsage.Dynamic, BindFlags.VertexBuffer, CpuAccessFlags.Write, ResourceOptionFlags.None, 0 ); //bool result; //mTinyTextContext = new Context( device, deviceContext, Constants.MAX_NUM_TINY_TEXT_CHARACTERS, out result ); //Release.Assert( result ); mStopwatch.Start(); }
public void Dispose() { if ( mTexCoordVertexBuffer != null ) { mTexCoordVertexBuffer.Dispose(); mTexCoordVertexBuffer = null; } if ( mPositionVertexBuffer != null ) { mPositionVertexBuffer.Dispose(); mPositionVertexBuffer = null; } if ( mInputLayout != null ) { mInputLayout.Dispose(); mInputLayout = null; } if ( mEffect != null ) { mEffect.Dispose(); mEffect = null; } //if ( mTinyTextContext != null ) //{ // mTinyTextContext.Dispose(); // mTinyTextContext = null; //} if ( mTileManager != null ) { mTileManager.Dispose(); mTileManager = null; } if ( mDebugRenderer != null ) { mDebugRenderer.Dispose(); mDebugRenderer = null; } }