src/Graphics.hh
author terom
Tue, 09 Dec 2008 02:00:19 +0000
changeset 344 a1ac08c37f0f
parent 315 fe9da2d5355e
child 389 e74c1820fbd2
permissions -rw-r--r--
reorganize section 1 of documentation, and write a lot of really hard-to-read text in section 2
#ifndef GRAPHICS_HH
#define GRAPHICS_HH

#include "GraphicsPointer.hh"

#include "GameState.hh"
#include "Input.hh"
#include "Timer.hh"
#include "Engine.hh"
#include "Config.hh"

#include <ClanLib/core.h>
#include <ClanLib/gl.h>
#include <ClanLib/display.h>

/**
 * This handles drawing the GameState with an appropriate camera view each frame, loading fonts, and currently,
 * handling the input from Input to GameState.
 */
class Graphics : public CL_DisplayWindow {
private:
    Engine &engine;
    GameState &state;

    PixelCoordinate resolution;
    
    CL_SlotContainer slots;
    
    Timer update_timer;

    Input input;

    // current GUI input state
    GuiInput flags;
    
    // basic fonts
    CL_Font simple_font;

public:
    Graphics (Engine &engine, GameState &state);

    CL_Font& getSimpleFont (void) { return simple_font; }
    
private:
    void check_input (void);
    void do_redraw (void);
    
    void on_update (TimeMS tick_length);
    
    void draw_player_info(CL_GraphicContext *gc, Player *p);
};

#endif /* GRAPHICS_HH */