MCPcopy Create free account
hub / github.com/boostorg/compute / paintGL

Method paintGL

example/nbody.cpp:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 glViewport(0, 0, width, height);
171}
172void NBodyWidget::paintGL()
173{
174 // clear buffer
175 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
176
177 // check if this is the first draw
178 if(m_initial_draw) {
179 // do not update particles
180 m_initial_draw = false;
181 } else {
182 // update particles
183 updateParticles();
184 }
185
186 // draw
187 glVertexPointer(4, GL_FLOAT, 0, 0);
188 glEnableClientState(GL_VERTEX_ARRAY);
189 glDrawArrays(GL_POINTS, 0, m_particles);
190 glFinish();
191}
192void NBodyWidget::updateParticles()
193{
194 // enqueue kernels to update particles and make sure that the command queue is finished

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected