本文整理汇总了C++中ParticleManager::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleManager::Update方法的具体用法?C++ ParticleManager::Update怎么用?C++ ParticleManager::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleManager
的用法示例。
在下文中一共展示了ParticleManager::Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Display
/*-----------------------------------------------------------------------------------------------
Description:
This is the rendering function. It tells OpenGL to clear out some color and depth buffers,
to set up the data to draw, to draw than stuff, and to report any errors that it came across.
This is not a user-called function.
This function is registered with glutDisplayFunc(...) during glut's initialization.
Parameters: None
Returns: None
Exception: Safe
Creator: John Cox (2-13-2016)
-----------------------------------------------------------------------------------------------*/
void Display()
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// in the absence of an actual timer, use a hard-coded delta time
gParticleManager.Update(0.01f);
// this handles its own bindings and cleans up when it is done
gParticleManager.Render();
// tell the GPU to swap out the displayed buffer with the one that was just rendered
glutSwapBuffers();
// tell glut to call this display() function again on the next iteration of the main loop
// Note: https://www.opengl.org/discussion_boards/showthread.php/168717-I-dont-understand-what-glutPostRedisplay()-does
// Also Note: This display() function will also be registered to run if the window is moved
// or if the viewport is resized. If glutPostRedisplay() is not called, then as long as the
// window stays put and doesn't resize, display() won't be called again (tested with
// debugging).
// Also Also Note: It doesn't matter where this is called in this function. It sets a flag
// for glut's main loop and doesn't actually call the registered display function, but I
// got into the habbit of calling it at the end.
glutPostRedisplay();
}