网站大量收购闲置独家精品文档,联系QQ:2885784924

x文件格式渲染(X file format rendering).doc

  1. 1、本文档共30页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
x文件格式渲染(X file format rendering).doc

x文件格式渲染(X file format rendering) Converted to.X format, in use, not finished What an example of the big tiger, what a scary cloth tiger! Oh, I help you to read the book first, this is parsing.X files, and display examples /************************************************** WinMain.cpp Chapter 2, XFile/Skinned, Mesh, Demo Programming, Role-Playing, Games, with, DirectX, 2nd, Edition By Jim Adams (Jan 2004) Required libraries: WINMM.LIB, D3D9.LIB, D3DX9.LIB, and, DXGUID.LIB **************************************************/ To release COM objects / / Macro #define, ReleaseCOM (x), if (x), {x-Release (); X = NULL;} Include / / files #include windows.h #include stdio.h #include d3d9.h #include d3dx9.h #include dxfile.h #include rmxfguid.h #include rmxftmpl.h Class and / / Window handles, caption text HWND g_hWnd; HINSTANCE g_hInst; Static char g_szClass[] = XFileClass; Static char g_szCaption[] = XFile Demo by Jim Adams; Direct3D and Device object / / The IDirect3D9 *g_pD3D = NULL; IDirect3DDevice9 *g_pD3DDevice = NULL; Mesh definition structure / / A Typedef struct sMesh { Char *m_Name; / / Name of mesh ID3DXMesh *m_Mesh; / / Mesh object ID3DXMesh *m_SkinMesh; / / Skin mesh object ID3DXSkinInfo *m_SkinInfo; / / Skin info DWORD m_NumMaterials materials in mesh; / / # D3DMATERIAL9 *m_Materials; / / Array of materials IDirect3DTexture9 **m_Textures; / / Array of textures SMesh *m_Next mesh in list; / / Next SMesh () { M_Name = NULL; / / Clear all structure data M_Mesh = NULL; M_SkinMesh = NULL; M_SkinInfo = NULL; M_NumMaterials = 0; M_Materials = NULL; M_Textures = NULL; M_Next = NULL; } ~sMesh () { All used resources / / Free Delete [] m_Name; m_Name = NULL; ReleaseCOM (m_Mesh); ReleaseCOM (m_SkinMesh); ReleaseCOM (m_SkinInfo); Delete [] m_Materials; m_Materials = NULL; If (m_Textures = = NULL) { For (DWORD i=0; im_NumMaterials; i++) ReleaseCOM (m_Textures[i]); Delete [] m_Textures; m_Textures = NULL; } Delete m_Next; m_Next = NULL; / / Delete next mesh in list } } sMes

您可能关注的文档

文档评论(0)

czy2014 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档