//--------------------------------------------------------------------------- // void display(void) void display() { glClear(GL_COLOR_BUFFER_BIT); // clear the backbuffer //draw all the Static Stuff -> map data for (Drawable* drawable : Static) { drawable->draw(); } //draw everything on the drawlist for (Drawable* drawable : drawList){ drawable->draw(); //delete the pointers to the drawable on the drawlist delete drawable; } //lastly draw the text -> ensures the text is always draw on top for (Drawable* drawable : DrawTextList) { drawable->draw(); //delete the ponter to the drawable delete drawable; } // Visualize the drawing commands glFlush(); // Execute all commands waiting to be executed glutSwapBuffers(); // Swap the backbuffer and frontbuffer //clear the drawing & text list drawList.clear(); DrawTextList.clear(); }
void MinigameBbAnt::drawMagnifyingGlass(DrawList &drawList) { scale2x(_objects[0].x - 28, _objects[0].y - 27); drawList.clear(); drawList.add(_objects[0].anim->frameIndices[0], _objects[0].x, _objects[0].y, _objects[0].priority); drawList.add(_objects[0].anim->frameIndices[1], _objects[0].x, _objects[0].y, _objects[0].priority); drawList.add(_objects[0].anim->frameIndices[2], _objects[0].x, _objects[0].y, _objects[0].priority); }
BufferedDrawList::DrawListRef BufferedDrawList::forUpdate() { DrawList* dl; for(;;) { dl = &Dl[Ui]; if(--Ui == 0) Ui = 2; if (dl == Rendering || dl == ToRender)continue; break; } dl->clear(); return DrawListRef( *dl, *this); }