Commit graph

1481 commits

Author SHA1 Message Date
Stephen Gutekanst
5b4b31de13 glfw: update core APIs to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
2db01e1a32 glfw: update native APIs to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
199a3dce78 glfw: update windowing API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
1dd27fd904 glfw: update monitor API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
174d244433 glfw: update cursor API to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
4f61a4e3c6 glfw: update build system to glfw@master
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
131caa4cb7 glfw: ensure upstream submodule is cloned
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
214d4cfd6a glfw: upgrade to GLFW@master; add upstream submodule https://github.com/hexops/glfw
This upgrades us to the latest master (pre-release) version of GLFW which has our patches
for undefined behavior in Zig, effectively moving us off of our temporary fork. We now track
GLFW upstream at the revision documented in https://github.com/hexops/glfw/blob/main/VERSION

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Cai Bingjun <1945458160@qq.com>
2022-06-11 17:39:25 -07:00
Stephen Gutekanst
3dd8d028d9 glfw: stop vendoring upstream sources
Moving to the same model we use elsewhere: we now have https://github.com/hexops/glfw
which is a tiny repository with only the sources needed to compile/build/test GLFW on
every platform. It's just the upstream repository at a specific commit, recorded in
the `VERSION` file.

Helps hexops/mach#343

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-11 17:39:25 -07:00
iddev5
47286508e3 mach: wasm: Implement fullscreen support for browser platform 2022-06-11 16:00:02 -07:00
iddev5
3dc131d4fa mach: Implement fullscreen window support for native platforms (glfw)
This feature remembers the last position of window before turning to
fullscreen.
2022-06-11 16:00:02 -07:00
iddev5
d3feaed383 glfw: Window: use u32 values for params in setMonitor method 2022-06-11 16:00:02 -07:00
Ali Chraghi
1c6e796df6 freetype: increase LoadFlags max size 2022-06-11 15:53:54 -07:00
Ali Chraghi
c02a3fbaf4 freetype::harfbuzz: complete buffer binding 2022-06-11 15:53:54 -07:00
Ali Chraghi
ffc7c3aa68 freetype: fix function namings
some functions should start with `get`
2022-06-11 15:53:54 -07:00
Stephen Gutekanst
1c0930b404
README: fix animated image widths 2022-06-11 00:55:51 -07:00
Stephen Gutekanst
6b886ee905
README: clean up / fix image width / dark theme 2022-06-11 00:53:50 -07:00
Stephen Gutekanst
c5432a9353 mach: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 16:56:40 -07:00
Stephen Gutekanst
70283bfcb4 ecs: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 16:56:12 -07:00
Stephen Gutekanst
7d7eb807f8 freetype: fix failing test / do not return pointer to stack
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:42:52 -07:00
Stephen Gutekanst
80157a99fc freetype: update upstream to include OT sources
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:42:14 -07:00
Stephen Gutekanst
334ed5c25f ecs: switch from ArrayList per-table-per-component-set -> single-[]u8-per-table
This switches our ECS over to manually managed memory (1 `[]u8` per archetype table,
with multiple column arrays packed into it - dealing with padding/alignment ourselves)
rather than the prior 1 `ArrayList(Component)` per component in an archetype table.

