CMPS-4490 - Game Dev

Full screen game

Elements of this lab:
    • Run a game at full-screen
    • Let user choose screen resolution
    • Return screen to original resolution

Step 1:
Do your work in Odin directory: 4490/fullscreen_lab

Start by copying the lab files from:
   /home/fac/gordon/p/4490/code/frameworks/asteroids_fullscreen/

files...
Makefile
asteroids_fullscreen.cpp
timers.cpp
log.cpp
defs.h
log.h
fonts.h
libggfonts.a


Build with make.

Functionality needed...

1. Allow user to select screen resolution of game.
      User input is ok.
      Command-line arguments are ok.
      Configuration file is ok.

2. Center the ship starting position based on resolution.

3. When game ends, return screen resolution to that before the game started.


How... Use xrandr utility to query or change the screen resolution. When game begins... 1. Run: xrandr -q | grep ' connected ' > out.txt using system() command. ' connected ' may have to be ' primary ' 2. Open the out.txt file and store the display name and resolution info. After game begins... 1. Run: xrandr --mode 123x456 using system() command, to change to the user's desired resolution. Your numbers will be different. When game ends... 1. Run: xrandr --mode 444x333 to return to the original resolution. Your numbers will be different. program original output...