projects
/
pong.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9b5a08
)
fixed window scaling
author
Matthew Owens
<matthew@owens.tech>
Fri, 2 Oct 2020 11:45:44 +0000
(12:45 +0100)
committer
Matthew Owens
<matthew@owens.tech>
Fri, 2 Oct 2020 11:45:44 +0000
(12:45 +0100)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index
d902d0b
..
e686468
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-153,8
+153,10
@@
static bool init()
windowSize.x = dm.w;
windowSize.y = dm.h;
- windowScale.x = windowSize.x / baseWindowSize.x;
- windowScale.y = windowSize.y / baseWindowSize.y;
+ windowScale.x = (float)windowSize.x / (float)baseWindowSize.x;
+ windowScale.y = (float)windowSize.y / (float)baseWindowSize.y;
+
+ COUT("window scale(%f, %f)", windowScale.x, windowScale.y);
window = SDL_CreateWindow("pong",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,