本文整理汇总了C++中ProgramObject::get_provider方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramObject::get_provider方法的具体用法?C++ ProgramObject::get_provider怎么用?C++ ProgramObject::get_provider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramObject
的用法示例。
在下文中一共展示了ProgramObject::get_provider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void D3DGraphicContextProvider::set_program_object(const ProgramObject &program)
{
D3DProgramObjectProvider *new_program_provider = static_cast<D3DProgramObjectProvider *>(program.get_provider());
if (new_program_provider == current_program_provider)
return;
if (current_program_provider)
unit_map.unbind_program(this, current_program_provider);
current_program_provider = new_program_provider;
clear_input_layout();
for (int j = 0; j < shadertype_num_types; j++)
{
D3DShaderObjectProvider *shader_provider = current_program_provider->get_shader_provider((ShaderType)j);
if (shader_provider)
{
switch (j)
{
case shadertype_vertex: window->get_device_context()->VSSetShader(shader_provider->get_vertex(), 0, 0); break;
case shadertype_tess_control: window->get_device_context()->HSSetShader(shader_provider->get_hull(), 0, 0); break;
case shadertype_tess_evaluation: window->get_device_context()->DSSetShader(shader_provider->get_domain(), 0, 0); break;
case shadertype_geometry: window->get_device_context()->GSSetShader(shader_provider->get_geometry(), 0, 0); break;
case shadertype_fragment: window->get_device_context()->PSSetShader(shader_provider->get_pixel(), 0, 0); break;
case shadertype_compute: window->get_device_context()->CSSetShader(shader_provider->get_compute(), 0, 0); break;
}
shader_bound[j] = true;
}
else if (shader_bound[j])
{
switch (j)
{
case shadertype_vertex: window->get_device_context()->VSSetShader(0, 0, 0); break;
case shadertype_tess_control: window->get_device_context()->HSSetShader(0, 0, 0); break;
case shadertype_tess_evaluation: window->get_device_context()->DSSetShader(0, 0, 0); break;
case shadertype_geometry: window->get_device_context()->GSSetShader(0, 0, 0); break;
case shadertype_fragment: window->get_device_context()->PSSetShader(0, 0, 0); break;
case shadertype_compute: window->get_device_context()->CSSetShader(0, 0, 0); break;
}
shader_bound[j] = false;
}
}
unit_map.bind_program(this, current_program_provider);
}