src/Graphics.hh
changeset 394 82def222fe7d
parent 393 5dd4d782cf3a
child 408 e6cfc44266af
--- a/src/Graphics.hh	Tue Jan 13 23:15:47 2009 +0200
+++ b/src/Graphics.hh	Tue Jan 13 23:54:47 2009 +0200
@@ -21,27 +21,60 @@
  */
 class Graphics : public GameStateEventHandler, public CL_DisplayWindow {
 private:
+    /**
+     * Our engine reference
+     */
     Engine &engine;
+
+    /**
+     * GameState we are associated with
+     */
     GameState &state;
+    
+    /**
+     * Current window resolution
+     */
+    PixelCoordinate resolution;
 
-    PixelCoordinate resolution;
+    /**
+     * Target resolution in fullscreen/windowed mode
+     */
+    PixelCoordinate fullscreen_resolution, window_resolution;
     
+    /**
+     * ClanLib signal slots
+     */ 
     CL_SlotContainer slots;
     
+    /**
+     * Our timer that drives redraws
+     */
     Timer update_timer;
-
+    
+    /**
+     * Our input handler for GUI and Player input
+     */
     Input input;
 
-    // current GUI input state
+    /**
+     * Current GUI input state
+     */
     GuiInput flags;
     
-    // basic fonts
+    /**
+     * A basic font
+     */
     CL_Font simple_font;
 
-    // view components
+    /**
+     * View components
+     */
     GameMessageView message_view;
 
 public:
+    /**
+     *
+     */
     Graphics (Engine &engine, GameState &state, PixelCoordinate resolution, bool fullscreen);
     
     /**
@@ -63,6 +96,11 @@
     
 private:
     /**
+     * Shift back and forth between fullscreen and windowed mode, retaining resolutions
+     */
+    void toggle_fullscreen (void);
+
+    /**
      * Reads current input events from Input and applies them, using LocalPlayer::handleInput and
      * Graphics::handle_input.
      */
@@ -72,12 +110,26 @@
      * Handles GuiInput flags read from Input.
      */
     void handle_input (GuiInput flags);
-
+    
+    /**
+     * Redraws entire screen
+     */
     void do_redraw (void);
     
+    /**
+     * Handles input and redraws screen
+     */
     void on_update (TimeMS tick_length);
     
-    void draw_player_info(CL_GraphicContext *gc, Player *p);
+    /**
+     * Draws status view
+     */
+    void draw_player_info (CL_GraphicContext *gc, Player *p);
+
+    /**
+     * Handles window resize. This just updates resolution
+     */
+    void on_window_resize (int new_x, int new_y);
         
 protected:
     /* GameStateEventHandler */