本文整理汇总了C++中ParamValueList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamValueList::clear方法的具体用法?C++ ParamValueList::clear怎么用?C++ ParamValueList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamValueList
的用法示例。
在下文中一共展示了ParamValueList::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
// The --expr ARG command line option will take ARG that is a snipped of
// OSL source code, embed it in some boilerplate shader wrapper, compile
// it from memory, and run that in the same way that would have been done
// if it were a compiled shader on disk. The boilerplate assumes that there
// are two output parameters for the shader: color result, and float alpha.
//
// Example use:
// testshade -v -g 64 64 -o result out.exr -expr 'result=color(u,v,0);'
//
static void
specify_expr (int argc, const char *argv[])
{
ASSERT (argc == 2);
std::string shadername = OIIO::Strutil::format("expr_%d", exprcount++);
std::string sourcecode =
"shader " + shadername + " (\n"
" float s = u [[ int lockgeom=0 ]],\n"
" float t = v [[ int lockgeom=0 ]],\n"
" output color result = 0,\n"
" output float alpha = 1,\n"
" )\n"
"{\n"
" " + std::string(argv[1]) + "\n"
" ;\n"
"}\n";
if (verbose)
std::cout << "Expression-based shader text is:\n---\n"
<< sourcecode << "---\n";
set_shadingsys_options ();
compile_buffer (sourcecode, shadername);
inject_params ();
shadernames.push_back (shadername);
shadingsys->Shader ("surface", shadername, layername);
layername.clear ();
params.clear ();
}
示例2: if
static int
add_shader (int argc, const char *argv[])
{
shadingsys->attribute ("debug", debug2 ? 2 : (debug ? 1 : 0));
const char *opt_env = getenv ("TESTSHADE_OPT"); // overrides opt
if (opt_env)
shadingsys->attribute ("optimize", atoi(opt_env));
else if (O0 || O1 || O2)
shadingsys->attribute ("optimize", O2 ? 2 : (O1 ? 1 : 0));
shadingsys->attribute ("lockgeom", 1);
shadingsys->attribute ("debug_nan", debugnan);
shadingsys->attribute ("debug_uninit", debug_uninit);
for (int i = 0; i < argc; i++) {
inject_params ();
shadernames.push_back (argv[i]);
shadingsys->Shader ("surface", argv[i],
layername.length() ? layername.c_str() : NULL);
layername.clear ();
params.clear ();
}
return 0;
}
示例3: shadername
static int
add_shader (int argc, const char *argv[])
{
ASSERT (argc == 1);
string_view shadername (argv[0]);
set_shadingsys_options ();
if (inbuffer) // Request to exercise the buffer-based API calls
shader_from_buffers (shadername);
for (int i = 0; i < argc; i++) {
inject_params ();
shadernames.push_back (shadername);
shadingsys->Shader ("surface", shadername, layername);
layername.clear ();
params.clear ();
}
return 0;
}