资源简介
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个文件信息
相关资源
- axizilla是否可能发生双光子共振?
- VirtualTreeview 最新版支持 XE10.3
- Delphi XE10.3 破解文件
- Delphi XE10.2.3破解 破解
- delphi XE4 完美破解
- 300系列WIN7 USB驱动.7z
- 影驰GALAXY 8600GT魔灵显卡驱动 For xp/v
- XP下AHCI驱动hm55与hm76的安装
- Face Alignment by Explicit Shape Regression-注释
- 剖析Linux系统下基于NUMA构建的服务
- Convex Optimization 习题答案
- 基于自研AFDX网络端系统芯片的模块设
- AFDX网络端系统芯片设计与实现
- AFDX协议/ARINC664中文版第七部分
- winrar-x64-420sc注册方法
- 基于STM32F4x9的LCD显示
- 易语言Excel多表对应处理源码
- 易语言EXCEL另存为CSV文件源码
- UltraEdit 26.x版本 激活工具
-
li
nksys AE1000/Cisco AM10无线网卡驱动 - 中盈 NX-612打印机驱动 v1.1 官方版
- NDK-R12B windows-x86_64百度云盘
- 宏碁Acer 4741G驱动合集 for winxp 官方版
- ADXL362中文说明手册
- 双二阶广义积分器SOGI软件锁相(基于
- 亲子嘉年华路演活动模型
- 轻量级文件服务器Fdfs搭建(fastDFS+n
- Txt2Mobi通用版
- 易语言迅雷补丁源码
- XBee路由器产品介绍
评论
共有 条评论