/* When was the last time we created a new bubble? */
int bubble_count;
+
+ glb_data *d;
+
} draw_context;
void *
glLightfv(GL_LIGHT2, GL_DIFFUSE, light_diffuse[2]);
glLightfv(GL_LIGHT2, GL_SPECULAR, light_specular[2]);
+ c->d = glb_sphere_init();
+
return c;
}
delete_bubble(c, i);
i--;
}
+
+ glb_sphere_end (c->d);
+
(void) free((void *) c->bubble_list);
(void) free((void *) c);
}
/* Create the bubble(s). */
for (i = 0; i < n; ++i) {
- if ((b[i] = glb_bubble_new(x, y, z, size, speed, scale_incr)) == 0) {
+ if ((b[i] = glb_bubble_new(c->d, x, y, z, size, speed, scale_incr)) == 0) {
/* Out of memory - recover. */
i--;
while (i >= 0)
void *b = c->bubble_list[i];
glb_bubble_step(b);
- glb_bubble_draw(b);
+ glb_bubble_draw(c->d, b);
/* Has the bubble reached the top of the screen? */
if (glb_bubble_get_y(b) >= glb_config.screen_top) {