aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-26 16:09:22 +0200
committerkdx <kikoodx@paranoici.org>2023-04-26 16:09:22 +0200
commitb86c22881cd2f839fba357988410a8821a3e83dd (patch)
treee459041dbc81fb1010d7e0f4ea121981858fa250
parent0ebbc7b57e9fa1df3115c7962e6501e2f187e935 (diff)
downloadtzr-b86c22881cd2f839fba357988410a8821a3e83dd.tar.gz
game scale
-rw-r--r--headers/TZR.h1
-rw-r--r--headers/TZR_types.h1
-rw-r--r--sources/TZR_Init.c12
3 files changed, 9 insertions, 5 deletions
diff --git a/headers/TZR.h b/headers/TZR.h
index 688ba9f..6c8fa9d 100644
--- a/headers/TZR.h
+++ b/headers/TZR.h
@@ -13,6 +13,7 @@
#define TZR_Init(...) _TZR_Init(&(const TZR_Config){ \
.width=256, \
.height=224, \
+ .scale=2, \
.target_fps=60, \
.pixel_perfect=true, \
.show_cursor=false, \
diff --git a/headers/TZR_types.h b/headers/TZR_types.h
index bcb6ca5..972c45e 100644
--- a/headers/TZR_types.h
+++ b/headers/TZR_types.h
@@ -50,6 +50,7 @@ struct TZR_Config {
int _;
int width;
int height;
+ int scale;
int target_fps;
bool pixel_perfect;
bool show_cursor;
diff --git a/sources/TZR_Init.c b/sources/TZR_Init.c
index ea505b7..25d0272 100644
--- a/sources/TZR_Init.c
+++ b/sources/TZR_Init.c
@@ -39,11 +39,13 @@ _TZR_Init(const TZR_Config *config)
if (chdir_rv < 0)
return perror("TZR_Init"), -1;
- ___tzr_window = SDL_CreateWindow("TZR", SDL_WINDOWPOS_UNDEFINED,
- SDL_WINDOWPOS_UNDEFINED,
- ___tzr_config.width,
- ___tzr_config.height,
- SDL_WINDOW_RESIZABLE);
+ ___tzr_window =
+ SDL_CreateWindow("TZR",
+ SDL_WINDOWPOS_UNDEFINED,
+ SDL_WINDOWPOS_UNDEFINED,
+ ___tzr_config.width * ___tzr_config.scale,
+ ___tzr_config.height * ___tzr_config.scale,
+ SDL_WINDOW_RESIZABLE);
if (___tzr_window == NULL)
return _sdl_error();