Source

pyGAP / game / inc / platform / application.h

Full commit
#ifndef _PLATFORM_APPLICATION_
#define _PLATFORM_APPLICATION_


namespace common {
class Log;
}


namespace platform {
class Platform;
class GameLoop;
class Renderer;
class Clock;
class CommandManager;
class InputDevice;


class Application
{
public:
    Application(Platform* platform, GameLoop* game_loop);
    virtual ~Application();

    void run();

    Renderer* get_renderer() { return renderer_; }
    Clock* get_clock() { return clock_; }

protected:
    void request_exit();
    Platform* get_platform();

    int num_input_devices_;
    InputDevice** input_devices_; //TODO: move in Platform or GameLoop?
    CommandManager* commands_; //TODO: move in GameLoop?

    Renderer* renderer_;
    Clock* clock_;

#if defined(DEBUG)
    static common::Log*    log_;
#endif

private:
    Application(const Application&);
    Application& operator=(const Application&);

    virtual int init() { return 0; }
    virtual void update();
    virtual void display() {}
    virtual void finish() {}

    Platform* platform_;
    GameLoop* game_loop_;

    bool exit_requested_;
};


} // namespace platform


#endif // _PLATFORM_APPLICATION_