# HG changeset patch # User Markus Bröker # Date 1275396645 -7200 # Node ID d82830a449a9b854c6ac995641cc5fcca9928cdb # Parent efa226a4801ea9ca3a4a71d7e133067c6d0e15a9 PMC goes fullscreen ... committer: Markus Bröker diff --git a/pmc/main.cc b/pmc/main.cc --- a/pmc/main.cc +++ b/pmc/main.cc @@ -14,7 +14,7 @@ #define STEP 1 #endif -#define MAX 3 +#define MAX 1 using namespace algebra; @@ -26,35 +26,28 @@ int height; + surface = new Surface (0, 0, 32); + if (argc != 2) { fprintf (stderr, "Usage: %s \n", argv[0]); - height = 250; + height = surface->getHeight () / 2; } else height = atoi (argv[1]); - if ((height < 10) || (height >= 360)) - height = 200; - Vector p1 (0, 0); Vector p2 (height, 0); - Vector p3 (height + 100, height + 100); - Vector p4 (100, height + 100); + Vector p3 (height, height); + Vector p4 (0, height); - surface = new Surface (1024, 768, 32); SDL_WM_SetCaption ("Pimp my Cube", NULL); - d[0] = new Rectangle (surface, p1, p2, p3, p4); - d[1] = new Cube (surface); - d[2] = new Cube (surface, p1, p2, p3, p4, height); + d[0] = new Cube (surface, p1, p2, p3, p4, height); bool running = true; int i, x, y; x = y = 0; - d[1]->move (Vector (3 * height, 25)); - d[2]->move (Vector (290, 0)); - while (running) { SDL_PollEvent (&event); diff --git a/pmc/surface.cc b/pmc/surface.cc --- a/pmc/surface.cc +++ b/pmc/surface.cc @@ -17,7 +17,9 @@ depth = d; SDL_Init (SDL_INIT_VIDEO); - screen = SDL_SetVideoMode (width, height, depth, SDL_HWSURFACE); + screen = SDL_SetVideoMode (w, h, depth, SDL_HWSURFACE | SDL_FULLSCREEN); + width = screen->w; + height = screen->h; red = SDL_MapRGB (screen->format, 0xff, 0x00, 0x00); green = SDL_MapRGB (screen->format, 0x00, 0xff, 0x00); blue = SDL_MapRGB (screen->format, 0x00, 0x00, 0xff);