資源簡(jiǎn)介
directx寫(xiě)的陰影例子源碼,帶匯編,帶.x模型文件,極好的3d參考源碼

代碼片段和文件信息
/*
title: CGraphics.cpp
DESC: Interface?implementation?for?shadows?sample?program
DATE: August?2003
AUTHOR: Jack?Hoxley
*/
//include?system?includes
#include?
#include?
#include?
#include?
#include?
//include?the?implementation?header
#include?“CGraphics.h“
#include?“CGraphicsException.h“
#include?“ShadowCalculator.h“
//conditional?statements:
//#define?DISPLAY_VSYNC //comment?out?this?#define?to?disable?vsync‘ing.
#define?AMB_LIGHT?D3DCOLOR_XRGB(?64?64?64?) //use?this?to?easily?change?the?ambient?lighting?across?the?whole?application
#define?COMBINE_FIRST_2_PASSES //determines?whether?we?combine?the?z-fill?and?ambient?passes
//#define?RENDER_VOLUMES //displays?the?shadow?volumes?on?screen
#define?SHADOW_VOLUME_UPDATE_ALTERNATE //updates?the?shadow?volumes?using?a?per-frame?delta..
/*-------------------------------------------------------------*\
CGraphics(HWND)
---------------
hWnd?= valid?handle?to?a?win32?window?that?is?the?target
of?3D?rendering
Constructor?for?a?windowed?mode?instance?of?the?3D?engine
\*-------------------------------------------------------------*/
CGraphics::CGraphics(HWND?hWnd)?{
ResetAllVars();
InitialiseDevice(hWnd000true);
}?//ctor(hwnd)
/*-------------------------------------------------------------*\
CGraphics(HWNDINTINTINT)
---------------------------
hWnd?= Valid?handle?to?a?win32?render?target
iW???= Width?of?the?screen
iH???= Height?of?the?screen
iD???= Depth?of?the?display?(1624?or?32?only)
Creates?a?fullscreen?instance?of?the?graphics?engine?
the?engine?will?check?compatability?before?allowing?the
initialisation?to?properly?occur.
\*-------------------------------------------------------------*/
CGraphics::CGraphics(HWND?hWnd?int?iW?int?iH?int?iD)?{
ResetAllVars();
if?(IsDisplayModeOkay(iWiHiD))?{
//hide?the?mouse?cursor?while?in?fullscreen?mode
do?{}?while?(ShowCursor(false)>0);
//set?the?ball?rolling...
InitialiseDevice(hWndiWiHiDfalse);
}?else
throw?CGraphicsException(“Resolution?is?not?supported!““CGraphics.cpp“__LINE__);
}?//ctor(hwndintintint)
/*-------------------------------------------------------------*\
~CGraphics()
------------
Standard?destructor?for?the?class?makes?sure?that?all
memory?is?deallocated?and?that?any?necessary?objects
are?terminated?in?the?correct?manner.
\*-------------------------------------------------------------*/
CGraphics::~CGraphics()?{
//free?other?memory
SAFE_DELETE(?sDispInfo?);
SAFE_DELETE(?sDevInfo?);
SAFE_DELETE(?lList[0]?);
SAFE_DELETE(?lList[1]?);
SAFE_DELETE(?lList[2]?);
SAFE_DELETE(?lList[3]?);
//release?the?shadows
for?(?int?i?=?0;?i?12;?i++?)
SAFE_DELETE(?pVols[i]?);
//release?the?geometry
SAFE_DELETE(?mshCaster[0]?);
SAFE_DELETE(?mshCaster[1]?);
//release?textures
S
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????52295??2003-09-15?13:42??Shadows\CGraphics.cpp
?????文件???????4746??2003-09-13?14:04??Shadows\CGraphics.h
?????文件??????10756??2005-09-19?14:26??Shadows\CGraphicsException.asm
?????文件???????1035??2003-08-18?22:50??Shadows\CGraphicsException.cpp
?????文件????????701??2003-08-01?15:18??Shadows\CGraphicsException.h
?????文件??????92418??2005-09-19?14:26??Shadows\CMesh.asm
?????文件??????13192??2003-09-07?14:33??Shadows\CMesh.cpp
?????文件???????3470??2003-09-07?14:31??Shadows\CMesh.h
?????文件??????34393??2005-09-19?14:26??Shadows\Core.asm
?????文件???????6601??2003-09-07?15:24??Shadows\Core.cpp
?????文件???????5463??2005-09-19?14:26??Shadows\Debug\BuildLog.htm
?????文件??????14160??2005-09-19?14:26??Shadows\Debug\CGraphicsException.obj
?????文件??????54289??2005-09-19?14:26??Shadows\Debug\CMesh.obj
?????文件??????26899??2005-09-19?14:26??Shadows\Debug\Core.obj
?????文件??????25176??2005-09-19?14:26??Shadows\Debug\ShadowCalculator.obj
?????文件?????420864??2005-09-19?14:26??Shadows\Debug\vc70.idb
?????文件?????176128??2005-09-19?14:26??Shadows\Debug\vc70.pdb
?????文件?????786486??2003-08-02?00:00??Shadows\Graphics\Abalone.bmp
?????文件??????49206??2003-08-10?23:57??Shadows\Graphics\Floor.bmp
?????文件?????196662??2003-08-11?00:00??Shadows\Graphics\Ice.bmp
?????文件??????66614??2003-08-10?23:48??Shadows\Graphics\Marble.bmp
?????文件?????196662??2003-08-01?23:57??Shadows\Graphics\me
?????文件???????4224??2003-08-19?00:06??Shadows\Graphics\PointLight.dds
?????文件?????196662??2003-08-10?23:54??Shadows\Graphics\Stand.bmp
?????文件?????196662??2003-08-02?00:02??Shadows\Graphics\Stones.bmp
?????文件??????46976??2003-08-22?00:09??Shadows\Meshes\Archway_Max.3DS
?????文件??????87470??2003-08-22?00:10??Shadows\Meshes\Archway_Max.x
?????文件??????36422??2003-08-20?03:05??Shadows\Meshes\Archway_Med.3DS
?????文件??????72574??2003-08-20?03:06??Shadows\Meshes\Archway_Med.x
?????文件??????15702??2003-08-13?16:44??Shadows\Meshes\Archway_Min.3DS
............此處省略42個(gè)文件信息
- 上一篇:1000款MT4_EA源代碼文件
- 下一篇:電力電子答案 高教版陳堅(jiān)
評(píng)論
共有 條評(píng)論