diff options
author | Logan Hunt <loganthebean222@gmail.com> | 2020-08-12 14:13:50 -0600 |
---|---|---|
committer | Logan Hunt <loganthebean222@gmail.com> | 2020-08-12 14:13:50 -0600 |
commit | 70ea8877ace50d2ce609d7d5f721c887b0ea83ec (patch) | |
tree | 514aa4f3d10b0a1db21928f8a002aa10458ecbb5 /src/driver.cpp | |
parent | 495f771530ce1869098bc568f34c243697cab73c (diff) | |
download | skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.tar.gz skeet-cs165-70ea8877ace50d2ce609d7d5f721c887b0ea83ec.zip |
Added files
Diffstat (limited to 'src/driver.cpp')
-rw-r--r-- | src/driver.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/driver.cpp b/src/driver.cpp new file mode 100644 index 0000000..554ce19 --- /dev/null +++ b/src/driver.cpp @@ -0,0 +1,45 @@ +/***************************************************** + * File: Driver.cpp + * Author: Br. Burton + * + * Description: This file contains the main function + * that starts the game and the callback function + * that specifies what methods of the game class are + * called each time through the game loop. + ******************************************************/ +#include "game.h" +#include "uiInteract.h" + +/************************************* + * All the interesting work happens here, when + * I get called back from OpenGL to draw a frame. + * When I am finished drawing, then the graphics + * engine will wait until the proper amount of + * time has passed and put the drawing on the screen. + **************************************/ +void callBack(const Interface *pUI, void *p) +{ + Game *pGame = (Game *)p; + + pGame->advance(); + pGame->handleInput(*pUI); + pGame->draw(*pUI); +} + + +/********************************* + * Main is pretty sparse. Just initialize + * the game and call the display engine. + * That is all! + *********************************/ +int main(int argc, char ** argv) +{ + Point topLeft(-200, 200); + Point bottomRight(200, -200); + + Interface ui(argc, argv, "Skeet", topLeft, bottomRight); + Game game(topLeft, bottomRight); + ui.run(callBack, &game); + + return 0; +} |