Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

main.cpp

Go to the documentation of this file.
00001 
00006 /* If we're compiling with MSVC++, these #pragma definitions will
00007    automatically link the relevant libraries we need. */
00008 #ifdef WIN32
00009 #pragma comment(lib, "SDL.lib")
00010 #pragma comment(lib, "SDLmain.lib")
00011 //#pragma comment(lib, "msvcrt-ruby18.lib")
00012 #endif
00013 
00014 #include "globals.h"
00015 
00016 #include "testing.h"
00017 #include "sdl_driver.h"
00018 #include "cgame.h"
00019 
00020 #include <stdlib.h>
00021 
00025 extern "C" int main(int argc, char **argv)
00026 {
00027   /* Width of the screen, in pixels. */
00028   const int SCREEN_WIDTH = 640;
00029   /* Height of the screen, in pixels. */
00030   const int SCREEN_HEIGHT = 480;
00031   /* Depth of the screen, in bits per pixel. */
00032   const int SCREEN_DEPTH = 16;
00033   /* Number of bouncy boxes to display. */
00034   const int NUM_BOXES = 6;
00035 
00036   /* Set up our driver for the multimedia abstraction layer. */
00037   CSystemFactorySet driver;
00038 
00039   driver.videoFactory = SDLDriver::make_video_system_factory(
00040     SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH, 0);
00041   driver.eventFactory = SDLDriver::make_event_system_factory();
00042   driver.timerFactory = SDLDriver::make_timer_system_factory();
00043 
00044   /* Initialize the CGame singleton.  This also
00045      initializes all the other singleton subsystems
00046      in the game (video, event, timer). */
00047   CGame::init(&driver);
00048 
00049   CGame &g = CGame::get_instance();
00050 
00051   Testing::add_components(g, NUM_BOXES);
00052 
00053   /* Run the game. */
00054   g.run();
00055 
00056   /* Shut down the game. */
00057   CGame::deinit();
00058 
00059   return 0;
00060 }

Generated on Wed Aug 27 11:58:41 2003 for GFW by doxygen 1.3.3