src/Graphics/Graphics.hh
author Tero Marttila <terom@fixme.fi>
Wed, 21 Jan 2009 23:07:22 +0200
branchnew_graphics
changeset 412 721c60072091
parent 411 106aaf6eadfe
child 413 7dddc163489a
permissions -rw-r--r--
new graphics code compiles... no, it doesn't work yet
#ifndef GRAPHICS_GRAPHICS_HH
#define GRAPHICS_GRAPHICS_HH

namespace graphics
{

class Graphics;

}

#include "../Engine.hh"
#include "Display.hh"
#include "FontManager.hh"
#include "GameView.hh"

namespace graphics
{

/**
 * Core class that ties everything else together
 */
class Graphics {
public:
    /**
     * Our reference to the engine
     */
    Engine &engine;

    /**
     * Our primary display
     */
    Display display;

    /**
     * For loading fonts
     */
    FontManager fonts;
   
    /**
     * Initialize the graphics subsystem
     */
    Graphics (Engine &engine, CL_ResourceManager &resources, const DisplayConfig &display_config);

    /**
     * Display a new GameView
     */
    void displayGameView (GameState &state, LocalPlayer *player) {
        // allocate a new GameView
        GameView *view = new GameView(state, player);

        // assign it to the display
        display.setTarget(view);
    }

};

/**
 * The global Graphics instance
 */
extern Graphics *graphics;

}

#endif