Esempio n. 1
0
        public SDX_VertexBuffer(SDX_Display display, VertexLayout layout, int vertexCount)
        {
            mDisplay = display;
            mCount   = vertexCount;

            mDeclaration = CreateVertexDeclaration(mDisplay.D3D_Device.Device, layout);
            Direct3D.VertexFormat mFormats = CreateVertexFormat(layout);

            mLayout = layout;

            mBuffer = new SlimDX.Direct3D9.VertexBuffer(
                mDisplay.D3D_Device.Device,
                vertexCount * layout.VertexSize,
                SlimDX.Direct3D9.Usage.WriteOnly,
                mFormats,
                Direct3D.Pool.Managed);
        }
Esempio n. 2
0
		protected override void dispose( bool disposeManagedResources )
		{
			if ( !this.IsDisposed )
			{
				if ( disposeManagedResources )
				{
					// Dispose managed resources.
                    if (d3dVertexDecl != null)
                    {
                        if (!d3dVertexDecl.Disposed)
                            d3dVertexDecl.Dispose();

                        d3dVertexDecl = null;
                    }
				}

				// There are no unmanaged resources to release, but
				// if we add them, they need to be released here.
			}

			// If it is available, make the call to the
			// base class's Dispose(Boolean) method
			base.dispose( disposeManagedResources );
		}