Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/render2D/render_2d.cc @ 7455

Last change on this file since 7455 was 7453, checked in by bensch, 19 years ago

orxonox/trunk: Size is local to text now

File size: 1.7 KB
RevLine 
[4744]1/*
[3655]2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
[5399]12   main-programmer: Benjamin Grauer
[3655]13   co-programmer: ...
14*/
15
[5398]16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
[3655]17
[4839]18#include "render_2d.h"
[3655]19
[4840]20#include "graphics_engine.h"
21#include "class_list.h"
22#include "element_2d.h"
23
[5417]24#include "shell_command.h"
25SHELL_COMMAND(toggleNodeVisibility, Render2D, toggleNodesVisibility);
26
[3655]27using namespace std;
28
29/**
[4838]30 * standard constructor
31 */
[4839]32Render2D::Render2D ()
[3655]33{
[4839]34   this->setClassID(CL_RENDER_2D, "Render2D");
35   this->setName("Render2D");
[5417]36
37   this->showNodes = false;
[3655]38}
39
40/**
[4838]41 *  the singleton reference to this class
42 */
[4839]43Render2D* Render2D::singletonRef = NULL;
[3655]44
45/**
[4840]46 * standard deconstructor
[4838]47 */
[4839]48Render2D::~Render2D ()
[3655]49{
[6299]50  delete Element2D::getNullElement();
[5286]51
[4839]52  Render2D::singletonRef = NULL;
[3655]53}
[4840]54
55/**
[5406]56 * updates all the 2d-elements
57 * @param dt the timestep since last dt
58 */
59void Render2D::update(float dt)
60{
[6299]61  Element2D::getNullElement()->update2D(dt);
[5406]62}
63
64
65/**
[4862]66 * ticks all the 2d-elements
67 * @param dt the timestep since last dt
68 */
[4849]69void Render2D::tick(float dt)
70{
[6299]71  Element2D::getNullElement()->tick2D(dt);
[4849]72}
73
74/**
[5397]75 * renders all the Elements of the Render2D-engine's layer
76 * @param layer the Layer to draw (if E2D_LAYER_ALL then all layers will be drawn)
[4849]77 */
[5404]78void Render2D::draw(short layer) const
[4847]79{
[4848]80  GraphicsEngine::enter2DMode();
[6299]81  Element2D::getNullElement()->draw2D(E2D_LAYER_ALL);
[5417]82  if (this->showNodes)
[6299]83    Element2D::getNullElement()->debugDraw2D(0);
[4848]84  GraphicsEngine::leave2DMode();
[4847]85}
[5399]86
87
Note: See TracBrowser for help on using the repository browser.