sdlOption -> windowFlags
This commit is contained in:
parent
6f2408393c
commit
c14d6e6c59
@ -22,7 +22,7 @@ Config::Config(string filename)
|
||||
and this->jsonConfig["window"]["size"].asInt() == -1)
|
||||
|
||||
{
|
||||
this->sdlOption = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
this->windowFlags = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
else if(this->jsonConfig["window"]["size"].type() == Json::arrayValue
|
||||
and this->jsonConfig["window"]["size"].size() == 2
|
||||
|
@ -16,7 +16,7 @@ class Config
|
||||
int genDefConf();
|
||||
|
||||
public:
|
||||
int width = 0, height = 0, sdlOption = 0;
|
||||
int width = 0, height = 0, windowFlags = 0;
|
||||
|
||||
private:
|
||||
Json::Value jsonConfig;
|
||||
|
@ -4,7 +4,7 @@ int main()
|
||||
{
|
||||
Config config("./config.json");
|
||||
|
||||
Window window(config.width, config.height, config.sdlOption);
|
||||
Window window(config.width, config.height, config.windowFlags);
|
||||
|
||||
while(game(window) != Quit);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "window.h"
|
||||
|
||||
Window::Window(int width, int height, int sdlOption)
|
||||
Window::Window(int width, int height, int windowFlags)
|
||||
{
|
||||
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0)
|
||||
{
|
||||
@ -8,7 +8,7 @@ Window::Window(int width, int height, int sdlOption)
|
||||
this->quit();
|
||||
}
|
||||
|
||||
this->window = SDL_CreateWindow("Spirit", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, sdlOption);
|
||||
this->window = SDL_CreateWindow("Spirit", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, windowFlags);
|
||||
|
||||
if(!(this->window))
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ using namespace std;
|
||||
class Window
|
||||
{
|
||||
public:
|
||||
Window(int width, int height, int sdlOption);
|
||||
Window(int width, int height, int windowFlags);
|
||||
void clear();
|
||||
void draw();
|
||||
void update();
|
||||
|
Loading…
Reference in New Issue
Block a user