mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
Fixed Windows version
This commit is contained in:
parent
7aa0ca5125
commit
48da30a25f
|
@ -29,7 +29,7 @@ fn main() {
|
||||||
|
|
||||||
Status
|
Status
|
||||||
------
|
------
|
||||||
Currently Mac has been tested. Windows and Linux will be tested and verified soon.
|
Currently Mac and Windows has been tested. Linux will be tested and verified soon.
|
||||||
|
|
||||||
|
|
||||||
Build instructions
|
Build instructions
|
||||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -3,14 +3,23 @@ use std::ffi::CString;
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
use libc::{c_char, c_int, c_void};
|
use libc::{c_char, c_int, c_void};
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
#[link(name = "Cocoa", kind = "framework")]
|
#[link(name = "Cocoa", kind = "framework")]
|
||||||
#[link(name = "minifb_native")]
|
|
||||||
extern {
|
extern {
|
||||||
fn mfb_open(name: *const c_char, width: c_int, height: c_int) -> c_int;
|
fn mfb_open(name: *const c_char, width: c_int, height: c_int) -> c_int;
|
||||||
fn mfb_update(buffer: *mut c_void) -> c_int;
|
fn mfb_update(buffer: *mut c_void) -> c_int;
|
||||||
fn mfb_close();
|
fn mfb_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
#[link(name = "gdi32")]
|
||||||
|
extern {
|
||||||
|
fn mfb_open(name: *const c_char, width: c_int, height: c_int) -> c_int;
|
||||||
|
fn mfb_update(buffer: *mut c_void) -> c_int;
|
||||||
|
fn mfb_close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Open up a window
|
/// Open up a window
|
||||||
///
|
///
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#include <MiniFB.h>
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue