diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-06-28 20:42:06 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-06-28 20:42:06 +0100 |
commit | 76b6fd3e5dc823176f47a54de23afaa933f8bd4b (patch) | |
tree | 5ed6f48228447bea6c329a9ddad4631e12c7b6f2 | |
parent | 7004d04c37b88c6764d856f4cd77787d84991b1c (diff) | |
download | Arider-master.tar.gz Arider-master.zip |
m--------- | YAGE | 0 | ||||
-rw-r--r-- | src/game.cpp | 14 | ||||
-rw-r--r-- | src/main.cpp | 32 |
3 files changed, 23 insertions, 23 deletions
diff --git a/YAGE b/YAGE -Subproject 61e7d329c6bafaf269a619ffb2bb80a24b1fb21 +Subproject 85fe87aa7a52733dc80f61617bf65f22b2d98cc diff --git a/src/game.cpp b/src/game.cpp index ae78d17..2bc0f74 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -4,11 +4,8 @@ #include <GL/glew.h> #include <glm/glm.hpp> -#include <SDL2/SDL.h> -#include <YAGE/texture.hpp> -#include <YAGE/resourcemanager.hpp> -#include <YAGE/vertex.hpp> +#include <YAGE/yage.hpp> #include <stdexcept> #include <iostream> @@ -21,7 +18,7 @@ Game::Game(int screen_width/*=1280*/, int screen_height/*=720*/) : Game::~Game() { - SDL_Quit(); + yage::quit(); } void Game::run() @@ -33,8 +30,11 @@ void Game::run() void Game::initSystems() { - if(SDL_Init(SDL_INIT_VIDEO)) - throw std::runtime_error("SDL_Init failed"); + if(yage::init()) + { + throw std::runtime_error("Failed initialization"); + } + window_.create("Arider", screen_width_, screen_height_, yage::WindowFlags::SHOWN); initShaders(); diff --git a/src/main.cpp b/src/main.cpp index b6cde15..5f6e8a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,23 +8,23 @@ int main() { - std::cout<<"Arider\nVersion: "<<ARIDER_MAJOR_VERSION<<"."<<ARIDER_MINOR_VERSION - <<"."<<ARIDER_PATCH_VERSION<<'\n'; + std::cout<<"Arider\nVersion: "<<ARIDER_MAJOR_VERSION<<"."<<ARIDER_MINOR_VERSION + <<"."<<ARIDER_PATCH_VERSION<<'\n'; - Game game; + Game game; - try - { - game.run(); - } - catch(std::exception &e) - { - std::cerr<<"Error : "<<e.what()<<'\n'; - } - catch(...) - { - std::cerr<<"Error : Exception occured\n"; - } + try + { + game.run(); + } + catch(std::exception &e) + { + std::cerr<<"Error : "<<e.what()<<'\n'; + } + catch(...) + { + std::cerr<<"Error : Exception occured\n"; + } - return 0; + return 0; } |