terom@411: #ifndef GRAPHICS_GRAPHICS_HH terom@411: #define GRAPHICS_GRAPHICS_HH terom@411: terom@411: #include "../Engine.hh" terom@411: #include "Display.hh" terom@411: #include "FontManager.hh" terom@411: #include "GameView.hh" terom@411: terom@411: namespace graphics terom@411: { terom@411: terom@411: /** terom@411: * Core class that ties everything else together terom@411: */ terom@411: class Graphics { terom@411: public: terom@411: /** terom@411: * Our reference to the engine terom@411: */ terom@411: Engine &engine; terom@411: terom@411: /** terom@411: * For loading fonts terom@411: */ terom@411: FontManager fonts; terom@411: terom@411: /** terom@411: * Our primary display terom@411: */ terom@411: Display display; terom@411: terom@411: /** terom@411: * Initialize the graphics subsystem terom@411: */ terom@411: Graphics (Engine &engine, CL_ResourceManager &resources, const DisplayConfig &display_config); terom@411: terom@411: /** terom@411: * Display a new GameView terom@411: */ terom@411: void displayGameView (GameState &state, LocalPlayer *player) { terom@411: // allocate a new GameView terom@411: GameView *view = new GameView(state, player); terom@411: terom@411: // assign it to the display terom@411: display.setTarget(view); terom@411: } terom@411: terom@411: }; terom@411: terom@411: /** terom@411: * The global Graphics instance terom@411: */ terom@411: extern Graphics *graphics; terom@411: terom@411: } terom@411: terom@411: #endif