資源簡介
有pdf格式紅龍書一本+源代碼,誠心共享!!
代碼片段和文件信息
//////////////////////////////////////////////////////////////////////////////////////////////////
//?
//?File:?d3dinit.cpp
//?
//?Author:?Frank?Luna?(C)?All?Rights?Reserved
//
//?System:?AMD?Athlon?1800+?XP?512?DDR?Geforce?3?Windows?XP?MSVC++?7.0?
//
//?Desc:?Demonstrates?how?to?initialize?Direct3D?how?to?use?the?book‘s?framework
//???????functions?and?how?to?clear?the?screen?to?black.??Note?that?the?Direct3D
//???????initialization?code?is?in?the?d3dUtility.h/.cpp?files.
//??????????
//////////////////////////////////////////////////////////////////////////////////////////////////
#include?“d3dUtility.h“
//
//?Globals
//
IDirect3DDevice9*?Device?=?0;?
//
//?framework?Functions
//
bool?Setup()
{
//?Nothing?to?setup?in?this?sample.
return?true;
}
void?Cleanup()
{
//?Nothing?to?cleanup?in?this?sample.
}
bool?Display(float?timeDelta)
{
if(?Device?)?//?Only?use?Device?methods?if?we?have?a?valid?device.
{
//?Instruct?the?device?to?set?each?pixel?on?the?back?buffer?black?-
//?D3DCLEAR_TARGET:?0x00000000?(black)?-?and?to?set?each?pixel?on
//?the?depth?buffer?to?a?value?of?1.0?-?D3DCLEAR_ZBUFFER:?1.0f.
Device->Clear(0?0?D3DCLEAR_TARGET?|?D3DCLEAR_ZBUFFER?0x00000000?1.0f?0);
//?Swap?the?back?and?front?buffers.
Device->Present(0?0?0?0);
}
return?true;
}
//
//?WndProc
//
LRESULT?CALLBACK?d3d::WndProc(HWND?hwnd?UINT?msg?WPARAM?wParam?LPARAM?lParam)
{
switch(?msg?)
{
case?WM_DESTROY:
::PostQuitMessage(0);
break;
case?WM_KEYDOWN:
if(?wParam?==?VK_ESCAPE?)
::DestroyWindow(hwnd);
break;
}
return?::DefWindowProc(hwnd?msg?wParam?lParam);
}
//
//?WinMain
//
int?WINAPI?WinMain(HINSTANCE?hinstance
???HINSTANCE?prevInstance?
???PSTR?cmdLine
???int?showCmd)
{
if(!d3d::InitD3D(hinstance
640?480?true?D3DDEVTYPE_HAL?&Device))
{
::MessageBox(0?“InitD3D()?-?FAILED“?0?0);
return?0;
}
if(!Setup())
{
::MessageBox(0?“Setup()?-?FAILED“?0?0);
return?0;
}
d3d::EnterMsgLoop(?Display?);
Cleanup();
Device->Release();
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???26764716??2011-07-25?08:35??DIRECTX.9.0.3Dgame\DIRECTX.9.0.3D游戲開發編程基礎.pdf
?????文件??????31823??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?1\D3D9?Init\chap1_0.jpg
?????文件???????2148??2003-03-08?10:30??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?1\D3D9?Init\d3dInit.cpp
?????文件???????4197??2003-03-08?10:32??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?1\D3D9?Init\d3dUtility.cpp
?????文件???????1263??2003-03-08?10:16??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?1\D3D9?Init\d3dUtility.h
?????文件?????????35??2003-05-03?13:26??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?2\no?samples?for?chap2.txt
?????文件??????38476??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Cube\chap3_1.jpg
?????文件???????5271??2003-03-08?12:27??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Cube\cube.cpp
?????文件???????4197??2003-03-08?10:32??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Cube\d3dUtility.cpp
?????文件???????1263??2003-03-08?10:16??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Cube\d3dUtility.h
?????文件??????60344??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\D3DXCreate\chap3_3.jpg
?????文件???????4197??2003-05-03?13:33??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\D3DXCreate\d3dUtility.cpp
?????文件???????1263??2003-03-08?10:16??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\D3DXCreate\d3dUtility.h
?????文件???????5286??2003-03-08?12:50??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\D3DXCreate\d3dxcreate.cpp
?????文件??????49757??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Teapot\chap3_2.jpg
?????文件???????4197??2003-03-08?10:32??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Teapot\d3dUtility.cpp
?????文件???????1263??2003-03-08?10:16??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Teapot\d3dUtility.h
?????文件???????3063??2003-03-08?12:31??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Teapot\teapot.cpp
?????文件??????36129??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Triangle\chap3_0.jpg
?????文件???????4197??2003-03-08?10:32??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Triangle\d3dUtility.cpp
?????文件???????1263??2003-03-08?10:16??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Triangle\d3dUtility.h
?????文件???????3467??2003-03-08?12:21??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?3\Triangle\triangle.cpp
?????文件??????42853??2003-05-03?15:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?4\Colore?Triangle\chap4_0.jpg
?????文件???????3827??2003-03-08?13:23??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?4\Colore?Triangle\colorTriangle.cpp
?????文件???????4197??2003-03-08?10:35??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?4\Colore?Triangle\d3dUtility.cpp
?????文件???????1761??2003-03-08?10:35??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?4\Colore?Triangle\d3dUtility.h
?????文件??????50487??2003-05-03?15:43??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?5\directional?light\chap5_1.jpg
?????文件???????5828??2003-03-08?14:21??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?5\directional?light\d3dUtility.cpp
?????文件???????2530??2003-03-08?10:44??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?5\directional?light\d3dUtility.h
?????文件???????4499??2003-03-08?14:22??DIRECTX.9.0.3Dgame\源代碼\小火龍源碼\Book?Part?II?Code\Chapter?5\directional?light\directionalLight.cpp
............此處省略298個文件信息
評論
共有 條評論