Skip to content

Commit

Permalink
feat: link vexDisplayFontNamedSet
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed Nov 27, 2024
1 parent 7b15adf commit d918473
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/runtime/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,8 @@ pub fn link(store: &mut Store<Data>, instance: &mut Instance<Data>) -> anyhow::R
fn vexDisplayCircleClear(xc: i32, yc: i32, radius: i32);
fn vexDisplayCircleFill(xc: i32, yc: i32, radius: i32);
fn vexDisplayTextSize(n: u32, d: u32);
// fn vexDisplayFontNamedSet(pFontName: *const c_char);
fn vexDisplayForegroundColorGet() -> u32;
fn vexDisplayBackgroundColorGet() -> u32;
// fn vexDisplayStringWidthGet(pString: *const c_char) -> i32;
// fn vexDisplayStringHeightGet(pString: *const c_char) -> i32;
fn vexDisplayClipRegionSet(x1: i32, y1: i32, x2: i32, y2: i32);
fn vexDisplayRender(bVsyncWait: bool, bRunScheduler: bool);
fn vexDisplayDoubleBufferDisable();
Expand Down Expand Up @@ -208,5 +205,16 @@ pub fn link(store: &mut Store<Data>, instance: &mut Instance<Data>) -> anyhow::R
},
)?;

instance.link_closure(
&mut *store,
"vex",
"vexDisplayFontNamedSet",
|mut ctx, string: i32| {
let string = get_cstring(&mut ctx, string);
unsafe { vex_sdk::vexDisplayFontNamedSet(string.as_ptr()) };
Ok(())
},
)?;

Ok(())
}

0 comments on commit d918473

Please sign in to comment.