Jump to content
  • Advertisement
Sign in to follow this  
DevLiquidKnight

Better way to draw .x files?

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Currently I render my .x file meshes with this. I was wondering if there is a more elegant way of doing so that may be better for high detail 3D models. Such as like drawing the index buffer and vertex buffer by looping rather then just drawing the subset's or am I way off?
		void RenderMesh(IDirect3DDevice9 *device)
		{
			if(NULL == m_pMesh)
			{
				return;
			}
			for(DWORD i=0; i<m_dwNumMaterials; i++)
			{
				// Setup texturing
				device->SetMaterial( &m_pMeshMaterials );
				if(m_pMeshTextures!=NULL)
				{
					device->SetTexture( 0, m_pMeshTextures );
				}
				m_pMesh->DrawSubset( i );
			}
			
			device->SetTexture( 0, NULL );	
		}

Share this post


Link to post
Share on other sites
Advertisement
I guess you had a mesh loaded that had was the same all over, you could extract the vertex and index buffers from it and render a DIP call.

ace

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!