本文整理汇总了C++中VRenderParams::size方法的典型用法代码示例。如果您正苦于以下问题:C++ VRenderParams::size方法的具体用法?C++ VRenderParams::size怎么用?C++ VRenderParams::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRenderParams
的用法示例。
在下文中一共展示了VRenderParams::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VectorialRender
void vrender::VectorialRender(RenderCB render_callback, void *callback_params, VRenderParams& vparams)
{
GLfloat *feedbackBuffer = NULL ;
SortMethod *sort_method = NULL ;
Exporter *exporter = NULL ;
try
{
GLint returned = -1 ;
vparams.error() = 0 ;
int nb_renders = 0 ;
vparams.progress(0.0, QGLViewer::tr("Rendering...")) ;
while(returned < 0)
{
if(feedbackBuffer != NULL)
delete[] feedbackBuffer ;
feedbackBuffer = new GLfloat[vparams.size()] ;
if(feedbackBuffer == NULL)
throw std::runtime_error("Out of memory during feedback buffer allocation.") ;
glFeedbackBuffer(vparams.size(), GL_3D_COLOR, feedbackBuffer);
glRenderMode(GL_FEEDBACK);
render_callback(callback_params);
returned = glRenderMode(GL_RENDER);
nb_renders++ ;
if(returned < 0)
vparams.size() *= 2 ;
}
#ifdef A_VOIR
if(SortMethod != EPS_DONT_SORT)
{
GLint depth_bits ;
glGetIntegerv(GL_DEPTH_BITS, &depth_bits) ;
EGALITY_EPS = 2.0/(1 << depth_bits) ;
LINE_EGALITY_EPS = 2.0/(1 << depth_bits) ;
}
#endif
if (returned > vparams.size())
vparams.size() = returned;
#ifdef _VRENDER_DEBUG
cout << "Size = " << vparams.size() << ", returned=" << returned << endl ;
#endif
// On a un beau feedback buffer tout plein de saloperies. Faut aller
// defricher tout ca. Ouaiiiis !
vector<PtrPrimitive> primitive_tab ;
ParserGL parserGL ;
parserGL.parseFeedbackBuffer(feedbackBuffer,returned,primitive_tab,vparams) ;
if(feedbackBuffer != NULL)
{
delete[] feedbackBuffer ;
feedbackBuffer = NULL ;
}
if(vparams.isEnabled(VRenderParams::OptimizeBackFaceCulling))
{
BackFaceCullingOptimizer bfopt ;
bfopt.optimize(primitive_tab,vparams) ;
}
// Lance la methode de sorting
switch(vparams.sortMethod())
{
case VRenderParams::AdvancedTopologicalSort:
case VRenderParams::TopologicalSort: {
TopologicalSortMethod *tsm = new TopologicalSortMethod() ;
tsm->setBreakCycles(vparams.sortMethod() == VRenderParams::AdvancedTopologicalSort) ;
sort_method = tsm ;
}
break ;
case VRenderParams::BSPSort:
sort_method = new BSPSortMethod() ;
break ;
case VRenderParams::NoSorting:
sort_method = new DontSortMethod() ;
break ;
default:
throw std::runtime_error("Unknown sorting method.") ;
}
sort_method->sortPrimitives(primitive_tab,vparams) ;
// Lance les optimisations. L'ordre est important.
//.........这里部分代码省略.........