DirectXDemo合集
DirectX D3D 编程最好的学习实例
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 31232 2013-03-31 21:47 D3DDebugmyTutorialD3D11.exe
文件 358484 2013-03-31 21:47 D3DDebugmyTutorialD3D11.ilk
文件 445440 2013-03-31 21:47 D3DDebugmyTutorialD3D11.pdb
文件 38400 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.exe
文件 374208 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.ilk
文件 470016 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.pdb
文件 32112640 2013-12-05 12:32 D3Dipchmytutoriald3d11_9-318d8c42mytutoriald3d11_9-2d624f1b.ipch
文件 602 2013-03-31 21:47 D3DmyTutorialD3D11Debugcl.command.1.tlog
文件 12422 2013-03-31 21:47 D3DmyTutorialD3D11DebugCL.read.1.tlog
文件 264 2013-03-31 21:47 D3DmyTutorialD3D11DebugCL.write.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink-cvtres.read.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink-cvtres.write.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.6716-cvtres.read.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.6716-cvtres.write.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.6716.read.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.6716.write.1.tlog
文件 1402 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.command.1.tlog
文件 2800 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.read.1.tlog
文件 638 2013-03-31 21:47 D3DmyTutorialD3D11Debuglink.write.1.tlog
文件 31512 2013-03-31 21:47 D3DmyTutorialD3D11Debugmain.obj
文件 408 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.command.1.tlog
文件 370 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.read.1.tlog
文件 302 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.write.1.tlog
文件 406 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.embed.manifest
文件 472 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.embed.manifest.res
文件 381 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.intermediate.manifest
文件 40 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.lastbuildstate
文件 3066 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.log
文件 220 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11_manifest.rc
文件 560 2013-03-31 21:47 D3DmyTutorialD3D11Debug
c.command.1.tlog
............此处省略707个文件信息
#include
//窗口类的名字
LPCWSTR m_applicationName;
//应用程序实例句柄
HINSTANCE m_hinstance;
//窗口句柄
HWND m_hwnd;
//用来判断是否按ESC键按下ESC键,则退出程序
bool bexit = false;
//初始化窗口类,创建应用程序窗口
void InitializeWindows(int& screenWidth int& screenHeight);
//调用初始化窗口函数,以及其它的接口类的初始化函数
bool Initialize();
//处理消息循环
void Run();
//关闭窗口
void ShutdownWindows();
//这两个函数是窗口的回调函数
static LRESULT CALLBACK MessageHandler(HWND UINT WPARAM LPARAM);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
//判断是否全屏,全屏和窗口模式窗口使用不同的创建窗口参数
const bool FULL_SCREEN = false;
//应用程序入口main函数
int WINAPI WinMain(HINSTANCE hInstance HINSTANCE hPrevInstance PSTR pScmdline int iCmdshow)
{
Initialize();
Run();
ShutdownWindows();
return 0;
}
//调用窗口初始化函数和其它一些类的初始化函数
//本例子中,只调用初始化窗口函数
bool Initialize()
{
int screenWidth = 0 screenHeight = 0;
// 初始化窗口
InitializeWindows(screenWidth screenHeight);
return true;
}
void InitializeWindows(int& screenWidth int& screenHeight)
{
WNDCLASSEX wc;
DEVMODE dmScreenSettings;
int posX posY;
// 得到应用程序实例句柄
m_hinstance = GetModuleHandle(NULL);
// 应用程序名字
m_applicationName = L“Engine“;
// 设置窗口类参数.
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = WndProc; //指定回调函数
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = m_hinstance;
wc.hIcon = LoadIcon(NULL IDI_WINLOGO);
wc.hIconSm = wc.hIcon;
wc.hCursor = LoadCursor(NULL IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockobject(BLACK_BRUSH); //默认黑色窗口黑色背景
wc.lpszMenuName = NULL;
wc.lpszClassName = m_applicationName;
wc.cbSize = sizeof(WNDCLASSEX);
// 注册窗口类
RegisterClassEx(&wc);
// 得到windows桌面分辨率
screenWidth = GetSystemMetrics(SM_CXSCREEN);
screenHeight = GetSystemMetrics(SM_CYSCREEN);
// 根据是否全屏设置不同的分辨率.
if(FULL_SCREEN)
{
//全屏模式下,设置窗口大小为windows桌面分辨率.
memset(&dmScreenSettings 0 sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = (unsigned long)screenWidth;
dmScreenSettings.dmPelsHeight = (unsigned long)screenHeight;
dmScreenSettings.dmBitsPerPel = 32;
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
// 临时设置显示设备为全屏模式,注意:应用程序退出时候,将恢复系统默认设置。
ChangeDisplaySettings(&dmScreenSettings CDS_FULLSCREEN);
// 设置窗口的左上角位置为(00).
posX = posY = 0;
}
else
{
// 窗口模式:800*600.
screenWidth = 800;
screenHeight = 600;
// 窗口位置左上角坐标位置posx,posy
posX = (GetSystemMetrics(SM_CXSCREEN) - screenWidth) / 2;
posY = (GetSystemMetrics(SM_CYSCREEN) - screenHeight) / 2;
}
// 全屏和窗口使用不同的参数.
if( FULL_SCREEN)
{
m_hwnd = CreateWindowEx(WS_EX_APPWINDOW m_applicationName m_applicationName
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP
posX posY screenWidth screenHeight NULL NULL m_hinstance NULL);
}
else
{
m_hwnd = CreateWindowEx(WS_EX_APPWINDOW m_applicationN
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 31232 2013-03-31 21:47 D3DDebugmyTutorialD3D11.exe
文件 358484 2013-03-31 21:47 D3DDebugmyTutorialD3D11.ilk
文件 445440 2013-03-31 21:47 D3DDebugmyTutorialD3D11.pdb
文件 38400 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.exe
文件 374208 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.ilk
文件 470016 2013-03-31 21:50 D3DDebugmyTutorialD3D11_2.pdb
文件 32112640 2013-12-05 12:32 D3Dipchmytutoriald3d11_9-318d8c42mytutoriald3d11_9-2d624f1b.ipch
文件 602 2013-03-31 21:47 D3DmyTutorialD3D11Debugcl.command.1.tlog
文件 12422 2013-03-31 21:47 D3DmyTutorialD3D11DebugCL.read.1.tlog
文件 264 2013-03-31 21:47 D3DmyTutorialD3D11DebugCL.write.1.tlog
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 1402 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 2800 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 638 2013-03-31 21:47 D3DmyTutorialD3D11Debugli
文件 31512 2013-03-31 21:47 D3DmyTutorialD3D11Debugmain.obj
文件 408 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.command.1.tlog
文件 370 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.read.1.tlog
文件 302 2013-03-31 21:47 D3DmyTutorialD3D11Debugmt.write.1.tlog
文件 406 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.em
文件 472 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.em
文件 381 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.exe.intermediate.manifest
文件 40 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.lastbuildstate
文件 3066 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11.log
文件 220 2013-03-31 21:47 D3DmyTutorialD3D11DebugmyTutorialD3D11_manifest.rc
文件 560 2013-03-31 21:47 D3DmyTutorialD3D11Debug
c.command.1.tlog
............此处省略707个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)