}
impl RaylibGame {
+ #[cfg(not(target_arch = "wasm32"))]
+ fn native_setup() {
+ unsafe {
+ ffi::SetTargetFPS(60);
+ }
+ }
+
+ #[cfg(target_arch = "wasm32")]
+ fn native_setup() {}
+
pub fn new_boxed(width: u32, height: u32) -> Box<dyn GameInterface> {
unsafe {
let string = "One and All LD45\0";
string.as_ptr() as *const c_char,
);
}
+ Self::native_setup();
let mut self_unboxed = Self {
images: HashMap::new(),
fonts: HashMap::new(),
)?;
let mut camera = window.get_gi_mut().get_default_camera()?;
- camera.set_view(Rectangle {
- x: 0.0,
- y: 0.0,
- w: WIDTH_F,
- h: HEIGHT_F,
- })?;
+ camera.set_view_xy(0.0, 0.0)?;
Ok(Self {
s_boom,
s_get,