资源简介
directx 3D 坦克大战 源码
包括坦克模型 材质 声音 等
适合看过几遍书的人,并且需要进一步提高来 阅读的代码。
非常不错

代码片段和文件信息
#include “d3dbase.h“
#include “errorwindow.h“
#include “debugmsg.h“
cd3dbase::cd3dbase(HINSTANCE Instance int Windowstyle char *caption int dx int dy)
:cwindow(Instance Windowstyle caption dx dy)
{
cdebugmsg(DBG_HW DBGCMD_CLEAR);
cdebugmsg(DBG_HW “cd3dbase::cd3dbase()...“);
fsxres = dx;
fsyres = dy;
this->Windowstyle = Windowstyle;
/* if(Windowstyle == SW_SHOWMAXIMIZED)
fullscreen = true;
else*/
if(Windowstyle == SW_SHOWMAXIMIZED)
{
xres = fsxres;
yres = fsyres;
}
else
{
xres = clientdx;
yres = clientdy;
}
fullscreen = false;
cdebugmsg(DBG_HW “cd3dbase::cd3dbase(): calling initd3d()“);
initd3d();
}
cd3dbase::onmessage(int msg int wparam int lparam)
{
cwindow::onmessage(msg wparam lparam);
}
cd3dbase::onminimax(int Windowstyle)
{
cdebugmsg(DBG_HW “cd3dbase::onminimax()“);
bool oldfullscr = (this->Windowstyle == SW_SHOWMAXIMIZED);
bool newfullscr = (Windowstyle == SW_SHOWMAXIMIZED);
cdebugmsg(DBG_HW oldfullscr?“old mode: fullscreen“:“old mode: windowed“);
cdebugmsg(DBG_HW newfullscr?“new mode: fullscreen“:“new mode: windowed“);
cwindow::onminimax(Windowstyle);
if(Windowstyle == SW_SHOWMAXIMIZED)
{
xres = fsxres;
yres = fsyres;
}
else
{
xres = clientdx;
yres = clientdy;
}
if(oldfullscr ^ newfullscr)
{
cdebugmsg(DBG_HW “onminimax: calling reinitd3d...“);
reinitd3d();
}
}
cd3dbase::onactivate()
{
cdebugmsg(DBG_HW “cd3dbase::onactivate()“);
cwindow::onactivate();
/* if(fullscreen && Windowstyle == SW_SHOWMINIMIZED)
{
// restore fullscreen window
ShowWindow(hwnd SW_SHOWMAXIMIZED);
fullscreen = false;
}*/
}
cd3dbase::ondeactivate()
{
cdebugmsg(DBG_HW “cd3dbase::ondeactivate()“);
cwindow::ondeactivate();
if(Windowstyle == SW_SHOWMAXIMIZED)
{
// remember that the window was fullscreen
fullscreen = true;
// render to window
Windowstyle = SW_SHOWMINIMIZED;
reinitd3d();
// minimize
ShowWindow(hwnd SW_SHOWMINNOACTIVE);
}
/* if(Windowstyle == SW_SHOWMAXIMIZED)
{
// Windowstyle = SW_SHOWNORMAL;
// reinitd3d();
ShowWindow(hwnd SW_SHOWNORMAL);
}*/
}
cd3dbase::onsize(int dx int dy)
{
cdebugmsg(DBG_HW “cd3dbase::onsize()...“);
cwindow::onsize(dx dy);
if(Windowstyle != SW_SHOWMAXIMIZED)
{
xres = dx;
yres = dy;
}
}
cd3dbase::reinitd3d()
{
/* destroyd3d();
initd3d();*/
cdebugmsg(DBG_HW “cd3dbase::reinitd3d()...“);
if(Windowstyle == SW_SHOWMAXIMIZED)
{
cdebugmsg(DBG_HW “mode: fullscreen“);
d3dpp.Windowed = FALSE;
d3dpp.BackBufferWidth = fsxres;
d3dpp.BackBufferHeight = fsyres;
d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8;
}
else
{
cdebugmsg(DBG_HW “mode: windowed“);
d3dpp.Windowed = TRUE;
D3DDISPLAYMODE d3ddm;
d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT &d3ddm);
d3dpp.BackBufferFormat = d3ddm.Format;
}
d3dpp.AutoDepthStencilFormat = D3DFMT_D32;
cdebugmsg(DBG_HW “mode zbuffer
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 176128 2004-06-25 14:30 Tank3.1\Tank3.exe
文件 6417 2004-03-01 02:19 Tank3.1\Tank3.vcproj
文件 563 2002-03-28 18:03 Tank3.1\Tank3.dsw
文件 1218 2002-03-28 17:57 Tank3.1\window.h
文件 72 2002-03-28 17:56 Tank3.1\tank31.h
文件 31877 2002-06-21 23:26 Tank3.1\terra.cpp
文件 802 2004-06-25 13:33 Tank3.1\tank31.cpp
文件 766 2002-03-01 13:50 Tank3.1\Tank31.ico
文件 20008 2002-07-15 14:58 Tank3.1\render.cpp
文件 2421 2004-02-15 03:44 Tank3.1\Tank3.plg
文件 9188 2004-06-25 14:31 Tank3.1\debughw.txt
文件 484 2002-07-06 19:39 Tank3.1\todo.txt
文件 6425 2002-06-15 18:45 Tank3.1\Tank3.dsp
文件 1645 2002-03-29 17:32 Tank3.1\xFile.cpp
文件 92 2002-03-02 17:21 Tank3.1\Rsrc.rc
文件 2791 2002-08-18 15:01 Tank3.1\gs.cpp
文件 4583 2002-07-14 14:52 Tank3.1\window.cpp
文件 603 2002-05-21 21:44 Tank3.1\t3math.h
文件 613 2002-04-30 21:37 Tank3.1\sound.h
文件 98 2002-04-29 17:09 Tank3.1\render.h
文件 21102 2002-04-30 21:48 Tank3.1\omil.cpp
文件 4 2004-06-25 14:31 Tank3.1\status.txt
文件 87 2004-06-25 14:31 Tank3.1\hardware.txt
文件 16337 2002-08-09 16:03 Tank3.1\overlay.cpp
文件 70609 2004-06-25 13:57 Tank3.1\tank31fct.cpp
文件 13247 2002-08-19 14:33 Tank3.1\input.cpp
文件 433 2004-06-25 14:30 Tank3.1\gs.h
文件 3201 2002-04-29 23:59 Tank3.1\mission.h
文件 5512 2002-05-01 01:29 Tank3.1\sound.cpp
文件 850 2002-05-21 21:44 Tank3.1\t3math.cpp
文件 30109 2002-04-29 19:23 Tank3.1\mission.cpp
............此处省略164个文件信息
相关资源
- EPSON XP225 xp235 xp245打印机清零软件+教
- AxureUX电商产品移动端交互原型
- 三菱fx3u解密软件
- AXURE移动端素材元件库68580
- 电信中兴光猫超密获取工具使用方法
- res10_300x300_ssd_iter_140000.caffemodel与dep
- scratch 第1课 翻跟斗的小猫(入门)
- 04741计算机网络原理知识点整理.docx(
- TSCC.exe
- 梯控模糊搜索.exe
- 欧姆龙CP1系列单轴定位PLC程序.cxp
- Xamarin forms 手势事件
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- axure 框架图模板设计.rp
- 双木三林_XMOS driver V4.6
- 我的界面(visual foxpro)源码
- SPD博士V5.3.exe
- axure原形-京东物流后台
- The Secret Path 3D 3D魔方迷宫[源码][scra
-
Actionsc
ript 1.0实现能跟随鼠标运动的 - XE7UP1Kg13_Unis.exe
-
st
yles 引文样式语言( CSL ) 引文样 - 清翔电子MCS51开发板资料_新版 01_开发
-
AN_BLE-SDKDH-C1_Teli
nk BLE SDK DeveloperHan - Eeupdate.exe
-
Windows em
bedded Compact 2013 应用开发调 - The direction of synaptic plasticity mediated
- Reparatory Effects of Nicotine on NMDA Recepto
- Histamine excites rat lateral vestibular nucle
- 电脑卡西欧计算器 fx-991CN X Emulator19中
评论
共有 条评论