Dolda2000 GitWeb
/
kaka
/
rust-sdl-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed global use of SCREEN_WIDTH/HEIGHT
[kaka/rust-sdl-test.git]
/
src
/
main.rs
diff --git
a/src/main.rs
b/src/main.rs
index
877d367
..
256cc3c
100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-10,14
+10,14
@@
mod common;
mod boll;
mod sprites;
mod boll;
mod sprites;
-const SCREEN_WIDTH: u
32
= 1280;
-const SCREEN_HEIGHT: u
32 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u32
;
+const SCREEN_WIDTH: u
16
= 1280;
+const SCREEN_HEIGHT: u
16 = (SCREEN_WIDTH as f64 * (1440.0 / 2560.0)) as u16
;
fn main() {
println!("starting...");
let mut app = App::new()
fn main() {
println!("starting...");
let mut app = App::new()
- .with_resolution(SCREEN_WIDTH
as u16, SCREEN_HEIGHT as u16
)
- .with_state(Box::new(ActiveState::new()))
+ .with_resolution(SCREEN_WIDTH
, SCREEN_HEIGHT
)
+ .with_state(Box::new(ActiveState::new(
(SCREEN_WIDTH as u32, SCREEN_HEIGHT as u32)
)))
.with_title("SDL test")
.build()
.unwrap();
.with_title("SDL test")
.build()
.unwrap();