Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4848 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 13, 2005, 6:36:22 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more 2D-definitions, better draw function

Location:
orxonox/trunk/src/lib/graphics/render2D
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/render2D/element_2d.h

    r4847 r4848  
    1818  E2D_MEDIUM,                          //!< Will be rendered on the medium Layer.
    1919  E2D_BOTTOM,                          //!< Will be rendered on the bottom Layer
    20   E2D_BELOW_ALL                        //!< Will be rendered below the 3D-scene. @todo make this work.
     20  E2D_BELOW_ALL,                       //!< Will be rendered below the 3D-scene. @todo make this work.
     21
     22  E2D_LAYER_COUNT                      //!< The count of Layers.
    2123} E2DLayer;
    2224
     
    2426typedef enum
    2527{
    26   ELEM2D_ALIGN_NONE,
    27   ELEM2D_ALIGN_LEFT,
    28   ELEM2D_ALIGN_RIGHT,
    29   ELEM2D_ALIGN_CENTER,
    30   ELEM2D_ALIGN_SCREEN_CENTER
    31 } ELEM2D_ALIGNMENT;
     28  E2D_ALIGN_NONE,
     29  E2D_ALIGN_LEFT,
     30  E2D_ALIGN_RIGHT,
     31  E2D_ALIGN_CENTER,
     32  E2D_ALIGN_SCREEN_CENTER
     33} E2D_ALIGNMENT;
    3234
    3335//! A Struct defining the Position of an Element in 2D-space
     
    7072   E2DLayer                layer;
    7173
    72    ELEM2D_ALIGNMENT        alignment;        //!< How the Element is aligned around its Position
     74   E2D_ALIGNMENT           alignment;        //!< How the Element is aligned around its Position
    7375   const PNode*            bindNode;         //!< a node over which to display this 2D-element
    7476};
  • orxonox/trunk/src/lib/graphics/render2D/render_2d.cc

    r4847 r4848  
    3535   this->setName("Render2D");
    3636
    37    this->element2DList = new tList<Element2D>();
     37   this->element2DList = new tList<Element2D>;
    3838}
    3939
     
    5757 * registers a 2D-element to the 2D-Renderer
    5858 * @param element2D the element to registers
     59 *
     60 * do not use this function by yourself, because this is used by Element2D's constructor
    5961 */
    6062void Render2D::registerElement2D(Element2D* element2D)
     
    6668 * unregisters a 2D-element from the 2D-Renderer
    6769 * @param element2D The element to unregister
     70 *
     71 * do not use this function by yourself, because this is used by Element2D's destructor
    6872 */
    6973void Render2D::unregisterElement2D(Element2D* element2D)
     
    7579void Render2D::draw() const
    7680{
     81  GraphicsEngine::enter2DMode();
     82
    7783  tIterator<Element2D>* iterator = this->element2DList->getIterator();
    7884  Element2D* elem = iterator->nextElement();
     
    8490  }
    8591  delete iterator;
     92
     93  GraphicsEngine::leave2DMode();
    8694}
  • orxonox/trunk/src/lib/graphics/render2D/render_2d.h

    r4840 r4848  
    22 * @file render_2d.h
    33 * @brief Definition of the 2D-rendering engine singleton Class
     4 * @todo implement Layer-rendering
    45*/
    56
     
    89
    910#include "base_object.h"
    10 
     11#include "element_2d.h"
    1112// FORWARD DEFINITION
    1213template <class T> class tList;
    13 class Element2D;
    1414
    1515//! A default singleton class.
     
    2929 private:
    3030  Render2D();
    31   static Render2D*               singletonRef;           //!< Reference to this class.
     31  static Render2D*              singletonRef;           //!< Reference to this class.
    3232
    33   tList<Element2D>*              element2DList;          //!< List of all valid 2D-elements.
     33  tList<Element2D>*             element2DList;          //!< List of all valid 2D-elements.
    3434};
    3535
Note: See TracChangeset for help on using the changeset viewer.