src/Graphics/Graphics.hh
branchnew_graphics
changeset 411 106aaf6eadfe
child 412 721c60072091
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Graphics/Graphics.hh	Wed Jan 21 03:33:35 2009 +0200
@@ -0,0 +1,57 @@
+#ifndef GRAPHICS_GRAPHICS_HH
+#define GRAPHICS_GRAPHICS_HH
+
+#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;
+
+    /**
+     * For loading fonts
+     */
+    FontManager fonts;
+
+    /**
+     * Our primary display
+     */
+    Display display;
+    
+    /**
+     * 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