コード例 #1
0
	//------------------------------------------------------------
	void PPC::AddParamsFrom(tixmlel_traits::in element)
	{
		defaultMaterialName = XI::GetString( element, PK::DEF_MAT_NAME );
		defaultSceneName = XI::GetString( element, PK::DEF_SCENE_NAME );
		if( defaultMaterialName.empty() )defaultMaterialName = PK::DEFAULT_NAME;
		if( defaultSceneName.empty() )defaultSceneName = PK::DEFAULT_NAME;
		OPC::torqueMechToPhysXMult = XI::GetReal( element, PK::TORQUE_MULT );
		nxuFilename = XI::GetString( element, PK::NXU_FILE );

		string_traits::str childName;
		const TiXmlElement* childElement(0);
		while( XI::IterateChildElements( element, childElement ) )
		{
			childName = childElement->Value();
			if( childName == PK::SDK )
			{
				LoadSDK( childElement );
			}
			else if( childName == PK::SCENES )
			{
				LoadScenes( childElement );
			}
			else if( childName == PK::MATERIALS )
			{
				LoadMaterials( childElement );
			}
		}
	}
コード例 #2
0
//--------------------------------------------------------------------------------------
// Create any D3D11 resources that aren't dependant on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D11CreateDevice(ID3D11Device* pd3dDevice, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext)
{
    HRESULT hr;

    DXUTTRACE(L"OnD3D11CreateDevice called\n");

    SetCursor(LoadCursor(0, IDC_ARROW));

    ID3D11DeviceContext* pd3dImmediateContext = DXUTGetD3D11DeviceContext(); // does not addref
    V_RETURN( g_DialogResourceManager.OnD3D11CreateDevice(pd3dDevice, pd3dImmediateContext) );
    V_RETURN( g_SettingsDlg.OnD3D11CreateDevice(pd3dDevice) );
    g_pTxtHelper = new CDXUTTextHelper(pd3dDevice, pd3dImmediateContext, &g_DialogResourceManager, g_TextLineHeight);

    // Setup orbital camera
    D3DXVECTOR3 vecEye(0.0f, 2.0f, 0.0f);
    D3DXVECTOR3 vecAt (0.0f, 0.0f, 0.0f);
    g_OrbitalCamera.SetViewParams(&vecEye, &vecAt);
    g_OrbitalCamera.SetRadius(1.5f, 0.01f);

    // Setup first-person camera
    D3DXVECTOR3 sibenikVecEye(0.0960150138f, 0.0273544509f, -0.0185411610f);
    D3DXVECTOR3 sibenikVecAt (-0.623801112f, -0.649074197f, -0.174454257f);
    g_FirstPersonCamera.SetViewParams(&sibenikVecEye, &sibenikVecAt);
    g_FirstPersonCamera.SetEnablePositionMovement(1);
    g_FirstPersonCamera.SetScalers(0.001f, 0.05f);

    // Load Scene3D.fx
    g_pSceneRenderer.OnCreateDevice(pd3dDevice);

    // Load meshes and bin files
    LoadScenes(pd3dDevice);

    GFSDK_SSAO_Status status;
    status = g_AORenderer.Create(pd3dDevice);
    assert(status == GFSDK_SSAO_OK);

    return S_OK;
}