comparison Xcode-iPhoneOS/Demos/src/fireworks.c @ 5211:78db79f5a4e2

Updated the iPhone demos for the new API
author Sam Lantinga <slouken@libsdl.org>
date Sun, 06 Feb 2011 09:02:10 -0800
parents 06c7423f8c60
children
comparison
equal deleted inserted replaced
5210:443a850284a1 5211:78db79f5a4e2
171 } 171 }
172 172
173 /* draw our particles! */ 173 /* draw our particles! */
174 glDrawArrays(GL_POINTS, 0, num_active_particles); 174 glDrawArrays(GL_POINTS, 0, num_active_particles);
175 175
176 /* update screen */
177 SDL_RenderPresent();
178
179 } 176 }
180 177
181 /* 178 /*
182 This causes an emitter to explode in a circular bloom of dust particles 179 This causes an emitter to explode in a circular bloom of dust particles
183 */ 180 */
435 spawnEmitterParticle(x, y); 432 spawnEmitterParticle(x, y);
436 } 433 }
437 } 434 }
438 stepParticles(); 435 stepParticles();
439 drawParticles(); 436 drawParticles();
437 SDL_GL_SwapWindow(window);
440 endFrame = SDL_GetTicks(); 438 endFrame = SDL_GetTicks();
441 439
442 /* figure out how much time we have left, and then sleep */ 440 /* figure out how much time we have left, and then sleep */
443 delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame); 441 delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame);
444 if (delay > MILLESECONDS_PER_FRAME) { 442 if (delay > MILLESECONDS_PER_FRAME) {