This idea was discussed in depth in [#ecs:matrix.org](https://matrix.to/#/#ecs:matrix.org)
(thanks Levy!) Notable advantages from my POV:

1. This means we don't need an `ErasedComponentStorage` interface, which is nice.
2. It means component storage does not have to have a Zig type. It could e.g. in theory enable
   the ECS to be usable from other languages (C, WebAssembly plugins, etc.) with component types
   defined in those languages in the future.
3. It reduces some overhead `ArrayList` has: slice ptr+len+capacity integers per component
   array per table
4. It guarantees component arrays are contiguous memory, rather than relying on the allocator
   to hopefully provide that (may not hold true in multi-threaded large-allocation situations.)
5. It means we could easily optimize for tables that have very few components by allocating exact
   memory for them (could've done this with `ArrayList` too, but now it's more likely the
   allocation are larger and thus more reusable by future archetype tables.) This could be quite
   important because one can imagine ending up with many small archetype tables.

Overall seems like the right thing to do, so we're doing it.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:24:27 -07:00
Stephen Gutekanst
5fd5638df0 ecs: add pkg declaration, remove static library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:24:27 -07:00
Stephen Gutekanst
14ec786c62 ecs: remove incomplete sparse storage implementation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:24:27 -07:00
Stephen Gutekanst
53a1a2e9fd examples/gkurve: update to latest freetype API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-06-10 13:24:02 -07:00
PiergiorgioZagaria
112b837cae examples/gkurve: fixed logic for points inside polygon 2022-06-10 13:24:02 -07:00
PiergiorgioZagaria
c1b3996b63 examples/gkurve: support for UTF32 characters 2022-06-10 13:24:02 -07:00
PiergiorgioZagaria
98138dd2fa examples/gkurve: initial commit for resizable_label 2022-06-10 13:24:02 -07:00
David Vanderson
ade26b24b1 ditch setTimeout 2022-06-10 12:57:31 -07:00
David Vanderson
4eb872944a wait event stuff for wasm backend 2022-06-10 12:57:31 -07:00
David Vanderson
0f7c34a5ad review updates 2022-06-10 12:57:31 -07:00
David Vanderson
9354c178eb native: switch to setWaitEvent() 2022-06-10 12:57:31 -07:00
Jamie Brandon
15c71f5135 freetype: Avoid dereferencing null bitmap buffer.
For some characters (eg \r) the returned glyph will have .{.rows = 0, .width=0, .pitch = 0, .buffer = null}. In zig null[0..0] causes a panic rather than returning an empty slice.
2022-06-10 12:55:19 -07:00
Ali Chraghi
86053d9969 freetype: update upstream 2022-06-10 12:53:10 -07:00
Ali Chraghi
cdce9fb223 freetype: sync harfbuzz sources with upstream 2022-06-10 12:53:10 -07:00
Ali Chraghi
9c585693b1 freetype: find and fix bugs by fixing refAllDecls() 2022-06-10 12:53:10 -07:00
Ali Chraghi
2b7527b028 freetype:harfbuzz: 100% blob and 50% buffer binding 2022-06-10 12:53:10 -07:00
Ali Chraghi
d98bfab809 freetype: rename freetype_pkg to pkg 2022-06-10 12:53:10 -07:00
iddev5
772a821ce1 mach: wasm: Implement setShouldClose for wasm 2022-06-08 07:31:53 -07:00
iddev5
2d53b8bdfd examples: Do not return bool on update()
Also replaced all ``return false;`` usages with Engine.setShouldClose(true).
2022-06-08 07:31:53 -07:00
iddev5
40c0659cc9 mach: App.update will now return !void instead of !bool
In order to close the application, there is already
Engine.setShouldClose() which would roughly do the same thing.
2022-06-08 07:31:53 -07:00
dweiller
3234b6c0dd ecs: fix pointer invalidation in set/removeComponent 2022-06-07 19:26:40 -07:00
dweiller
997cf7d446 ecs: fix argument order in copy() calls 2022-06-07 19:26:40 -07:00
Ali Chraghi
82e1990009 freetype: init harfbuzz binding 2022-06-07 19:23:33 -07:00
Ali Chraghi
04a0a79ef6 freetype: ~99% Core-API Coverage
- breaking structure changes
- optimazed examples
- more tests
2022-06-07 19:23:33 -07:00
iddev5
db377459c4 mach: Listen to resize event for canvas and thus store window and
framebuffer size
2022-06-06 00:37:38 -07:00
iddev5
99dc10e58a mach: wasm: Implement mouse press, release, motion and scroll events 2022-06-05 13:34:24 -07:00
iddev5
efe90fc64f mach: Rename scroll -> mouse_scroll and use f32 for offsets 2022-06-05 13:34:24 -07:00
David Vanderson
a2a6c2a288
mach: add mouse motion and mouse button events (#325)
* add mouse motion and mouse button events
* add scroll events
* switch from button/action to mouse_press and mouse_release events
2022-06-04 06:29:23 -07:00
iddev5
7b395759b7 examples, shaderexp: update to new options and size limit API 2022-06-01 23:45:56 -07:00