• 大小: 4.17MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-17
  • 语言: 其他
  • 标签:

资源简介

基于directx的程序示例,可以对坦克进行移动,开火,沿地形移动。

资源截图

代码片段和文件信息

#include“blast.h“
int  iCurTex=0;
blast::blast(IDirect3DDevice9*  g_pd3dDevice)
{
this->g_pd3dDevice=g_pd3dDevice;
this->g_pVB       =NULL       ;
for(int i=0;i<25;i++)
this->g_pTex[i]  =NULL      ;
}
blast::Initblast()
{
    g_pd3dDevice->CreateVertexBuffer( 4*sizeof(CUSTOMVERTEX2)
                                              0 D3DFVF_CUSTOMVERTEX2
                                              D3DPOOL_MANAGED &g_pVB NULL );

    CUSTOMVERTEX2 vertices[] =
    {
{ -100-100 0   0.0f 1.0f }
        { -100 100 0   0.0f 0.0f }
        {  100 -100 0   1.0f 1.0f } 
{  100 1000   1.0f 0.0f }

    };

    VOID* pVertices;
    if( FAILED( g_pVB->Lock( 0 sizeof(vertices) (void**)&pVertices 0 ) ) )
        return E_FAIL;
    memcpy( pVertices vertices sizeof(vertices) );
g_pVB->Unlock();
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode00.dds“ &g_pTex[0] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode01.dds“ &g_pTex[1] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode02.dds“ &g_pTex[2] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode03.dds“ &g_pTex[3] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode04.dds“ &g_pTex[4] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode05.dds“ &g_pTex[5] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode06.dds“ &g_pTex[6] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode07.dds“ &g_pTex[7] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode08.dds“ &g_pTex[8] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode09.dds“ &g_pTex[9] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode10.dds“ &g_pTex[10] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode11.dds“ &g_pTex[11] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode12.dds“ &g_pTex[12] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode13.dds“ &g_pTex[13] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode14.dds“ &g_pTex[14] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode15.dds“ &g_pTex[15] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode16.dds“ &g_pTex[16] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode17.dds“ &g_pTex[17] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode18.dds“ &g_pTex[18] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode19.dds“ &g_pTex[19] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode20.dds“ &g_pTex[20] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode21.dds“ &g_pTex[21] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode22.dds“ &g_pTex[22] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode23.dds“ &g_pTex[23] );
 D3DXCreateTextureFromFile( g_pd3dDevice “Media\\explode24.dds“ &g_pTex[24] );
}
void blast::Renderblast(D3DXMATRIX& g_matFire)
{
g_pd3dDevice->SetTr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     750054  2008-10-18 23:54  Tank\BARK5.bmp

     文件       3715  2008-10-23 15:49  Tank\blast.cpp

     文件        559  2008-10-23 15:51  Tank\blast.h

     文件    7680056  2008-10-18 21:24  Tank\grass.bmp

     文件      14388  2008-10-26 10:02  Tank\grouble.h

     文件        175  2008-10-23 15:39  Tank\HEAD.h

     文件       3270  2008-10-24 09:01  Tank\HelpBound.h

     文件       1700  2008-10-23 16:52  Tank\InitMesh.h

     文件       1316  2008-10-23 16:59  Tank\light.h

     文件      23229  2008-10-21 08:51  Tank\Media\bullet.X

     文件     703670  2008-10-21 11:11  Tank\Media\DestroyTank.X

     文件      16512  2007-04-02 17:05  Tank\Media\explode00.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode01.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode02.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode03.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode04.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode05.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode06.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode07.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode08.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode09.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode10.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode11.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode12.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode13.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode14.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode15.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode16.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode17.dds

     文件      16512  2007-04-02 17:05  Tank\Media\explode18.dds

............此处省略40个文件信息

评论

共有 条评论

相关资源