-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marek Maškarinec <[email protected]>
- Loading branch information
1 parent
1105be8
commit 5980a92
Showing
8 changed files
with
4,013 additions
and
4,031 deletions.
There are no files selected for viewing
Submodule sokol
updated
2 files
+43 −40 | .github/workflows/gen_bindings.yml | |
+7 −8 | .github/workflows/main.yml |
Submodule umka
updated
18 files
+1 −1 | README.md | |
+5 −5 | doc/lang.md | |
+1 −1 | examples/lisp/lex.um | |
+1 −1 | examples/raytracer/raytracer.um | |
+1 −1 | playground/umka.js | |
+1 −1 | runtime/std.um | |
+3 −3 | runtime/utf8.um | |
+0 −3 | src/umka_decl.c | |
+15 −16 | src/umka_expr.c | |
+7 −7 | src/umka_gen.c | |
+0 −1 | src/umka_gen.h | |
+4 −4 | src/umka_runtime_src.h | |
+1 −1 | src/umka_stmt.c | |
+0 −10 | src/umka_types.h | |
+36 −35 | src/umka_vm.c | |
+3 −3 | src/umka_vm.h | |
+8 −4 | tests/fibers.um | |
+4 −2 | tests/tour.um |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import ( | ||
"canvas.um" | ||
"th.um" | ||
"window.um" | ||
"rt.um" | ||
"std.um" | ||
) | ||
|
||
fn init*() { | ||
window::setup("Render target sample", 640, 480) | ||
|
||
target, err := rt::mk(th::Vf2{10, 10}, .nearest) | ||
std::exitif(err) | ||
|
||
window::onFrame.register(|target| { | ||
std::exitif(target.begin()) | ||
|
||
r := 5 | ||
a := th::time / 2000.0 * 360 | ||
s := th::Vf2{ r, 0 }.rotated({ r, r }, a) | ||
e := th::Vf2{ r, 2 * r }.rotated({ r, r }, a) | ||
canvas::drawLine(th::black, s, e, 1) | ||
|
||
std::exitif(target.end()) | ||
|
||
target.toImage().draw({ | ||
s: { 64, 48 } | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.