Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ jobs:
include: ${{ fromJSON(github.event_name == 'pull_request' && '[{"os":"ubuntu-latest","rust":"stable","lane":"full","run_windows_native_clippy":false},{"os":"ubuntu-latest","rust":"nightly","lane":"smoke","run_windows_native_clippy":false},{"os":"macos-latest","rust":"stable","lane":"smoke","run_windows_native_clippy":false},{"os":"windows-latest","rust":"stable","lane":"clippy-only","run_windows_native_clippy":true}]' || '[{"os":"ubuntu-latest","rust":"stable","lane":"full","run_windows_native_clippy":false},{"os":"macos-latest","rust":"stable","lane":"full","run_windows_native_clippy":false},{"os":"windows-latest","rust":"stable","lane":"full","run_windows_native_clippy":true},{"os":"ubuntu-latest","rust":"nightly","lane":"smoke","run_windows_native_clippy":false},{"os":"macos-latest","rust":"nightly","lane":"smoke","run_windows_native_clippy":false}]') }}

steps:
- name: Free disk space (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.lane == 'full'
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force || true
df -h /

- uses: actions/checkout@v6

- name: Download shared codegen artifact
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ sdks/c/tests/build/

# Claude worktrees (ephemeral, per-session)
.claude/worktrees/
.worktrees/
.mcp.json

# Gradle build artifacts
Expand Down
123 changes: 122 additions & 1 deletion codegen/ffi_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,113 @@
"return_type": "bool",
"is_unsafe": true
},
"goud_input_gamepad_axis": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"axis: u32"
],
"return_type": "f32",
"is_unsafe": false
},
"goud_input_gamepad_button_just_pressed": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"button: u32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_input_gamepad_button_just_released": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"button: u32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_input_gamepad_button_pressed": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"button: u32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_input_gamepad_connected": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_input_gamepad_connected_count": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId"
],
"return_type": "u32",
"is_unsafe": false
},
"goud_input_gamepad_left_stick": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"out_x: *mut f32",
"out_y: *mut f32"
],
"return_type": "bool",
"is_unsafe": true
},
"goud_input_gamepad_left_trigger": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32"
],
"return_type": "f32",
"is_unsafe": false
},
"goud_input_gamepad_right_stick": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"out_x: *mut f32",
"out_y: *mut f32"
],
"return_type": "bool",
"is_unsafe": true
},
"goud_input_gamepad_right_trigger": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32"
],
"return_type": "f32",
"is_unsafe": false
},
"goud_input_gamepad_set_vibration": {
"source_file": "ffi/input/gamepad.rs",
"params": [
"context_id: GoudContextId",
"gamepad_id: u32",
"intensity: f32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_input_get_mouse_delta": {
"source_file": "ffi/input/mouse.rs",
"params": [
Expand Down Expand Up @@ -3098,6 +3205,20 @@
"return_type": "bool",
"is_unsafe": false
},
"goud_renderer3d_configure_fog_linear": {
"source_file": "ffi/renderer3d/environment/mod.rs",
"params": [
"context_id: GoudContextId",
"enabled: bool",
"start_distance: f32",
"end_distance: f32",
"r: f32",
"g: f32",
"b: f32"
],
"return_type": "bool",
"is_unsafe": false
},
"goud_renderer3d_configure_grid": {
"source_file": "ffi/renderer3d/environment/mod.rs",
"params": [
Expand Down Expand Up @@ -6404,5 +6525,5 @@
"is_unsafe": false
}
},
"total_count": 649
"total_count": 661
}
16 changes: 15 additions & 1 deletion codegen/ffi_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@
"goud_renderer3d_set_grid_enabled": {},
"goud_renderer3d_configure_skybox": {},
"goud_renderer3d_configure_fog": {},
"goud_renderer3d_configure_fog_linear": {},
"goud_renderer3d_set_fog_enabled": {},
"goud_renderer3d_set_frustum_culling_enabled": {},
"goud_renderer3d_set_skinning_mode": {},
Expand Down Expand Up @@ -763,7 +764,20 @@
"goud_input_mouse_button_just_released": {},
"goud_input_get_mouse_position": {},
"goud_input_get_mouse_delta": {},
"goud_input_get_scroll_delta": {}
"goud_input_get_scroll_delta": {},
"goud_input_gamepad_button_pressed": {},
"goud_input_gamepad_button_just_pressed": {},
"goud_input_gamepad_button_just_released": {},
"goud_input_gamepad_axis": {}
},
"input_gamepad": {
"goud_input_gamepad_connected": {},
"goud_input_gamepad_connected_count": {},
"goud_input_gamepad_left_stick": {},
"goud_input_gamepad_right_stick": {},
"goud_input_gamepad_left_trigger": {},
"goud_input_gamepad_right_trigger": {},
"goud_input_gamepad_set_vibration": {}
},
"input_touch": {
"goud_input_touch_count": {},
Expand Down
8 changes: 8 additions & 0 deletions codegen/gen_ts_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,13 @@ def gen_web_wrapper():
lines.append(" getTouchDelta(_touchId: number): IVec2 { return { x: 0, y: 0 }; }")
lines.append("")

# Gamepad input (stubs — WASM gamepad bindings not yet implemented)
lines.append(" isGamepadButtonPressed(_gamepadId: number, _button: number): boolean { return false; }")
lines.append(" isGamepadButtonJustPressed(_gamepadId: number, _button: number): boolean { return false; }")
lines.append(" isGamepadButtonJustReleased(_gamepadId: number, _button: number): boolean { return false; }")
lines.append(" getGamepadAxis(_gamepadId: number, _axis: number): number { return 0; }")
lines.append("")

emit_jsdoc(lines, _method_docs.get("map_action_key"))
lines.append(" mapActionKey(action: string, key: number): boolean { return this.handle.map_action_key(action, key); }")
emit_jsdoc(lines, _method_docs.get("is_action_pressed"))
Expand Down Expand Up @@ -1124,6 +1131,7 @@ def gen_web_wrapper():
lines.append(" setGridEnabled(_enabled: boolean): boolean { return false; }")
lines.append(" configureSkybox(_enabled: boolean, _r: number, _g: number, _b: number, _a: number): boolean { return false; }")
lines.append(" configureFog(_enabled: boolean, _r: number, _g: number, _b: number, _density: number): boolean { return false; }")
lines.append(" configureFogLinear(_enabled: boolean, _startDistance: number, _endDistance: number, _r: number, _g: number, _b: number): boolean { return false; }")
lines.append(" setFogEnabled(_enabled: boolean): boolean { return false; }")
lines.append(" render3D(): boolean { return false; }")
lines.append(" setFrustumCullingEnabled(_enabled: boolean): number { return 0; }")
Expand Down
5 changes: 5 additions & 0 deletions codegen/generated/goud_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,11 @@ bool goud_renderer3d_configure_skybox(struct GoudContextId context_id, bool enab
*/
bool goud_renderer3d_configure_fog(struct GoudContextId context_id, bool enabled, float r, float g, float b, float density);

/**
* Configures linear fog with explicit start/end distances.
*/
bool goud_renderer3d_configure_fog_linear(struct GoudContextId context_id, bool enabled, float start_distance, float end_distance, float r, float g, float b);

/**
* Sets fog enabled state.
*/
Expand Down
118 changes: 118 additions & 0 deletions codegen/goud_sdk.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4756,6 +4756,66 @@
],
"returns": "Vec2"
},
{
"name": "isGamepadButtonPressed",
"doc": "Returns true if the specified gamepad button is currently pressed",
"params": [
{
"name": "gamepadId",
"type": "u32"
},
{
"name": "button",
"type": "u32"
}
],
"returns": "bool"
},
{
"name": "isGamepadButtonJustPressed",
"doc": "Returns true if the specified gamepad button was just pressed this frame",
"params": [
{
"name": "gamepadId",
"type": "u32"
},
{
"name": "button",
"type": "u32"
}
],
"returns": "bool"
},
{
"name": "isGamepadButtonJustReleased",
"doc": "Returns true if the specified gamepad button was just released this frame",
"params": [
{
"name": "gamepadId",
"type": "u32"
},
{
"name": "button",
"type": "u32"
}
],
"returns": "bool"
},
{
"name": "getGamepadAxis",
"doc": "Returns the current value of a gamepad analog axis (-1.0 to 1.0)",
"params": [
{
"name": "gamepadId",
"type": "u32"
},
{
"name": "axis",
"type": "u32"
}
],
"returns": "f32"
},
{
"$ref": "EcsMethods",
"name": "spawnEmpty"
Expand Down Expand Up @@ -5359,6 +5419,37 @@
],
"returns": "bool"
},
{
"name": "configureFogLinear",
"doc": "Configures linear fog with explicit start and end distances",
"params": [
{
"name": "enabled",
"type": "bool"
},
{
"name": "startDistance",
"type": "f32"
},
{
"name": "endDistance",
"type": "f32"
},
{
"name": "r",
"type": "f32"
},
{
"name": "g",
"type": "f32"
},
{
"name": "b",
"type": "f32"
}
],
"returns": "bool"
},
{
"name": "setFogEnabled",
"doc": "Sets fog visibility",
Expand Down Expand Up @@ -8659,6 +8750,18 @@
{
"method": "getTouchDelta"
},
{
"method": "isGamepadButtonPressed"
},
{
"method": "isGamepadButtonJustPressed"
},
{
"method": "isGamepadButtonJustReleased"
},
{
"method": "getGamepadAxis"
},
{
"method": "mapActionKey"
},
Expand Down Expand Up @@ -12576,6 +12679,18 @@
],
"returns_struct": "Vec2"
},
"isGamepadButtonPressed": {
"ffi": "goud_input_gamepad_button_pressed"
},
"isGamepadButtonJustPressed": {
"ffi": "goud_input_gamepad_button_just_pressed"
},
"isGamepadButtonJustReleased": {
"ffi": "goud_input_gamepad_button_just_released"
},
"getGamepadAxis": {
"ffi": "goud_input_gamepad_axis"
},
"getTouchCount": {
"ffi": "goud_input_touch_count"
},
Expand Down Expand Up @@ -12861,6 +12976,9 @@
"configureFog": {
"ffi": "goud_renderer3d_configure_fog"
},
"configureFogLinear": {
"ffi": "goud_renderer3d_configure_fog_linear"
},
"setFogEnabled": {
"ffi": "goud_renderer3d_set_fog_enabled"
},
Expand Down
1 change: 1 addition & 0 deletions goud_engine/build_support/ffi_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const FFI_SOURCE_FILES: &[&str] = &[
"src/ffi/input/mouse.rs",
"src/ffi/input/actions.rs",
"src/ffi/input/touch.rs",
"src/ffi/input/gamepad.rs",
// collision (not yet split)
"src/ffi/collision.rs",
// scene module
Expand Down
Loading
Loading