Taking the width and height from the config file.

This commit is contained in:
King_DuckZ 2014-02-08 20:25:30 +01:00
parent ef3a4c1ef6
commit 036fec62e5
2 changed files with 11 additions and 6 deletions

View file

@ -5,4 +5,7 @@
#define GameVersionMinor 1
#define GameVersionMajor 0
#define DEF_WIN_WIDTH 800
#define DEF_WIN_HEIGHT 600
#endif

View file

@ -10,8 +10,8 @@ namespace {
bool initialized;
};
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
///------------------------------------------------------------------------
///------------------------------------------------------------------------
void InitSDL (InitSDLStuff& parInitSDL) {
parInitSDL.window = nullptr;
parInitSDL.renderer = nullptr;
@ -21,7 +21,7 @@ namespace {
throw std::runtime_error(SDL_GetError());
parInitSDL.initialized = true;
SDL_Window* const win = SDL_CreateWindow(GameName, 100, 100, 640, 480, SDL_WINDOW_SHOWN);
SDL_Window* const win = SDL_CreateWindow(GameName, 100, 100, DEF_WIN_WIDTH, DEF_WIN_HEIGHT, SDL_WINDOW_SHOWN);
if (!win)
throw std::runtime_error(SDL_GetError());
parInitSDL.window = win;
@ -32,8 +32,8 @@ namespace {
parInitSDL.renderer = renderer;
}
///-------------------------------------------------------------------------
///-------------------------------------------------------------------------
///------------------------------------------------------------------------
///------------------------------------------------------------------------
void ClearIFN (InitSDLStuff& parInitSDL) {
if (parInitSDL.renderer)
SDL_DestroyRenderer(parInitSDL.renderer);
@ -44,7 +44,9 @@ namespace {
}
} //unnamed namespace
//following http://twinklebeardev.blogspot.co.uk/2012/07/lesson-1-hello-world.html
///----------------------------------------------------------------------------
///following http://twinklebeardev.blogspot.co.uk/2012/07/lesson-1-hello-world.html
///----------------------------------------------------------------------------
int main() {
std::cout << GameName << " v" << GameVersionMajor << "." << GameVersionMinor << std::endl;