Practical Tools for Simple Design
Loading...
Searching...
No Matches
PTSD_Config Struct Reference

#include <config.hpp>

Static Public Attributes

static std::string TITLE
 
static int WINDOW_POS_X
 
static int WINDOW_POS_Y
 
static unsigned int WINDOW_WIDTH
 
static unsigned int WINDOW_HEIGHT
 
static Util::Logger::Level DEFAULT_LOG_LEVEL
 
static unsigned int FPS_CAP
 FPS limit. More...
 

Friends

class Core::Context
 

Detailed Description

To use, place a config.json file either in the current directory (.) or the parent directory (..). If both directories contain the file, the one in the current directory will be read.

Example directory structure:

├── build/
│ ├── YOUR_GAME
│ └── config.json <- place here
└── config.json <- or here

The config.json file can contain any number of configurations, each in the following format:

{
"title": "<string, default is 'Practice-Tools-for-Simple-Design'>",
"window_pos_x": <int, default is SDL_WINDOWPOS_UNDEFINED (wherever the OS places the window)>,
"window_pos_y": <int, default is SDL_WINDOWPOS_UNDEFINED (wherever the OS places the window)>,
"window_width": <int, default is 1280>,
"window_height": <int, default is 720>,
"default_log_level": <int in range [0, 5], default is 2 (Util::Logger::Level::INFO)>,
"fps_cap": <int, default is 60>
}

If a key is not present in the config.json, the default value will be used.

Member Data Documentation

◆ FPS_CAP

unsigned int PTSD_Config::FPS_CAP
static

FPS limit.

Set value to 0 to turn off FPS cap


The documentation for this struct was generated from the following file: