sdlOption -> windowFlags

This commit is contained in:
elwld 2022-07-09 00:37:28 +05:00
parent 6f2408393c
commit c14d6e6c59
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);
}

View File

@ -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))
{

View File

@ -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();