文件名称:01_CreateDevice
- 所属分类:
- DirextX编程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 300kb
- 下载次数:
- 0次
- 提 供 者:
- your****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
Direct3D程序设计基础
//创建Direct3D对象, 该对象用来创建Direct3D设备对象
if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
return E_FAIL
//设置D3DPRESENT_PARAMETERS结构, 准备创建Direct3D设备对象
D3DPRESENT_PARAMETERS d3dpp
ZeroMemory( &d3dpp, sizeof(d3dpp) )
d3dpp.Windowed = TRUE
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN
//创建Direct3D设备对象
if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice ) ) )
{
return E_FAIL
}-Program design based on Direct3D// create a Direct3D object, the object used to create Direct3D device object if (NULL == (g_pD3D = Direct3DCreate9 (D3D_SDK_VERSION))) return E_FAIL// set D3DPRESENT_PARAMETERS structure, ready to create a Direct3D device object D3DPRESENT_PARAMETERS d3dpp ZeroMemory (
//创建Direct3D对象, 该对象用来创建Direct3D设备对象
if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
return E_FAIL
//设置D3DPRESENT_PARAMETERS结构, 准备创建Direct3D设备对象
D3DPRESENT_PARAMETERS d3dpp
ZeroMemory( &d3dpp, sizeof(d3dpp) )
d3dpp.Windowed = TRUE
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN
//创建Direct3D设备对象
if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pd3dDevice ) ) )
{
return E_FAIL
}-Program design based on Direct3D// create a Direct3D object, the object used to create Direct3D device object if (NULL == (g_pD3D = Direct3DCreate9 (D3D_SDK_VERSION))) return E_FAIL// set D3DPRESENT_PARAMETERS structure, ready to create a Direct3D device object D3DPRESENT_PARAMETERS d3dpp ZeroMemory (
(系统自动生成,下载前可以参看下载内容)
下载文件列表
01_CreateDevice
...............\CreateDevice.cpp
...............\CreateDevice.exe
...............\CreateDevice.ncb
...............\CreateDevice.sln
...............\CreateDevice.vcproj
...............\Debug
...............\CreateDevice.cpp
...............\CreateDevice.exe
...............\CreateDevice.ncb
...............\CreateDevice.sln
...............\CreateDevice.vcproj
...............\Debug