/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Benjamin Grauer co-programmer: ... */ #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS #include "render_2d.h" #include "graphics_engine.h" #include "element_2d.h" ObjectListDefinition(Render2D); /** * @brief standard constructor */ Render2D::Render2D () { this->registerObject(this, Render2D::_objectList); this->setName("Render2D"); this->showNodes = false; } /** * @brief the singleton reference to this class */ Render2D* Render2D::singletonRef = NULL; /** * @brief standard deconstructor */ Render2D::~Render2D () { delete Element2D::getNullElement(); Render2D::singletonRef = NULL; } /** * @brief updates all the 2d-elements * @param dt the timestep since last dt */ void Render2D::update(float dt) { Element2D::getNullElement()->update2D(dt); } /** * @brief ticks all the 2d-elements * @param dt the timestep since last dt */ void Render2D::tick(float dt) { Element2D::getNullElement()->tick2D(dt); } /** * @brief renders all the Elements of the Render2D-engine's layer * @param layer the Layer to draw (if E2D_LAYER_ALL then all layers will be drawn) */ void Render2D::draw(E2D_LAYER from, E2D_LAYER to) const { GraphicsEngine::enter2DMode(); Element2D::getNullElement()->draw2D(from, to); if (this->showNodes) Element2D::getNullElement()->debugDraw2D(0); GraphicsEngine::leave2DMode(); }