src/Graphics.hh
author terom
Sat, 06 Dec 2008 21:35:36 +0000
changeset 230 78cf0cd69af4
parent 205 905028e58ed1
child 233 ff4ecea83cf5
permissions -rw-r--r--
better input handling
#ifndef GRAPHICS_HH
#define GRAPHICS_HH

// XXX: forward-declare for Engine
class Graphics;

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

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

const std::string GRAPHICS_WINDOW_TITLE = "Kisna Glista";
const uint32_t GRAPHICS_RESOLUTION_WIDTH = 800;
const uint32_t GRAPHICS_RESOLUTION_HEIGHT = 600;
const uint16_t GRAPHICS_UPDATE_INTERVAL_MS = 20;

class Graphics {
private:
    Engine &engine;
    GameState &state;
    
    CL_SlotContainer slots;
    
    Timer update_timer;
    
    CL_DisplayWindow win;
    CL_InputDevice &keyboard;
    
public:
    Graphics (Engine &engine, GameState &state);
    
private:
    void check_input (void);
    void do_redraw (void);
    
    void on_update (TimeMS tick_length);
    
};

#endif /* GRAPHICS_HH */