iddev5
02b9048734
examples: update to new event-based input method
2022-05-20 09:14:32 -07:00
iddev5
f1e7c10fbb
mach: remove Action enum and all references to it
2022-05-20 09:14:32 -07:00
iddev5
7486b0ebea
mach: Implement key input handling as event loop
...
This commit changes the former callback based design to handle key input
(GLFW-like) to an event loop based design (SDL-like). This uses a
TailQueue to store the events from inside of standard glfw callbacks.
This Queue is then popped while polling, thereby emulating event loop.
Removes from Engine the function: ``setKeyCallback`` and adds the
function: ``pollEvent`` which may return an event or null.
This change was done for two reasons:
1) Removing dependence of Engine on App. This was a circular dependency
and a genuine bad design.
2) Solve the recent regression due to the same which was (i) preventing
using types declared in Engine.zig and (ii) preventing usage of
multiple source files in an application.
Currently only key press and release events are implemented as these are
the ones currently used in examples.
2022-05-20 09:14:32 -07:00
Stephen Gutekanst
92028a11ef
examples/gkurve: take into account high density displays
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-20 08:56:47 -07:00
PiergiorgioZagaria
a4e8de2a83
examples: fix depth texture recreation
2022-05-20 08:52:14 -07:00
iddev5
3bb45c75a1
mach: introduce cross platform Timer abstraction
...
This Timer uses std.time.Timer as backing timer in native platforms, and
will use custom timers for special platforms (wasm, android?, ios?).
Unlike std.time.Timer, its primary API is focused on floats. Also meant
to provides some convenient functions alongside base ones.
Follows std.time.Timer API, but methods by default return f32 i.e
non-precise variant with precise variants available returning u64.
2022-05-17 23:56:41 -07:00
Stephen Gutekanst
be935c64ef
examples/gkurve: change window size to default
2022-05-15 10:36:08 -07:00
iddev5
657091ed65
mach: Reorganised native backend files, moved structs and fixed circular
...
dependency
2022-05-15 10:36:08 -07:00
PiergiorgioZagaria
2df0bc2786
examples/gkurve: moved vertex uniform data to vertex buffer and added view ( #277 )
2022-05-15 10:34:09 -07:00
Stephen Gutekanst
34e019a212
examples/gkurve: use equadistant triangles for easier debugging
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-15 02:55:23 -07:00
Stephen Gutekanst
e35b86ad25
examples/gkurve: calculate barycentric vertex coordinates in shader
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-15 02:55:23 -07:00
Stephen Gutekanst
dae283734f
examples/gkurve: cleanup code formatting
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-15 02:55:23 -07:00
Stephen Gutekanst
1562232871
examples/gkurve: use orthographic projection + pixel units
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-15 02:55:23 -07:00
Stephen Gutekanst
af608151e9
examples/gkurve: simplify fragment shader, use barycentric coordinates
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-14 13:23:45 -07:00
iddev5
8b46f46cf8
mach: Create binding methods for all glfw methods in use and update
...
examples
2022-05-13 16:17:18 -07:00
iddev5
9106a9839d
examples: remove global state workaround in advanced-gen-texture-light
2022-05-09 08:08:01 -07:00
iddev5
1f95bd48df
examples: use engine.core.setKeyCallback() instead of accessing glfw directly
2022-05-09 08:08:01 -07:00
iddev5
5396769227
mach: implement all glfw -> mach key mappings
2022-05-09 08:08:01 -07:00
iddev5
71b7473ee7
mach: implement key press/release callback
2022-05-09 08:08:01 -07:00
iddev5
7a392b2780
mach: Add enums for keys and actions
2022-05-09 08:08:01 -07:00
Michal Ziulek
5a2aebb14b
gpu: correct sending of pointer to a local var to a callback function ( #271 )
2022-05-08 15:04:25 -07:00
PiergiorgioZagaria
a1daf399a3
examples: created gkurve example
2022-05-08 15:02:39 -07:00
PiergiorgioZagaria
ddf8704559
examples: fixed uniform buffer release and unused var
2022-05-08 09:48:05 -07:00
Stephen Gutekanst
f97af80410
README: fix typo
...
Closes #268
2022-05-07 09:18:19 -07:00
Stephen Gutekanst
7ea0d84218
Revert "gpu-dawn: update to latest binary release" (CI broken)
...
This reverts commit c02424c435 .
2022-05-05 12:35:35 -07:00
Release automation
c02424c435
gpu-dawn: update to latest binary release
2022-05-04 19:55:25 +00:00
iddev5
5861893752
CI: check compilation of all examples
2022-05-04 11:53:37 -07:00
d3m1gd
09f3adf2b4
examples: fix typo
2022-05-04 11:53:16 -07:00
iddev5
8904536632
mach: comptime interface-like implementation of engine cores
2022-05-01 17:07:29 -07:00
iddev5
2b978a6883
examples: fix unwanted fractal cube resource releases causing validation error
2022-05-01 11:46:43 -07:00
Lee Cannon
4570838304
Update to latest Zig master (0.10.0-dev.2017+a0a2ce92c) ( #261 )
...
* use `@ceil` instead of `std.math.ceil`
* `ChildProcess.init` does not allocate anymore
* update CI zig version
* examples: temporarily switch to fork of zigimg compatible with zig-master
Commands executed:
```
git submodule set-url -- examples/libs/zigimg https://github.com/slimsag/zigimg
git submodule set-branch --branch zig-master -- examples/libs/zigimg
git submodule update --init --remote examples/libs/zigimg
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2022-05-01 11:44:27 -07:00
Michal Ziulek
0e64b9608c
gpu: 'dynamic_offsets' should be '?[] const u32' everywhere. ( #260 )
2022-04-30 08:57:10 -07:00
iddev5
e1192877c3
build: compile examples and applications on demand
...
Without this change, anytime a dependency is modified, all the examples
and applications are rebuilt before tring to run any of them. The
problem with this approach is that it leads to long compile times which
will keep on increasing as more and more examples are added.
2022-04-30 01:10:56 -07:00
Silver
ea76aa0268
gpu: fix store_op
2022-04-29 13:10:04 -07:00
iddev5
7c518f7bd6
shaderexp: port to new API
2022-04-29 13:06:42 -07:00
iddev5
218a6a5c08
examples: port to new API
2022-04-29 13:06:34 -07:00
iddev5
5c984d9795
mach: finalizing changes for now
2022-04-29 12:48:47 -07:00
iddev5
5249e72408
example: finalize triangle example to new API
2022-04-29 12:48:47 -07:00
iddev5
60fd89ec45
mach: make App.options optional
2022-04-29 12:48:47 -07:00
iddev5
7598c2d7b8
mach: Enable App.resize() and verify if all necessary functions are exported by App
2022-04-29 12:48:47 -07:00
iddev5
2aedc4ca01
mach: implement App struct in terms of unified entry point
2022-04-29 12:48:47 -07:00
iddev5
3e87b383d2
examples: workaround fix for testing unified entry point
2022-04-29 12:48:47 -07:00
iddev5
d99359421e
mach: begin unified entry point interface
2022-04-29 12:48:47 -07:00
iddev5
ffcd5dfaa8
examples: fix incorrect release of resources in fractal-cube
2022-04-29 12:45:04 -07:00
Stephen Gutekanst
69049da970
correct submodule remote
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 20:14:51 -07:00
Stephen Gutekanst
4a5b37787d
correct asset submodule path
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 20:10:17 -07:00
Stephen Gutekanst
d6f1560afd
examples: ensure zigimg & assets submodules are cloned
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 20:00:40 -07:00
PiergiorgioZagaria
d6dad96059
examples: added fractal-cube example
2022-04-24 23:24:34 +00:00
Stephen Gutekanst
d0d0db8725
examples: add textured-cube example
...
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 16:07:59 +00:00
Stephen Gutekanst
f8e7f96a4a
gpu: correct RenderPassDepthStencilAttachment default values
...
Helps hexops/mach#182
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-24 16:07:59 +00:00