Merge pull request #165 from bvssvni/master

Added Retina support
This commit is contained in:
Tony Aldridge
2014-08-16 17:42:43 +01:00
3 changed files with 11 additions and 0 deletions
+2
View File
@@ -20,3 +20,5 @@ src/sdl2/generated/
src/demo/main
doc/
target/
Cargo.lock
+1
View File
@@ -353,6 +353,7 @@ impl AudioCVT {
pub fn convert(&self, src: CVec<u8>) -> SdlResult<CVec<u8>> {
//! Convert audio data to a desired audio format.
use std::slice::Slice;
unsafe {
if (*self.raw).needed != 1 {
return Err("no convertion needed!".into_string())
+8
View File
@@ -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) }
}