資源簡(jiǎn)介
基于D3D的魔方小程序,可作為D3D的練手小程序,模擬普通的魔方

代碼片段和文件信息
#include?“Cube.h“
#include?“Game.h“
IDirect3DDevice9*????g_pDevice???=?0;
LPDIRECTINPUTDEVICE8?g_pMouse?=?0;
Cube????????????*?cube=0;
Game????????????*?game=0;
bool?Display(float?timeDelta)?{
if(g_pDevice)?{
//Set?View?and?Update
D3DXMATRIX?view;
//player->SetView(view);
//Device->SetTransform(D3DTS_VIEW?&view);
//player->Update(Device);
game->Update();
//Render
g_pDevice->Clear(0?0?D3DCLEAR_TARGET?|?D3DCLEAR_ZBUFFER?D3DCOLOR_XRGB(14813299)?1.0f?0);
g_pDevice->BeginScene();
//Draw
//player->Draw(Device);
//cube->Render(timeDelta);
game->Render(timeDelta);
g_pDevice->EndScene();
g_pDevice->Present(0?0?0?0);
}
return?true;
}
//?WinMain
int?WINAPI?WinMain(HINSTANCE?hinstance
???HINSTANCE?prevInstance?
???PSTR?cmdLine
???int?showCmd)?{
HWND?hwnd?=?0;
if(!d3d::InitD3D(hinstance
1024?768?true?D3DDEVTYPE_HAL?&g_pDevice&g_pMousehwnd))?{
::MessageBox(0?“InitD3D?Failed!“?0?0);
return?0;
}
cube?=?new?Cube(g_pDevice);
game?=?new?Game(g_pDeviceg_pMousehwnd);
//Setup
//player->Init(Device);
game->Setup();
//cube->Setup();
d3d::EnterMsgLoop(Display);
//Release
//player->Release();
g_pDevice->Release();
g_pMouse->Release();
return?0;
}
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????4455??2009-04-24?22:07??源文件\3DGame.dsp
?????文件????????537??2009-04-17?01:12??源文件\3DGame.dsw
?????文件?????132096??2010-07-01?13:00??源文件\3DGame.ncb
?????文件??????56832??2010-07-01?12:59??源文件\3DGame.opt
?????文件???????1822??2010-07-01?12:25??源文件\3DGame.plg
?????文件???????1308??2009-04-25?11:54??源文件\3DGameMain.cpp
?????文件???????4286??2005-01-11?09:32??源文件\Arrow.cur
?????文件???????1950??2009-04-20?10:34??源文件\Arrow.jpg
?????文件???????2266??2009-04-20?10:34??源文件\Arrow.png
?????文件??????13301??2009-04-28?01:30??源文件\Cube.cpp
?????文件???????2009??2009-04-28?01:30??源文件\Cube.h
?????文件??????61796??2009-04-18?17:52??源文件\cube.jpg
?????文件??????23421??2009-04-18?20:50??源文件\cube0.jpg
?????文件??????22980??2009-04-18?20:46??源文件\cube1.jpg
?????文件??????23288??2009-04-18?20:47??源文件\cube2.jpg
?????文件??????22521??2009-04-18?20:48??源文件\cube3.jpg
?????文件??????20863??2009-04-18?20:49??源文件\cube4.jpg
?????文件??????23240??2009-04-18?20:49??源文件\cube5.jpg
?????文件???????8922??2009-04-25?12:08??源文件\D3DUtility.cpp
?????文件???????2925??2009-04-21?17:58??源文件\D3DUtility.h
?????文件??????12551??2009-08-09?12:39??源文件\Game.cpp
?????文件???????1566??2009-04-28?01:29??源文件\Game.h
?????文件?????462848??2010-07-01?12:25??源文件\Release\3DGame.exe
?????文件????6911324??2010-07-01?12:25??源文件\Release\3DGame.pch
?????文件??????14420??2010-07-01?12:25??源文件\Release\3DGameMain.obj
?????文件??????30671??2010-07-01?12:25??源文件\Release\Cube.obj
?????文件??????21426??2010-07-01?12:25??源文件\Release\D3DUtility.obj
?????文件??????28128??2010-07-01?12:25??源文件\Release\Game.obj
?????文件??????58368??2010-07-01?12:25??源文件\Release\vc60.idb
?????文件?????????30??2007-11-20?22:06??源文件\Resource.h
............此處省略6個(gè)文件信息
評(píng)論
共有 條評(píng)論