Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Feb 6, 2022
1 parent 929bb76 commit d017fca
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
name = "deno_sdl2"
version = "0.2.0"
version = "0.3.0"
edition = "2018"
description = "SDL2 Bindings to Deno"
license = "MIT"
repository = "https://github.com/littledivy/deno_sdl2"

[features]
Expand All @@ -26,4 +28,4 @@ git = "https://github.com/microsoft/vcpkg"
rev = "025e564979cc01d0fbc5c920aa8a36635efb01bb"

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md", dependencies = ["yasm", "sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx"] }
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md", dependencies = ["yasm", "sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf", "sdl2-gfx"] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You need:
- `pkg-config` (on *nix) => `brew install pkg-config`

```bash
deno install -Afq -n deno_bindgen https://raw.githubusercontent.com/littledivy/deno_bindgen/main/cli.ts
deno install -Afq -n deno_bindgen https://deno.land/x/deno_bindgen/cli.ts
cargo install cargo-vcpkg

# build vcpkg dependencies
Expand Down
78 changes: 39 additions & 39 deletions bindings/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ const _lib = await prepare(opts, {
nonblocking: false,
},
});
export type CanvasColor = {
r: number;
g: number;
b: number;
a: number;
};
/**
* https://docs.rs/sdl2/0.34.5/sdl2/video/struct.WindowBuilder.htm
* Window Builder configuration
Expand All @@ -88,6 +94,39 @@ export type OptionRectangle = {
width: number | undefined | null;
height: number | undefined | null;
};
export type CanvasFontPartial =
| {
solid: {
color: CanvasColor;
};
}
| {
shaded: {
color: CanvasColor;
background: CanvasColor;
};
}
| {
blended: {
color: CanvasColor;
};
};
export type CanvasFontSize =
| "normal"
| "bold"
| "italic"
| "underline"
| "strikethrough";
export type Rectangle = {
x: number;
y: number;
width: number;
height: number;
};
export type CanvasPoint = {
x: number;
y: number;
};
export type CanvasEvent =
| "quit"
| "app_terminating"
Expand Down Expand Up @@ -342,52 +381,13 @@ export type CanvasTask =
opacity: number;
};
};
export type CanvasPoint = {
x: number;
y: number;
};
export type Rectangle = {
x: number;
y: number;
width: number;
height: number;
};
/**
* https://rust-sdl2.github.io/rust-sdl2/sdl2/render/struct.CanvasBuilder.html
* Canvas Builder configuration
*/
export type CanvasOptions = {
software: boolean;
};
export type CanvasFontPartial =
| {
solid: {
color: CanvasColor;
};
}
| {
shaded: {
color: CanvasColor;
background: CanvasColor;
};
}
| {
blended: {
color: CanvasColor;
};
};
export type CanvasFontSize =
| "normal"
| "bold"
| "italic"
| "underline"
| "strikethrough";
export type CanvasColor = {
r: number;
g: number;
b: number;
a: number;
};
export function do_task(a0: CanvasTask) {
const a0_buf = encode(JSON.stringify(a0));
let rawResult = _lib.symbols.do_task(a0_buf, a0_buf.byteLength);
Expand Down

0 comments on commit d017fca

Please sign in to comment.