00001 00002 00003 #ifndef WORLD_H 00004 #define WORLD_H 00005 00006 00007 #include "InputSystem.h" 00008 #include "RenderableObject.h" 00009 00010 #include <vector> 00011 00012 00013 namespace pge { 00014 00015 00016 class BloomEffect; 00017 class Camera; 00018 class Frustum; 00019 class GPUProgram; 00020 class ISky; 00021 00022 struct Light; 00023 00024 00025 class World : public IRenderableObject { 00026 00027 00028 public: 00029 //************************************************************************ 00030 // 00031 // Constructor 00032 // 00033 //************************************************************************ 00035 World(void); 00036 00037 00038 //************************************************************************ 00039 // 00040 // Destructor 00041 // 00042 //************************************************************************ 00044 virtual ~World(void); 00045 00046 00047 //************************************************************************ 00048 // 00049 // Functions 00050 // 00051 //************************************************************************ 00052 bool init(void); 00053 void render(void); 00054 void timer(unsigned int delay); 00055 00056 void action(InputSystem::InputAction type, int param0, int param1); 00057 00058 Camera* getCamera(void); 00059 Frustum* getFrustum(void); 00060 00061 GPUProgram* getLightProgram(void); 00062 00063 void setSky(ISky *sky); 00064 00065 void addRenderableObject(IRenderableObject *object, bool disableBloom = false); 00066 void clearRenderableObjects(); 00067 00068 void addLight(Light *light); 00069 int getLightNum(void); 00070 Light* getLightAt(int index); 00071 00072 00073 private: 00074 //************************************************************************ 00075 // 00076 // Variables 00077 // 00078 //************************************************************************ 00079 std::vector<IRenderableObject*> m_objects; 00080 std::vector<IRenderableObject*> m_objectsWithoutBloom; 00081 00082 std::vector<Light*> m_lights; 00083 00084 Camera *m_camera; 00085 Frustum *m_frustum; 00086 00087 ISky *m_sky; 00088 00089 GPUProgram *m_globalLightProgram; 00090 00091 BloomEffect *m_bloomEffect; 00092 }; 00093 }; 00094 00095 #endif