天行健 君子当自强而不息

D3D Animation Basis(10)

The remaining two draw_meshes functions duplicate the exact features of the first two, except that all meshes in the linked list of mesh objects are rendered.


HRESULT draw_meshes(D3DXMESHCONTAINER_EX* mesh_container)
{
    D3DXMESHCONTAINER_EX
* container_ptr = mesh_container;

    
// loop through all meshes in list
    while(container_ptr)
    {
        HRESULT hr 
= draw_mesh(container_ptr);

        
if(FAILED(hr))
            
return hr;

        container_ptr 
= (D3DXMESHCONTAINER_EX*) container_ptr->pNextMeshContainer;
    }

    
return S_OK;
}

HRESULT draw_meshes(D3DXMESHCONTAINER_EX
* mesh_container,
                    IDirect3DVertexShader9
* vertex_shader,
                    IDirect3DVertexDeclaration9
* vertex_decl)
{
    D3DXMESHCONTAINER_EX
* container_ptr = mesh_container;

    
// loop through all meshes in list
    while(container_ptr)
    {
        HRESULT hr 
= draw_mesh(container_ptr, vertex_shader, vertex_decl);

        
if(FAILED(hr))
            
return hr;

        container_ptr 
= (D3DXMESHCONTAINER_EX*) container_ptr->pNextMeshContainer;
    }

    
return S_OK;
}

posted on 2008-04-15 13:26 lovedday 阅读(257) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


公告

导航

统计

常用链接

随笔分类(178)

3D游戏编程相关链接

搜索

最新评论