src/Application.cc
branchnew_graphics
changeset 411 106aaf6eadfe
parent 409 1a03ff151abc
child 412 721c60072091
--- a/src/Application.cc	Wed Jan 21 01:57:24 2009 +0200
+++ b/src/Application.cc	Wed Jan 21 03:33:35 2009 +0200
@@ -1,6 +1,7 @@
 
 #include "Application.hh"
 
+#include <ClanLib/gl.h>
 #include <stdexcept>
 #include <sstream>
 #include <cstdio>
@@ -104,20 +105,20 @@
                 break;
 
             case ARG_FULLSCREEN:
-                graphics.fullscreen = true;
+                display.fullscreen = true;
                 
                 // choose best resolution unless explicitly set
                 if (resolution_default) {
-                    const CL_DisplayMode best_mode = Graphics::getBestMode();
+                    const CL_DisplayMode best_mode = graphics::Display::getBestMode();
                     const CL_Size best_resolution = best_mode.get_resolution();
 
-                    graphics.resolution = PixelCoordinate(best_resolution.width, best_resolution.height);
+                    display.resolution = PixelDimensions(best_resolution.width, best_resolution.height);
                 }
 
                 break;
 
             case ARG_RESOLUTION:
-                graphics.resolution = parse_arg_dimensions(args.get_argument(), "--resolution");
+                display.resolution = parse_arg_dimensions(args.get_argument(), "--resolution");
                 resolution_default = false;
                 break;
 
@@ -170,18 +171,18 @@
     return int_val;
 }
 
-PixelCoordinate Main::parse_arg_dimensions (const std::string &arg_val, const char *arg_name) {
+PixelDimensions Main::parse_arg_dimensions (const std::string &arg_val, const char *arg_name) {
     unsigned int w, h;
     
     // sccanf as unsigned
     if (sscanf(arg_val.c_str(), "%ux%u", &w, &h) != 2)
         throw ArgumentError(std::string() + "invalid format for " + arg_name + ": " + arg_val);
     
-    return PixelCoordinate(w, h);
+    return PixelDimensions(w, h);
 }
         
 void Main::dump_display_modes (void) {
-    const std::vector<CL_DisplayMode> &modes = Graphics::getDisplayModes();
+    const std::vector<CL_DisplayMode> &modes = graphics::Display::getDisplayModes();
     
     std::cout << "Available display modes:" << std::endl;
 
@@ -217,7 +218,7 @@
         
         // setup graphics
         if (graphics_enabled)
-            engine.setupGraphics(graphics);
+            engine.setupGraphics(display);
 
         // setup either network server, client or singleplayer
         if (net_server) {