public override HardwareVertexBuffer CreateVertexBuffer(VertexDeclaration vertexDeclaration, int numVerts,
                                                                BufferUsage usage, bool useShadowBuffer)
        {
            Contract.Requires(numVerts > 0);

#if AXIOM_D3D_MANAGE_BUFFERS
            // Override shadow buffer setting; managed buffers are automatically
            // backed by system memory
            // Don't override shadow buffer if discardable, since then we use
            // unmanaged buffers for speed (avoids write-through overhead)
            if (useShadowBuffer && (usage & BufferUsage.Discardable) == 0)
            {
                useShadowBuffer = false;
                // Also drop any WRITE_ONLY so we can read direct
                if (usage == BufferUsage.DynamicWriteOnly)
                {
                    usage = BufferUsage.Dynamic;
                }

                else if (usage == BufferUsage.StaticWriteOnly)
                {
                    usage = BufferUsage.Static;
                }
            }
#endif
            var vbuf = new D3D9HardwareVertexBuffer(this, vertexDeclaration, numVerts, usage, false, useShadowBuffer);
            lock ( VertexBuffersMutex )
            {
                vertexBuffers.Add(vbuf);
            }

            return(vbuf);
        }
		public override HardwareVertexBuffer CreateVertexBuffer( VertexDeclaration vertexDeclaration, int numVerts,
		                                                         BufferUsage usage, bool useShadowBuffer )
		{
			Contract.Requires( numVerts > 0 );

#if AXIOM_D3D_MANAGE_BUFFERS
			// Override shadow buffer setting; managed buffers are automatically
			// backed by system memory
			// Don't override shadow buffer if discardable, since then we use
			// unmanaged buffers for speed (avoids write-through overhead)
			if ( useShadowBuffer && ( usage & BufferUsage.Discardable ) == 0 )
			{
				useShadowBuffer = false;
				// Also drop any WRITE_ONLY so we can read direct
				if ( usage == BufferUsage.DynamicWriteOnly )
				{
					usage = BufferUsage.Dynamic;
				}

				else if ( usage == BufferUsage.StaticWriteOnly )
				{
					usage = BufferUsage.Static;
				}
			}
#endif
			var vbuf = new D3D9HardwareVertexBuffer( this, vertexDeclaration, numVerts, usage, false, useShadowBuffer );
			lock ( VertexBuffersMutex )
			{
				vertexBuffers.Add( vbuf );
			}

			return vbuf;
		}