Conversation
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…MoveEvent classes Signed-off-by: szdytom <szdytom@qq.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a JavaScript-driven “ScriptedScene” pipeline backed by QuickJS bindings, allowing scenes to be authored in TypeScript/JavaScript and rendered via a command-buffer style drawing API.
Changes:
- Adds a new QuickJS runtime layer (
wf::js) with bindings for textures, colors, draw commands, and input events. - Adds
wf::ScriptedScenethat loads/evals JS assets, exposes awaveforgenamespace, and supportssetupScene()+commitDraw()from scripts. - Adds TypeScript declarations + a test script, plus an esbuild-based Makefile and asset-manifest wiring for JS assets.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| ts-src/waveforge.d.ts | Declares the waveforge script API for TS authoring. |
| ts-src/test_scene.ts | Adds a sample scripted scene exercising the new API. |
| src/scenes/scripted_scene.cpp | Implements ScriptedScene and binds the waveforge namespace into QuickJS. |
| src/runtime/texture.cpp | Implements QuickJS binding for Texture. |
| src/runtime/helper.h | Adds helper macros for QuickJS getters/setters/methods. |
| src/runtime/hacks.h | Adds QuickJS internal-structure helpers + property entry builders. |
| src/runtime/event.cpp | Implements QuickJS bindings for keyboard/mouse event objects. |
| src/runtime/engine.cpp | Implements QuickJS engine/context lifecycle and class binding helpers. |
| src/runtime/draw.cpp | Implements QuickJS bindings for draw commands + command list iteration and rendering. |
| src/runtime/color.cpp | Implements QuickJS binding for Color + parsing/serialization. |
| src/main.cpp | Adds --debug-js-scene to boot directly into a scripted scene. |
| src/assets.cpp | Adds a new asset loader type js that loads JS source text. |
| Makefile | Adds esbuild-driven TS→JS bundling into assets/bundled-js. |
| include/wforge/scene.h | Declares the new wf::ScriptedScene scene type. |
| include/wforge/runtime.h | Introduces the public QuickJS binding/runtime API and binding types. |
| include/wforge/assets.h | Adds wf::Script asset type for JS source storage. |
| docs/bindings.md | Documents how to add new QuickJS binding classes. |
| CMakeLists.txt | Adds new runtime + scripted scene sources to the build. |
| cmake/deps.cmake | Updates QuickJS submodule note to reference the new hacks header path. |
| assets/README.md | Documents the new js asset type. |
| assets/manifest.json | Adds a JS asset entry for the test scene bundle. |
| .gitignore | Ignores generated assets/bundled-js output directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…ipt loading error handling Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…trol Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…peScript definitions Signed-off-by: szdytom <szdytom@qq.com>
…larity and maintainability Signed-off-by: szdytom <szdytom@qq.com>
…nder logic Signed-off-by: szdytom <szdytom@qq.com>
…e TypeScript definitions Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…initions Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…mline rendering methods Signed-off-by: szdytom <szdytom@qq.com>
… in layout Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…ions Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
… efficiency Signed-off-by: szdytom <szdytom@qq.com>
…context Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…aveData class Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Introduce hover tracking in renderer/host-config (dispatchHoverChange/ dispatchHoverLeave), propagate onPointerEnter/onPointerLeave/onPointerMove, and wire mousemove/mouseleave listeners. Add mouseenter/mouseleave support in scripted_scene and types, and add hover visuals/state to Button. Small include and lint config tweaks Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
115ada4 to
6fd10b0
Compare
Set up Node.js in CI (install/build and lint TypeScript). Add copy_bundled_js in pack.py to include only files listed in the esbuild .metafile and minify JSON outputs. Update build.mjs to emit a simplified .metafile.json (outputs only) plus a full metafile. Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.