Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/render/Overlay.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _OVERLAY_H_
00004 #define _OVERLAY_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <render/RenderOperation.h>
00009 #include <engine/Object.h>
00010 #include <render/Renderable.h>
00011 
00012 namespace render
00013 {
00014 
00015 enum MetricsMode
00016 {
00017         MM_RELATIVE,                            // 'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
00018         MM_PIXELS,                                      // Positions & sizes are in absolute pixels
00019         MM_RELATIVE_ASPECT_ADJUSTED     // Positions & sizes are in virtual pixels
00020 };
00021 
00023 enum HorizontalAlignment
00024 {
00025         HA_LEFT,
00026         HA_CENTER,
00027         HA_RIGHT
00028 };
00029 
00031 enum VerticalAlignment
00032 {
00033         VA_TOP,
00034         VA_CENTER,
00035         VA_BOTTOM
00036 };
00037 
00038 
00039 class Material;
00040 class VertexData;
00041 class IndexData;
00042 
00044 class ENGINE_PUBLIC_EXPORT Overlay: public Renderable
00045 {
00046 public:
00047 
00048         Overlay();
00049         Overlay(const std::string& name);
00050 
00051         virtual ~Overlay();
00052 
00054         void setPosition(f32 x, f32 y);
00055 
00057         void setDimension(f32 width, f32 height);
00058 
00060         f32 getWidth();
00062         f32 getHeight();
00063 
00065         virtual void setMetricsMode(MetricsMode mm);
00067         MetricsMode getMetricsMode() const;
00068 
00070         virtual Material* getMaterial() const;
00071 
00072         void getRenderOperation(RenderOperation& ro);
00073 
00074 protected:
00075 
00076         // Incremented count for next Index
00077         static u32 msNextGeneratedOverlayIndex;
00078 
00079         void initProperties();
00080 
00081         Material* mMaterial;
00082 
00084         VertexData* mVertexData;
00085 
00087         IndexData* mIndexData;
00088 
00089         f32 mWidth;
00090         f32 mHeight;
00091 
00092         MetricsMode mMetricsMode;
00093 
00094         f32 mU1, mV1, mU2, mV2;
00095 
00096         void updateImpl(f32 elapsedTime);
00097 
00098         bool mGeometryInitialized;
00099 
00101         bool mGeomPositionsOutOfDate;
00103         bool mGeomUVsOutOfDate;
00104 
00106         virtual void updatePositionBinding() = 0;
00108         virtual void updateTextureBinding() = 0;
00109 
00110         bool mModifiedWorldTransform;
00111 
00112         void updateWorldTransform();
00113 };
00114 
00115 } //namespace render
00116 
00117 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)