本文整理汇总了C++中VertexShader::set方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexShader::set方法的具体用法?C++ VertexShader::set怎么用?C++ VertexShader::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexShader
的用法示例。
在下文中一共展示了VertexShader::set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initalize
bool MicroManagerTest::initalize(float width, float height)
{
VertexShader vertexShader;
vertexShader.set( mData->sManager.loadVertexFromFile(&md3d, L"EngineVSPosNormalUV") );
mData->ps = mData->sManager.loadPixelFromFile(&md3d, L"PSPosNormalUV");
VertexShaderHandle modelShader = VertexShaderManager::newVertexShader( vertexShader );
md3d.getDeviceContext()->PSSetShader(mData->ps,NULL,NULL);
Procedural::MeshBuilderType mbt;
Procedural::BoxGenerator bg;
bg.addToMeshBuilder( mbt );
auto mesh = mbt.toMeshVertexCPU();
mData->model = ModelBuilder::makeStaticGeometryModel( md3d, VertexTypeManager::getVertexType(VertexTypeManager::Pos_Normal_UV), D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, mesh->toMeshCPU() );
ModelManager::fromHandle(mData->model).mVSShader = modelShader;
mbt.clear();
Procedural::SphereGenerator sg(1,128,128);
sg.addToMeshBuilder( mbt );
auto meshSphere = mbt.toMeshVertexCPU();
mData->sphere = ModelBuilder::makeStaticGeometryModel( md3d, VertexTypeManager::getVertexType(VertexTypeManager::Pos_Normal_UV), D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, meshSphere->toMeshCPU() );
ModelManager::fromHandle(mData->sphere).mVSShader = modelShader;
mData->cam.setPerspectiveFOV( DirectX::XMConvertToRadians(45),width / height, 0.1, 500 );
mData->cam.lookAt( .0f,.0f,.0f );
mData->cam.setPosition( .0f, .0f, -30.0f );
mData->cam.setRotationEuler( .0f,.0f,.0f);
int count = 0;
MaterialHandle fakeMaterial;
// Generate the box Array and positions
for( float xPos = -10.0f; xPos < 10.0f; xPos += 2.0f )
{
for( float yPos = -10.0f; yPos < 10.0f; yPos += 2.0f )
{
count++;
BoxDemo2 bx = {xPos, yPos, 0.0f, 0.0f, 0.0f, 0.0f, mData->mang->newRi( count % 2 == 0 ? mData->model : mData->sphere, fakeMaterial )};
mData->boxes.push_back( bx );
}
}
mIsOk = true;
matrix proj;
mData->cam.getProjData( &proj );
mData->mang->displayUpdate( proj );
return mIsOk;
}