• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/cannonball/header/RenderListener.h

Go to the documentation of this file.
00001 #pragma once
00002 #include "Gui.h"
00003 #include "Player.h"
00004 
00005 #define LEFT_MOUSE_BUTTON 1
00006 #define RIGHT_MOUSE_BUTTON 3
00007 #define MOUSE_WHEEL_UP 4
00008 #define MOUSE_WHEEL_DOWN 5
00009 
00012 class RenderListener :
00013         public ::EventRenderListener
00014 {
00015 public:
00017         RenderListener(IPhysic& physic, IRender& render, Camera& camera,
00018                 pMouseDevice mouse, pKeyboardDevice keyboard, const KeyboardMap& keyMap, Gui* gui, Player* player, 
00019                 IWindow& window, IAudio& audio);
00020         virtual ~RenderListener();
00021 
00023         void eventRender(void);
00024         void eventPaint(void);
00025 
00027         void guiInstanceCallback(pIControl source);
00028 
00031         static void guiCallback(pIControl source);
00032         
00035         static void setInstance(RenderListener* instance) { m_instance = instance; }
00036 
00037 private:
00038         Timer timer;
00039         Timer shotTimer;
00040         //clicking on the menu will cause a shot - this gives some before a shot can be initiated after the menu is closed
00041         Timer menuClosedTimer;
00042         Timer cameraPositionTimer;
00043         Timer labelShowTimer;
00044         Timer saveShowTimer;
00045         Timer statusLabelTimer;
00046         IPhysic& physic;
00047         IRender& render;
00048         IAudio& audio;
00049         Camera& camera;
00050         IWindow& window;
00051         pMouseDevice mouse;
00052         pKeyboardDevice keyboard;
00053         KeyboardMap keyMap;
00054         Gui* gui;
00055         Player* player;
00056         pIControl m_winLabel;
00057         bool winLabelShown;
00058 
00059         //bool menuToggled;
00060         //bool menuWait;
00061         //int cameraMode;
00062         float shotTime;
00063         float shotDeltaTime;
00064         float menuClosedTime;
00065         float menuNowTime;
00066         float labelStartShowTime;
00067         float saveStartShowTime;
00068         float statusStartTime;
00069         float3 oldCannonPosition;
00070         float cameraStartTime;
00071         float cameraCurrentTime;
00072         bool labelShown;
00073         bool saveShown;
00074         bool statusShown;
00075         bool downF2;
00076         bool downF3;
00077         bool downF4;
00078         bool downF5;
00079         bool downF8;
00080         bool downF9;
00081         bool wireframe;
00082         bool texture;
00083         bool mipmap;
00084         bool frustum;
00085         bool transparency;
00086         bool fps;
00087 
00088         int gameState;
00089         int oldGameState;
00090 
00091         static RenderListener* m_instance;
00092 };
00093 
00094 

Generated on Fri Jun 18 2010 17:48:39 for Cannonball by  doxygen 1.7.0