Graphics Reference
In-Depth Information
//Turn vsync off
pDeviceSettings->d3d9.pp.PresentationInterval =
D3DPRESENT_INTERVAL_IMMEDIATE;
g_SettingsDlg.GetDialogControl()->
GetComboBox(DXUTSETTINGSDLG_PRESENT_INTERVAL)->SetEnabled(false);
//If device doesn't support HW T&L or doesn't support 1.1 vertex
//shaders in HW then switch to SWVP.
if((caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) = = 0 ||
caps.VertexShaderVersion < D3DVS_VERSION(1, 1))
{
pDeviceSettings->d3d9.BehaviourFlags =
D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
//Debugging vertex shaders requires either REF or software vertex
//processing and debugging pixel shaders requires REF.
#ifdef DEBUG_VS
if(pDeviceSettings->d3d9.DeviceType ! = D3DDEVTYPE_REF)
{
pDeviceSettings->d3d9.BehaviourFlags & =
~D3DCREATE_HARDWARE_VERTEXPROCESSING;
pDeviceSettings->d3d9.BehaviourFlags & = ~D3DCREATE_PUREDEVICE;
pDeviceSettings->d3d9.BehaviourFlags | =
D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
#endif
#ifdef DEBUG_PS
pDeviceSettings->d3d9.DeviceType = D3DDEVTYPE_REF;
#endif
//For the first device created if its a REF device, optionally
//display a warning dialog box
static bool s_bFirstTime = true;
if(s_bFirstTime)
{
s_bFirstTime = false;
if(pDeviceSettings->d3d9.DeviceType = = D3DDEVTYPE_REF)
DXUTDisplaySwitchingToREFWarning(pDeviceSettings->ver);
}
return true;
}
//—————————————————————————————————————————————————————————————————————————
//Generate a mesh that can be tesselated.
//—————————————————————————————————————————————————————————————————————————
HRESULT GenerateEnhancedMesh(IDirect3DDevice9* pd3dDevice, UINT
dwNewNumSegs)
{
LPD3DXMESH pMeshEnhancedSysMem = NULL;
LPD3DXMESH pMeshTemp;
HRESULT hr;
if(g_pMeshSysMem = = NULL)
return S_OK;
Search WWH ::




Custom Search