Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 5402 was 5401, checked in by bensch, 20 years ago

orxonox/trunk: new Layering system works, now i have to do the check on reparenting, so no lower layers are children of high-layer-parents

File size: 1.4 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 "list.h"
23#include "element_2d.h"
24
[4862]25#include <math.h>
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");
[3655]36}
37
38/**
[4838]39 *  the singleton reference to this class
40 */
[4839]41Render2D* Render2D::singletonRef = NULL;
[3655]42
43/**
[4840]44 * standard deconstructor
[4838]45 */
[4839]46Render2D::~Render2D ()
[3655]47{
[5286]48  delete NullElement2D::getInstance();
49
[4839]50  Render2D::singletonRef = NULL;
[3655]51}
[4840]52
53/**
[4862]54 * ticks all the 2d-elements
55 * @param dt the timestep since last dt
56 */
[4849]57void Render2D::tick(float dt)
58{
[5401]59  NullElement2D::getInstance()->tick2D(dt);
[4849]60}
61
62/**
[5397]63 * renders all the Elements of the Render2D-engine's layer
64 * @param layer the Layer to draw (if E2D_LAYER_ALL then all layers will be drawn)
[4849]65 */
[5398]66void Render2D::draw(E2D_LAYER layer) const
[4847]67{
[4848]68  GraphicsEngine::enter2DMode();
[5401]69  NullElement2D::getInstance()->draw2D(E2D_LAYER_ALL);
[4848]70  GraphicsEngine::leave2DMode();
[4847]71}
[5399]72
73
Note: See TracBrowser for help on using the repository browser.