mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Added Retina support
Closes https://github.com/AngryLawyer/rust-sdl2/issues/164
This commit is contained in:
@@ -20,3 +20,5 @@ src/sdl2/generated/
|
||||
src/demo/main
|
||||
doc/
|
||||
target/
|
||||
|
||||
Cargo.lock
|
||||
|
||||
@@ -165,6 +165,7 @@ pub mod ll {
|
||||
pub fn SDL_IsScreenSaverEnabled() -> SDL_bool;
|
||||
pub fn SDL_EnableScreenSaver();
|
||||
pub fn SDL_DisableScreenSaver();
|
||||
pub fn SDL_GL_GetDrawableSize(window: *const SDL_Window, w: *const c_int, h: *const c_int);
|
||||
pub fn SDL_GL_LoadLibrary(path: *const c_char) -> c_int;
|
||||
pub fn SDL_GL_GetProcAddress(procname: *const c_char) -> Option<extern "system" fn()>;
|
||||
pub fn SDL_GL_UnloadLibrary();
|
||||
@@ -469,6 +470,13 @@ impl Window {
|
||||
(w as int, h as int)
|
||||
}
|
||||
|
||||
pub fn get_drawable_size(&self) -> (int, int) {
|
||||
let w: c_int = 0;
|
||||
let h: c_int = 0;
|
||||
unsafe { ll::SDL_GL_GetDrawableSize(self.raw, &w, &h) };
|
||||
(w as int, h as int)
|
||||
}
|
||||
|
||||
pub fn set_minimum_size(&self, w: int, h: int) {
|
||||
unsafe { ll::SDL_SetWindowMinimumSize(self.raw, w as c_int, h as c_int) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user