本文整理汇总了C++中sphere::setup方法的典型用法代码示例。如果您正苦于以下问题:C++ sphere::setup方法的具体用法?C++ sphere::setup怎么用?C++ sphere::setup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphere
的用法示例。
在下文中一共展示了sphere::setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vecEye
//--------------------------------------------------------------------------------------
// 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;
ID3D11DeviceContext* pd3dImmediateContext = DXUTGetD3D11DeviceContext();
V_RETURN( g_DialogResourceManager.OnD3D11CreateDevice( pd3dDevice, pd3dImmediateContext ) );
V_RETURN( g_D3DSettingsDlg.OnD3D11CreateDevice( pd3dDevice ) );
g_pTxtHelper = new CDXUTTextHelper( pd3dDevice, pd3dImmediateContext, &g_DialogResourceManager, 15 );
// D3DXVECTOR3 vCenter( 0.25767413f, -28.503521f, 111.00689f );
FLOAT fObjectRadius = 378.15607f;
lightpos = D3DXVECTOR3(300,300,-200);
//test = new testing();
hr = test.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext);
hr = tessplane.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext);
hr = tesscube.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,80,D3DXVECTOR3(300,50,-200));//D3DXVECTOR3(300,50,-200
hr = lightsphere.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,10,lightpos);
hr = fuse.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext);
hr = board1.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,D3DXVECTOR3(300,-300,-1000));
hr = deboard.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,D3DXVECTOR3(-300,-300,-1000));
hr = geo_alien.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext);
hr = FirePart.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,80,0); //0 = fire
hr = sky.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,D3DXVECTOR3(0,0,0));
hr = buildings.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext);
hr = MissilePart.setup(pd3dDevice,pBackBufferSurfaceDesc,pUserContext,20,1);
g_LightControl.SetRadius( 2000 );
// Setup the camera's view parameters
D3DXVECTOR3 vecEye( 0.0f, 50.0f, -1000.0f );
D3DXVECTOR3 vecAt ( 0.0f, 0.0f, -0.0f );
g_Camera.SetRotateButtons(true,false,false);
g_Camera.SetViewParams( &vecEye, &vecAt );
g_Camera.SetEnablePositionMovement( true );
g_Camera.SetScalers( 0.005f, 500.0f );
D3D11_DEPTH_STENCIL_DESC descDS;
ZeroMemory(&descDS, sizeof(descDS));
descDS.DepthEnable = false;
descDS.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
descDS.DepthFunc = D3D11_COMPARISON_LESS;
descDS.StencilEnable = FALSE;
hr = pd3dDevice->CreateDepthStencilState( &descDS, &g_DepthState);
//setup stuff for post process
ID3DBlob* pVertexShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"PP1.hlsl", "VS", "vs_4_0", &pVertexShaderBuffer ) );
ID3DBlob* pPixelShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"PP1.hlsl", "PS", "ps_4_0", &pPixelShaderBuffer ) );
V_RETURN( pd3dDevice->CreateVertexShader( pVertexShaderBuffer->GetBufferPointer(),
pVertexShaderBuffer->GetBufferSize(), NULL, &VSPPFirstPass ) );
DXUT_SetDebugName( VSPPFirstPass, "VSPost1" );
V_RETURN( pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(),
pPixelShaderBuffer->GetBufferSize(), NULL, &PSPPFirstPass ) );
DXUT_SetDebugName( PSPPFirstPass, "PSPost1" );
pVertexShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"Gaussblur.hlsl", "VS", "vs_4_0", &pVertexShaderBuffer ) );
pPixelShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"Gaussblur.hlsl", "PS", "ps_4_0", &pPixelShaderBuffer ) );
V_RETURN( pd3dDevice->CreateVertexShader( pVertexShaderBuffer->GetBufferPointer(),
pVertexShaderBuffer->GetBufferSize(), NULL, &VSPPBlur ) );
DXUT_SetDebugName( VSPPBlur, "VSBlur" );
V_RETURN( pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(),
pPixelShaderBuffer->GetBufferSize(), NULL, &PSPPBlur ) );
DXUT_SetDebugName( PSPPBlur, "PSBlur" );
pVertexShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"bloom_combine.hlsl", "VS", "vs_4_0", &pVertexShaderBuffer ) );
pPixelShaderBuffer = NULL;
V_RETURN( CompileShaderFromFile( L"bloom_combine.hlsl", "PS", "ps_4_0", &pPixelShaderBuffer ) );
V_RETURN( pd3dDevice->CreateVertexShader( pVertexShaderBuffer->GetBufferPointer(),
pVertexShaderBuffer->GetBufferSize(), NULL, &VSPPComb ) );
DXUT_SetDebugName( VSPPComb, "VSComb" );
V_RETURN( pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(),
pPixelShaderBuffer->GetBufferSize(), NULL, &PSPPComb ) );
DXUT_SetDebugName( PSPPComb, "PSComb" );
//.........这里部分代码省略.........