Mercurial
annotate infinite_canvas/main.c @ 281:c57149ad216e default tip
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 18 Aug 2026 22:18:15 -0700 |
| parents | 49e9e591c9bb |
| children |
| rev | line source |
|---|---|
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
1 #include "infinite_canvas/agent_response.h" |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
2 #include "infinite_canvas/agent_service.h" |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
3 #include "infinite_canvas/canvas.h" |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
4 #include "infinite_canvas/scene_store.h" |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
5 #include "infinite_canvas/web_surface.h" |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
6 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
7 #if defined(INFINITE_CANVAS_DEV_UI) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
8 #include "infinite_canvas/dev_ui.h" |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
9 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
10 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
11 #if defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
12 #include <emscripten/emscripten.h> |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
13 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
14 |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
15 #include <math.h> |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
16 #include <stdio.h> |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
17 #include <stdlib.h> |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
18 #include <string.h> |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
19 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
20 typedef struct { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
21 Dowa_Arena *p_arena; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
22 Canvas_Camera camera; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
23 Canvas_Scene scene; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
24 Canvas_Web_Surface web_surface; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
25 Canvas_Agent_Service agent_service; |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
26 Font font; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
27 Canvas_Theme theme; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
28 boolean owns_font; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
29 const char *p_screenshot_path; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
30 uint32 frame_count; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
31 uint32 screenshot_frame; |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
32 Vector2 pending_indicator_position; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
33 Vector2 pending_indicator_drag_offset; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
34 uint32 dictation_entity_id; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
35 boolean agent_initialized; |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
36 boolean pending_indicator_visible; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
37 boolean pending_indicator_hovered; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
38 boolean pending_indicator_dragging; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
39 float pending_indicator_hover_amount; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
40 boolean dictation_overlay_visible; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
41 boolean dictation_listening; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
42 boolean dictation_requested_active; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
43 boolean dictation_send_pending; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
44 char dictation_status[128]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
45 char dictation_partial[CANVAS_ENTITY_TEXT_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
46 char dictation_transcript[CANVAS_ENTITY_TEXT_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
47 char pending_prompt[CANVAS_ENTITY_TEXT_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
48 char agent_context[CANVAS_CONTEXT_MAX_LENGTH]; |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
49 #if defined(INFINITE_CANVAS_DEV_UI) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
50 Canvas_Dev_UI dev_ui; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
51 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
52 } Canvas_App; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
53 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
54 static Canvas_App *g_app = NULL; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
55 |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
56 static Canvas_Entity *Canvas_App_Find_Entity(uint32 entity_id) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
57 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
58 for (size_t index = 0; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
59 index < Dowa_Array_Length(g_app->scene.p_entities); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
60 index++) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
61 if (g_app->scene.p_entities[index].id == entity_id) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
62 return &g_app->scene.p_entities[index]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
63 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
64 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
65 return NULL; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
66 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
67 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
68 static boolean Canvas_App_Submit_Prompt(const char *p_prompt) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
69 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
70 if (!p_prompt || !p_prompt[0]) return FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
71 Canvas_Scene_Build_Visible_Context( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
72 &g_app->scene, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
73 &g_app->camera, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
74 g_app->agent_context, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
75 sizeof(g_app->agent_context)); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
76 if (!Canvas_Agent_Service_Submit( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
77 &g_app->agent_service, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
78 p_prompt, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
79 g_app->agent_context)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
80 return FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
81 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
82 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
83 g_app->pending_prompt, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
84 sizeof(g_app->pending_prompt), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
85 "%s", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
86 p_prompt); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
87 g_app->pending_indicator_position = Canvas_Camera_Screen_To_World( |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
88 &g_app->camera, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
89 (Vector2){ |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
90 (float)g_app->camera.viewport_width * 0.5f + 240.0f, |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
91 (float)g_app->camera.viewport_height * 0.5f - 150.0f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
92 }); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
93 g_app->pending_indicator_visible = TRUE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
94 g_app->pending_indicator_hovered = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
95 g_app->pending_indicator_dragging = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
96 g_app->pending_indicator_hover_amount = 0.0f; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
97 return TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
98 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
99 |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
100 static uint32 Canvas_App_Materialize_Agent_Entities( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
101 Canvas_Agent_Response *p_response) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
102 { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
103 uint32 created = 0; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
104 for (uint32 index = 0; index < p_response->entity_count; index++) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
105 Canvas_Agent_Entity_Spec *p_spec = &p_response->entities[index]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
106 Vector2 position = p_spec->has_position |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
107 ? p_spec->position |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
108 : (Vector2){ |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
109 g_app->pending_indicator_position.x + |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
110 (float)(index % 2) * 280.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
111 g_app->pending_indicator_position.y + |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
112 (float)(index / 2) * 240.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
113 }; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
114 if (!Canvas_Scene_Add(&g_app->scene, p_spec->type, position)) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
115 break; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
116 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
117 Canvas_Entity *p_entity = &g_app->scene.p_entities[ |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
118 Dowa_Array_Length(g_app->scene.p_entities) - 1]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
119 if (p_spec->label[0]) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
120 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
121 p_entity->label, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
122 sizeof(p_entity->label), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
123 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
124 p_spec->label); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
125 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
126 if (p_spec->text[0]) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
127 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
128 p_entity->text, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
129 sizeof(p_entity->text), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
130 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
131 p_spec->text); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
132 p_entity->text_cursor = (int32)strlen(p_entity->text); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
133 p_entity->text_selection_anchor = p_entity->text_cursor; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
134 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
135 if (p_spec->has_size) p_entity->size = p_spec->size; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
136 if (p_spec->has_value) p_entity->value = p_spec->value; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
137 created++; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
138 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
139 return created; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
140 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
141 |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
142 static void Canvas_App_Show_Agent_Notification( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
143 const char *p_title, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
144 const char *p_text) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
145 { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
146 if (!Canvas_Scene_Add( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
147 &g_app->scene, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
148 CANVAS_ENTITY_NOTIFICATION, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
149 g_app->pending_indicator_position)) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
150 return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
151 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
152 Canvas_Entity *p_entity = &g_app->scene.p_entities[ |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
153 Dowa_Array_Length(g_app->scene.p_entities) - 1]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
154 if (p_title && p_title[0]) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
155 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
156 p_entity->label, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
157 sizeof(p_entity->label), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
158 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
159 p_title); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
160 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
161 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
162 p_entity->text, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
163 sizeof(p_entity->text), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
164 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
165 p_text ? p_text : ""); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
166 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
167 |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
168 static void Canvas_App_Apply_Agent_Response(const char *p_json) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
169 { |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
170 Canvas_Agent_Response parsed; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
171 boolean valid = Canvas_Agent_Response_Parse(p_json, &parsed); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
172 if (!valid) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
173 memset(&parsed, 0, sizeof(parsed)); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
174 snprintf(parsed.action, sizeof(parsed.action), "create"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
175 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
176 parsed.presentation, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
177 sizeof(parsed.presentation), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
178 "conversation"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
179 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
180 parsed.response, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
181 sizeof(parsed.response), |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
182 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
183 p_json); |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
184 } |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
185 uint32 created_entities = |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
186 Canvas_App_Materialize_Agent_Entities(&parsed); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
187 if (strcmp(parsed.action, "append") == 0 && |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
188 parsed.conversation_id != 0 && |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
189 Canvas_Scene_Append_Conversation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
190 &g_app->scene, |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
191 parsed.conversation_id, |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
192 g_app->pending_prompt, |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
193 parsed.response)) { |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
194 Canvas_Entity *p_conversation = |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
195 Canvas_App_Find_Entity(parsed.conversation_id); |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
196 Canvas_Conversation_Scroll_To_End( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
197 p_conversation, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
198 g_app->font); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
199 } else if (strcmp(parsed.presentation, "action") == 0) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
200 if (created_entities == 0) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
201 Canvas_App_Show_Agent_Notification( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
202 parsed.title[0] ? parsed.title : "Copilot", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
203 parsed.response); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
204 } |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
205 } else { |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
206 Vector2 position = { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
207 g_app->pending_indicator_position.x - 210.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
208 g_app->pending_indicator_position.y - 150.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
209 }; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
210 uint32 created_id = Canvas_Scene_Add_Conversation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
211 &g_app->scene, |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
212 parsed.title[0] ? parsed.title : "Copilot session", |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
213 g_app->pending_prompt, |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
214 parsed.response, |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
215 position); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
216 Canvas_Conversation_Scroll_To_End( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
217 Canvas_App_Find_Entity(created_id), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
218 g_app->font); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
219 } |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
220 g_app->pending_indicator_visible = FALSE; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
221 g_app->pending_prompt[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
222 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
223 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
224 static Canvas_Entity *Canvas_App_Ensure_Dictation_Entity(void) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
225 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
226 Canvas_Entity *p_entity = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
227 Canvas_App_Find_Entity(g_app->dictation_entity_id); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
228 if (p_entity) return p_entity; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
229 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
230 Vector2 center = Canvas_Camera_Screen_To_World( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
231 &g_app->camera, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
232 (Vector2){ |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
233 (float)g_app->camera.viewport_width * 0.5f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
234 (float)g_app->camera.viewport_height * 0.5f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
235 }); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
236 Vector2 size = {520.0f, 240.0f}; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
237 if (!Canvas_Scene_Add( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
238 &g_app->scene, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
239 CANVAS_ENTITY_TEXT_AREA, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
240 (Vector2){ |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
241 center.x - size.x * 0.5f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
242 center.y - size.y * 0.5f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
243 })) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
244 return NULL; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
245 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
246 size_t index = Dowa_Array_Length(g_app->scene.p_entities) - 1; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
247 p_entity = &g_app->scene.p_entities[index]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
248 p_entity->size = size; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
249 snprintf(p_entity->label, sizeof(p_entity->label), "Dictation"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
250 g_app->dictation_entity_id = p_entity->id; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
251 g_app->scene.selected_index = (int32)index; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
252 return p_entity; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
253 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
254 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
255 static void Canvas_App_Sync_Dictation_Entity(void) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
256 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
257 Canvas_Entity *p_entity = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
258 Canvas_App_Find_Entity(g_app->dictation_entity_id); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
259 if (!p_entity) return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
260 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
261 char text[CANVAS_ENTITY_TEXT_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
262 snprintf(text, sizeof(text), "%s", g_app->dictation_transcript); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
263 size_t length = strlen(text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
264 if (length > 0 && g_app->dictation_partial[0] && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
265 length + 1 < sizeof(text)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
266 text[length++] = ' '; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
267 text[length] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
268 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
269 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
270 text + length, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
271 sizeof(text) - length, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
272 "%s", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
273 g_app->dictation_partial); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
274 Canvas_Text_Area_Set_Content( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
275 p_entity, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
276 g_app->font, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
277 text, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
278 g_app->dictation_partial[0] ? TRUE : FALSE); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
279 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
280 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
281 static void Canvas_App_Set_Dictation_Active(boolean active) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
282 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
283 g_app->dictation_overlay_visible = TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
284 g_app->dictation_requested_active = active; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
285 g_app->dictation_listening = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
286 g_app->dictation_send_pending = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
287 if (active) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
288 Canvas_App_Ensure_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
289 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
290 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
291 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
292 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
293 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
294 "%s", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
295 active ? "Starting microphone..." : "Stopping microphone..."); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
296 Canvas_Web_Surface_Set_Dictation_Active( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
297 &g_app->web_surface, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
298 active); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
299 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
300 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
301 static boolean Canvas_App_Submit_Dictation(void) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
302 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
303 if (!g_app->dictation_transcript[0]) return FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
304 if (!Canvas_App_Submit_Prompt(g_app->dictation_transcript)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
305 g_app->dictation_send_pending = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
306 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
307 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
308 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
309 "Copilot is busy; press Enter to retry"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
310 return FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
311 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
312 Canvas_Entity *p_entity = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
313 Canvas_App_Find_Entity(g_app->dictation_entity_id); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
314 if (p_entity) p_entity->text_muted = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
315 g_app->dictation_transcript[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
316 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
317 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
318 g_app->dictation_send_pending = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
319 g_app->dictation_overlay_visible = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
320 g_app->dictation_listening; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
321 return TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
322 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
323 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
324 static void Canvas_App_Append_Dictation(const char *p_text) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
325 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
326 if (!p_text || !p_text[0]) return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
327 size_t length = strlen(g_app->dictation_transcript); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
328 if (length > 0 && length + 1 < sizeof(g_app->dictation_transcript)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
329 g_app->dictation_transcript[length++] = ' '; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
330 g_app->dictation_transcript[length] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
331 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
332 size_t available = sizeof(g_app->dictation_transcript) - length - 1; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
333 size_t text_length = strlen(p_text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
334 size_t copy_length = text_length < available ? text_length : available; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
335 memcpy(g_app->dictation_transcript + length, p_text, copy_length); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
336 g_app->dictation_transcript[length + copy_length] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
337 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
338 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
339 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
340 static void Canvas_App_Update_Dictation_Overlay_Input(void) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
341 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
342 if (!g_app->dictation_overlay_visible) return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
343 if (g_app->dictation_listening && IsKeyPressed(KEY_BACKSPACE)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
344 g_app->dictation_send_pending = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
345 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
346 g_app->dictation_transcript[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
347 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
348 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
349 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
350 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
351 "Listening"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
352 return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
353 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
354 if (IsKeyPressed(KEY_ESCAPE)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
355 if (g_app->dictation_listening) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
356 Canvas_Web_Surface_Set_Dictation_Active( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
357 &g_app->web_surface, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
358 FALSE); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
359 g_app->dictation_requested_active = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
360 g_app->dictation_listening = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
361 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
362 g_app->dictation_send_pending = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
363 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
364 g_app->dictation_transcript[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
365 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
366 g_app->dictation_overlay_visible = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
367 return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
368 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
369 if (!IsKeyPressed(KEY_ENTER)) return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
370 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
371 if (g_app->dictation_partial[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
372 g_app->dictation_send_pending = TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
373 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
374 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
375 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
376 "Finishing dictation..."); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
377 Canvas_Web_Surface_Commit_Dictation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
378 &g_app->web_surface); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
379 } else if (g_app->dictation_transcript[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
380 Canvas_App_Submit_Dictation(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
381 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
382 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
383 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
384 static boolean Canvas_App_Dictation_Status_Is_Error(const char *p_status) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
385 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
386 return strstr(p_status, "failed") != NULL || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
387 strstr(p_status, "Unable") != NULL || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
388 strstr(p_status, "closed") != NULL || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
389 strstr(p_status, "invalid") != NULL || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
390 strstr(p_status, "error") != NULL; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
391 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
392 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
393 static void Canvas_App_Draw_Listening_Indicator(void) |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
394 { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
395 if (!g_app->dictation_listening) return; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
396 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
397 float pulse = 0.72f + 0.28f * sinf((float)GetTime() * 5.0f); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
398 Vector2 dot = {28.0f, (float)GetScreenHeight() - 28.0f}; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
399 DrawCircleV( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
400 dot, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
401 5.0f + pulse * 2.0f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
402 Fade(g_app->theme.danger, 0.82f)); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
403 DrawTextEx( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
404 g_app->font, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
405 "Listening", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
406 (Vector2){44.0f, dot.y - 8.0f}, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
407 14.0f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
408 0.0f, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
409 g_app->theme.text_muted); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
410 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
411 |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
412 static void Canvas_App_Draw_Agent_Indicator(void) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
413 { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
414 if (!g_app->pending_indicator_visible) return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
415 Vector2 screen = Canvas_Camera_World_To_Screen( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
416 &g_app->camera, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
417 g_app->pending_indicator_position); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
418 float pulse = 0.5f + 0.5f * sinf((float)GetTime() * 5.0f); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
419 float hover = g_app->pending_indicator_hover_amount; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
420 float radius = 22.0f + hover * 2.0f; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
421 Rectangle bounds = { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
422 screen.x - radius, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
423 screen.y - radius, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
424 radius * 2.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
425 radius * 2.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
426 }; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
427 Canvas_Theme_Draw_Shadow( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
428 &g_app->theme, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
429 bounds, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
430 0.5f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
431 16, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
432 1.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
433 1.0f); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
434 DrawCircleV(screen, radius, g_app->theme.surface); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
435 DrawCircleLinesV( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
436 screen, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
437 20.0f + pulse * 2.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
438 Fade(g_app->theme.accent, 0.45f + pulse * 0.35f)); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
439 Canvas_Draw_Lucide_Icon( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
440 "sparkles", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
441 (Vector2){screen.x - 9.0f, screen.y - 9.0f}, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
442 0.75f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
443 1.8f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
444 g_app->theme.accent); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
445 if (hover > 0.01f) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
446 Rectangle label = { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
447 screen.x + 28.0f - (1.0f - hover) * 8.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
448 screen.y - 17.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
449 118.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
450 34.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
451 }; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
452 DrawRectangleRounded( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
453 label, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
454 0.35f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
455 10, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
456 Fade(g_app->theme.surface, hover)); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
457 DrawRectangleRoundedLinesEx( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
458 label, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
459 0.35f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
460 10, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
461 1.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
462 Fade(g_app->theme.border, hover)); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
463 DrawTextEx( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
464 g_app->font, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
465 g_app->pending_indicator_dragging |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
466 ? "Move result" |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
467 : "Copilot working", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
468 (Vector2){label.x + 12.0f, label.y + 10.0f}, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
469 13.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
470 0.0f, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
471 Fade(g_app->theme.text, hover)); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
472 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
473 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
474 |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
475 static boolean Canvas_App_Update_Agent_Indicator_Input(boolean blocked) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
476 { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
477 if (!g_app->pending_indicator_visible) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
478 g_app->pending_indicator_hovered = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
479 g_app->pending_indicator_dragging = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
480 g_app->pending_indicator_hover_amount = 0.0f; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
481 return FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
482 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
483 Vector2 pointer = GetMousePosition(); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
484 Vector2 screen = Canvas_Camera_World_To_Screen( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
485 &g_app->camera, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
486 g_app->pending_indicator_position); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
487 if (g_app->pending_indicator_dragging) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
488 Vector2 target_screen = { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
489 pointer.x - g_app->pending_indicator_drag_offset.x, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
490 pointer.y - g_app->pending_indicator_drag_offset.y, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
491 }; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
492 g_app->pending_indicator_position = |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
493 Canvas_Camera_Screen_To_World( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
494 &g_app->camera, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
495 target_screen); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
496 if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
497 g_app->pending_indicator_dragging = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
498 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
499 g_app->pending_indicator_hovered = TRUE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
500 } else { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
501 g_app->pending_indicator_hovered = |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
502 !blocked && |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
503 CheckCollisionPointCircle(pointer, screen, 26.0f); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
504 if (g_app->pending_indicator_hovered && |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
505 IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
506 g_app->pending_indicator_dragging = TRUE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
507 g_app->pending_indicator_drag_offset = (Vector2){ |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
508 pointer.x - screen.x, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
509 pointer.y - screen.y, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
510 }; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
511 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
512 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
513 float target = g_app->pending_indicator_hovered ? 1.0f : 0.0f; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
514 float step = GetFrameTime() * 10.0f; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
515 if (g_app->pending_indicator_hover_amount < target) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
516 g_app->pending_indicator_hover_amount = fminf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
517 target, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
518 g_app->pending_indicator_hover_amount + step); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
519 } else { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
520 g_app->pending_indicator_hover_amount = fmaxf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
521 target, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
522 g_app->pending_indicator_hover_amount - step); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
523 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
524 return g_app->pending_indicator_hovered || |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
525 g_app->pending_indicator_dragging; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
526 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
527 |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
528 #if defined(INFINITE_CANVAS_DEV_UI) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
529 static void Canvas_App_Handle_Dev_Action(Canvas_Dev_UI_Action action) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
530 { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
531 if (action == CANVAS_DEV_UI_ACTION_NONE) return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
532 char path[CANVAS_SCENE_STORE_PATH_CAPACITY]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
533 if (!Canvas_Scene_Store_Path( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
534 g_app->dev_ui.snapshot_name, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
535 path, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
536 sizeof(path))) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
537 Canvas_Dev_UI_Set_Snapshot_Status( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
538 &g_app->dev_ui, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
539 "Use only letters, numbers, - or _"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
540 return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
541 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
542 if (action == CANVAS_DEV_UI_ACTION_SAVE_SNAPSHOT) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
543 Canvas_Dev_UI_Set_Snapshot_Status( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
544 &g_app->dev_ui, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
545 Canvas_Scene_Store_Save( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
546 path, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
547 &g_app->scene, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
548 &g_app->camera) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
549 ? "Snapshot saved" |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
550 : "Snapshot save failed"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
551 return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
552 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
553 if (g_app->agent_initialized && |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
554 g_app->agent_service.status == CANVAS_AGENT_WORKING) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
555 Canvas_Dev_UI_Set_Snapshot_Status( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
556 &g_app->dev_ui, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
557 "Wait for the active agent turn before loading"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
558 return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
559 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
560 if (!Canvas_Scene_Store_Load( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
561 path, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
562 &g_app->scene, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
563 &g_app->camera)) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
564 Canvas_Dev_UI_Set_Snapshot_Status( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
565 &g_app->dev_ui, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
566 "Snapshot missing, incompatible, or corrupt"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
567 return; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
568 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
569 g_app->pending_indicator_visible = FALSE; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
570 g_app->pending_prompt[0] = '\0'; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
571 g_app->dictation_entity_id = 0; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
572 g_app->dictation_transcript[0] = '\0'; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
573 g_app->dictation_partial[0] = '\0'; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
574 for (size_t index = 0; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
575 index < Dowa_Array_Length(g_app->scene.p_entities); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
576 index++) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
577 Canvas_Entity *p_entity = &g_app->scene.p_entities[index]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
578 if (p_entity->type == CANVAS_ENTITY_TEXT_AREA && |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
579 strcmp(p_entity->label, "Dictation") == 0) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
580 g_app->dictation_entity_id = p_entity->id; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
581 snprintf( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
582 p_entity->text_muted |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
583 ? g_app->dictation_partial |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
584 : g_app->dictation_transcript, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
585 CANVAS_ENTITY_TEXT_CAPACITY, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
586 "%s", |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
587 p_entity->text); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
588 break; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
589 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
590 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
591 g_app->dictation_overlay_visible = |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
592 g_app->dictation_transcript[0] || |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
593 g_app->dictation_partial[0]; |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
594 Canvas_Dev_UI_Set_Snapshot_Status( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
595 &g_app->dev_ui, |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
596 "Snapshot loaded"); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
597 } |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
598 #endif |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
599 |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
600 static void Canvas_App_Draw_Frame(void) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
601 { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
602 int32 width = GetScreenWidth(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
603 int32 height = GetScreenHeight(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
604 Canvas_Camera_Set_Viewport(&g_app->camera, width, height); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
605 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
606 boolean block_pointer_input = FALSE; |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
607 boolean dev_ui_editing = FALSE; |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
608 #if defined(INFINITE_CANVAS_DEV_UI) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
609 block_pointer_input = Canvas_Dev_UI_Contains_Pointer(&g_app->dev_ui); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
610 dev_ui_editing = Canvas_Dev_UI_Is_Editing(&g_app->dev_ui); |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
611 #endif |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
612 block_pointer_input = |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
613 Canvas_App_Update_Agent_Indicator_Input(block_pointer_input) || |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
614 block_pointer_input; |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
615 Canvas_Web_Surface_Set_Dark_Mode( |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
616 &g_app->web_surface, |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
617 g_app->theme.resolved_mode == CANVAS_THEME_DARK ? TRUE : FALSE); |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
618 boolean dictation_hotkey = |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
619 !dev_ui_editing && |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
620 !Canvas_Scene_Is_Text_Editing(&g_app->scene) && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
621 !Canvas_Web_Chrome_Is_Editing(&g_app->scene) && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
622 IsKeyPressed(KEY_M); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
623 if (dictation_hotkey) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
624 Canvas_App_Set_Dictation_Active( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
625 g_app->dictation_requested_active ? FALSE : TRUE); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
626 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
627 Canvas_App_Update_Dictation_Overlay_Input(); |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
628 Canvas_Web_Chrome_Action chrome_action = CANVAS_WEB_CHROME_NONE; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
629 if (!block_pointer_input) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
630 const char *p_current_url = NULL; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
631 if (g_app->scene.selected_index >= 0 && |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
632 g_app->scene.selected_index < |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
633 (int32)Dowa_Array_Length(g_app->scene.p_entities)) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
634 const Canvas_Entity *p_selected = |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
635 &g_app->scene.p_entities[g_app->scene.selected_index]; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
636 p_current_url = Canvas_Web_Surface_URL( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
637 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
638 p_selected->id); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
639 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
640 chrome_action = Canvas_Web_Chrome_Update_Input( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
641 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
642 &g_app->scene, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
643 g_app->font, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
644 p_current_url); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
645 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
646 if (chrome_action == CANVAS_WEB_CHROME_BACK || |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
647 chrome_action == CANVAS_WEB_CHROME_FORWARD) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
648 const Canvas_Entity *p_selected = |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
649 &g_app->scene.p_entities[g_app->scene.selected_index]; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
650 if (chrome_action == CANVAS_WEB_CHROME_BACK) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
651 Canvas_Web_Surface_Go_Back( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
652 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
653 p_selected->id); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
654 } else { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
655 Canvas_Web_Surface_Go_Forward( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
656 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
657 p_selected->id); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
658 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
659 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
660 boolean web_input = FALSE; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
661 if (!block_pointer_input && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
662 !dictation_hotkey && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
663 chrome_action == CANVAS_WEB_CHROME_NONE) { |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
664 web_input = Canvas_Web_Surface_Update_Input( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
665 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
666 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
667 &g_app->scene); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
668 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
669 block_pointer_input = |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
670 block_pointer_input || |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
671 chrome_action != CANVAS_WEB_CHROME_NONE || |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
672 web_input; |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
673 boolean entity_input = Canvas_Scene_Update_Interaction( |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
674 &g_app->scene, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
675 &g_app->camera, |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
676 g_app->font, |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
677 block_pointer_input); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
678 boolean keyboard_focus = |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
679 Canvas_Scene_Is_Text_Editing(&g_app->scene) || |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
680 Canvas_Web_Chrome_Is_Editing(&g_app->scene) || |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
681 dev_ui_editing || |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
682 Canvas_Web_Surface_Is_Focused(&g_app->web_surface); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
683 if (!keyboard_focus && IsKeyPressed(KEY_P)) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
684 Canvas_Scene_Toggle_Selected_Pin(&g_app->scene, &g_app->camera); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
685 } |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
686 if (!keyboard_focus && |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
687 !g_app->dictation_listening && |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
688 (IsKeyPressed(KEY_DELETE) || IsKeyPressed(KEY_BACKSPACE))) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
689 Canvas_Scene_Fade_Out_Selected(&g_app->scene); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
690 } |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
691 Canvas_Update_Camera_Input( |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
692 &g_app->camera, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
693 block_pointer_input || entity_input, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
694 keyboard_focus); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
695 Canvas_Scene_Sync_Pinned(&g_app->scene, &g_app->camera); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
696 Canvas_Scene_Update_Notification_Stack(&g_app->scene, &g_app->camera); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
697 |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
698 char dictation_text[CANVAS_ENTITY_TEXT_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
699 Canvas_Dictation_Event dictation_event = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
700 Canvas_Web_Surface_Consume_Dictation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
701 &g_app->web_surface, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
702 dictation_text, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
703 sizeof(dictation_text)); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
704 if (dictation_event == CANVAS_DICTATION_EVENT_STATUS) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
705 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
706 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
707 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
708 "%.127s", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
709 dictation_text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
710 if (strcmp(dictation_text, "Idle") == 0) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
711 g_app->dictation_listening = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
712 if (g_app->dictation_send_pending) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
713 if (g_app->dictation_partial[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
714 Canvas_App_Append_Dictation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
715 g_app->dictation_partial); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
716 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
717 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
718 Canvas_App_Submit_Dictation(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
719 } else if (!g_app->dictation_transcript[0] && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
720 !g_app->dictation_partial[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
721 g_app->dictation_overlay_visible = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
722 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
723 } else if (strcmp(dictation_text, "Listening") == 0 || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
724 strcmp(dictation_text, "Speech detected") == 0) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
725 g_app->dictation_listening = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
726 g_app->dictation_requested_active; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
727 if (strcmp(dictation_text, "Listening") == 0 && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
728 g_app->dictation_send_pending) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
729 if (g_app->dictation_partial[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
730 Canvas_App_Append_Dictation( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
731 g_app->dictation_partial); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
732 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
733 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
734 Canvas_App_Submit_Dictation(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
735 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
736 } else if (Canvas_App_Dictation_Status_Is_Error(dictation_text)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
737 g_app->dictation_listening = FALSE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
738 g_app->dictation_overlay_visible = TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
739 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
740 } else if (dictation_event == CANVAS_DICTATION_EVENT_PARTIAL) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
741 g_app->dictation_overlay_visible = TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
742 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
743 g_app->dictation_partial, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
744 sizeof(g_app->dictation_partial), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
745 "%s", |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
746 dictation_text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
747 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
748 } else if (dictation_event == CANVAS_DICTATION_EVENT_FINAL) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
749 g_app->dictation_overlay_visible = TRUE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
750 Canvas_App_Append_Dictation(dictation_text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
751 g_app->dictation_partial[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
752 Canvas_App_Sync_Dictation_Entity(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
753 if (g_app->dictation_send_pending) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
754 Canvas_App_Submit_Dictation(); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
755 } else { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
756 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
757 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
758 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
759 "Ready to send"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
760 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
761 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
762 if (!g_app->dictation_overlay_visible && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
763 g_app->scene.selected_index >= 0 && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
764 g_app->scene.selected_index < |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
765 (int32)Dowa_Array_Length(g_app->scene.p_entities) && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
766 (IsKeyDown(KEY_LEFT_CONTROL) || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
767 IsKeyDown(KEY_RIGHT_CONTROL) || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
768 IsKeyDown(KEY_LEFT_SUPER) || |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
769 IsKeyDown(KEY_RIGHT_SUPER)) && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
770 IsKeyPressed(KEY_ENTER)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
771 Canvas_Entity *p_selected = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
772 &g_app->scene.p_entities[g_app->scene.selected_index]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
773 if (p_selected->type == CANVAS_ENTITY_TEXT_AREA && |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
774 p_selected->text[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
775 size_t length = strlen(p_selected->text); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
776 if (length > 0 && p_selected->text[length - 1] == '\n') { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
777 p_selected->text[length - 1] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
778 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
779 if (Canvas_App_Submit_Prompt(p_selected->text)) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
780 p_selected->text[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
781 p_selected->text_cursor = 0; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
782 p_selected->text_selection_anchor = 0; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
783 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
784 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
785 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
786 |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
787 char agent_response[CANVAS_AGENT_RESPONSE_CAPACITY]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
788 char agent_error[512]; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
789 Canvas_Agent_Status agent_status = g_app->agent_initialized ? |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
790 Canvas_Agent_Service_Poll( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
791 &g_app->agent_service, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
792 agent_response, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
793 sizeof(agent_response), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
794 agent_error, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
795 sizeof(agent_error)) : |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
796 CANVAS_AGENT_IDLE; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
797 if (agent_status == CANVAS_AGENT_READY) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
798 Canvas_App_Apply_Agent_Response(agent_response); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
799 } else if (agent_status == CANVAS_AGENT_ERROR) { |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
800 if (g_app->pending_prompt[0]) { |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
801 Canvas_App_Show_Agent_Notification( |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
802 "Copilot unavailable", |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
803 agent_error); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
804 } |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
805 g_app->pending_indicator_visible = FALSE; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
806 g_app->pending_prompt[0] = '\0'; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
807 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
808 |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
809 Canvas_Web_Surface_Sync(&g_app->web_surface, &g_app->camera, &g_app->scene); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
810 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
811 BeginDrawing(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
812 ClearBackground(g_app->theme.background); |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
813 Canvas_Draw_World_Background( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
814 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
815 &g_app->scene, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
816 &g_app->theme); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
817 for (size_t index = 0; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
818 index < Dowa_Array_Length(g_app->scene.p_entities); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
819 index++) { |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
820 Canvas_Draw_World_Entity( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
821 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
822 &g_app->scene, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
823 index, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
824 g_app->font, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
825 &g_app->theme); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
826 Canvas_Web_Surface_Draw_Entity( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
827 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
828 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
829 &g_app->scene, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
830 index); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
831 const Canvas_Entity *p_entity = &g_app->scene.p_entities[index]; |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
832 const char *p_url = Canvas_Web_Surface_URL( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
833 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
834 p_entity->id); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
835 Canvas_Draw_Web_Chrome_Entity( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
836 &g_app->camera, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
837 &g_app->scene, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
838 index, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
839 g_app->font, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
840 &g_app->theme, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
841 p_url ? p_url : p_entity->text, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
842 Canvas_Web_Surface_Can_Go_Back( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
843 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
844 p_entity->id), |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
845 Canvas_Web_Surface_Can_Go_Forward( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
846 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
847 p_entity->id)); |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
848 } |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
849 Canvas_Draw_World_Overlays( |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
850 &g_app->camera, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
851 &g_app->scene, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
852 g_app->font, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
853 &g_app->theme); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
854 Canvas_App_Draw_Agent_Indicator(); |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
855 #if defined(INFINITE_CANVAS_DEV_UI) |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
856 Canvas_Dev_UI_Action dev_action = Canvas_Dev_UI_Draw( |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
857 &g_app->dev_ui, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
858 &g_app->camera, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
859 &g_app->scene, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
860 g_app->font, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
861 &g_app->theme); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
862 #endif |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
863 Canvas_App_Draw_Listening_Indicator(); |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
864 EndDrawing(); |
|
281
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
865 #if defined(INFINITE_CANVAS_DEV_UI) |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
866 Canvas_App_Handle_Dev_Action(dev_action); |
|
c57149ad216e
Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
MrJuneJune <me@mrjunejune.com>
parents:
280
diff
changeset
|
867 #endif |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
868 g_app->frame_count++; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
869 #if !defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
870 if (g_app->frame_count == 30) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
871 RestoreWindow(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
872 SetWindowFocused(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
873 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
874 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
875 if (g_app->p_screenshot_path && |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
876 g_app->frame_count == g_app->screenshot_frame) { |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
877 TakeScreenshot(g_app->p_screenshot_path); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
878 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
879 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
880 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
881 int main(int argc, char **p_argv) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
882 { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
883 #if !defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
884 int32 subprocess_result = Canvas_Web_Surface_Execute_Subprocess(argc, p_argv); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
885 if (subprocess_result >= 0) return subprocess_result; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
886 #else |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
887 (void)argc; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
888 (void)p_argv; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
889 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
890 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
891 Dowa_Arena *p_arena = Dowa_Arena_Create(8 * ONE_MEGA_BYTE); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
892 if (!p_arena) return 1; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
893 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
894 g_app = (Canvas_App *)Dowa_Arena_Allocate(p_arena, sizeof(*g_app)); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
895 if (!g_app) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
896 Dowa_Arena_Free(p_arena); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
897 return 1; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
898 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
899 memset(g_app, 0, sizeof(*g_app)); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
900 g_app->p_arena = p_arena; |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
901 snprintf( |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
902 g_app->dictation_status, |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
903 sizeof(g_app->dictation_status), |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
904 "Idle"); |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
905 g_app->p_screenshot_path = getenv("INFINITE_CANVAS_SCREENSHOT"); |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
906 g_app->screenshot_frame = 180; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
907 const char *p_screenshot_frame = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
908 getenv("INFINITE_CANVAS_SCREENSHOT_FRAME"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
909 if (p_screenshot_frame) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
910 uint32 screenshot_frame = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
911 (uint32)strtoul(p_screenshot_frame, NULL, 10); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
912 if (screenshot_frame > 0) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
913 g_app->screenshot_frame = screenshot_frame; |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
914 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
915 } |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
916 Canvas_Theme_Resolve( |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
917 &g_app->theme, |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
918 Canvas_Theme_Mode_From_String(getenv("INFINITE_CANVAS_THEME"))); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
919 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
920 SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
921 #if defined(INFINITE_CANVAS_DEV_UI) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
922 InitWindow(1920, 1200, "Infinite Canvas"); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
923 SetWindowMinSize(1200, 800); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
924 #else |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
925 InitWindow(1280, 720, "Infinite Canvas"); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
926 SetWindowMinSize(640, 360); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
927 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
928 SetTargetFPS(60); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
929 #if !defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
930 SetWindowFocused(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
931 #endif |
|
278
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
932 if (!Canvas_Web_Surface_Init( |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
933 &g_app->web_surface, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
934 p_arena, |
|
8d560f50ed4c
Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
276
diff
changeset
|
935 g_app->theme.resolved_mode == CANVAS_THEME_DARK ? TRUE : FALSE)) { |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
936 TraceLog(LOG_WARNING, "Web surface initialization failed"); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
937 } |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
938 g_app->agent_initialized = |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
939 Canvas_Agent_Service_Init(&g_app->agent_service, p_arena); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
940 if (!g_app->agent_initialized) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
941 TraceLog(LOG_WARNING, "Agent service initialization failed"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
942 } |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
943 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
944 g_app->font = LoadFontEx("infinite_canvas/assets/Inter-Variable.ttf", 48, NULL, 0); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
945 g_app->owns_font = g_app->font.texture.id != 0; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
946 if (!g_app->owns_font) g_app->font = GetFontDefault(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
947 else SetTextureFilter(g_app->font.texture, TEXTURE_FILTER_BILINEAR); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
948 Canvas_Camera_Init(&g_app->camera, GetScreenWidth(), GetScreenHeight()); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
949 Canvas_Scene_Init(&g_app->scene, p_arena); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
950 if (getenv("INFINITE_CANVAS_BROWSER_STRESS")) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
951 Canvas_Scene_Add_Browser_Grid(&g_app->scene); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
952 } else { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
953 Canvas_Scene_Add_Demo(&g_app->scene); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
954 } |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
955 if (getenv("INFINITE_CANVAS_DICTATION_AUTOSTART")) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
956 Canvas_App_Set_Dictation_Active(TRUE); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
957 } |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
958 const char *p_initial_prompt = getenv("INFINITE_CANVAS_AGENT_PROMPT"); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
959 if (p_initial_prompt && p_initial_prompt[0]) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
960 Canvas_App_Submit_Prompt(p_initial_prompt); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
961 } |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
962 const char *p_image_source = getenv("INFINITE_CANVAS_IMAGE_SOURCE"); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
963 if (p_image_source) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
964 for (size_t index = 0; index < Dowa_Array_Length(g_app->scene.p_entities); index++) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
965 Canvas_Entity *p_entity = &g_app->scene.p_entities[index]; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
966 if (p_entity->type == CANVAS_ENTITY_IMAGE) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
967 snprintf(p_entity->text, sizeof(p_entity->text), "%s", p_image_source); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
968 break; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
969 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
970 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
971 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
972 #if !defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
973 for (size_t index = 0; index < Dowa_Array_Length(g_app->scene.p_entities); index++) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
974 Canvas_Entity *p_entity = &g_app->scene.p_entities[index]; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
975 if (p_entity->type == CANVAS_ENTITY_WEB_CONTENT) { |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
976 snprintf(p_entity->text, sizeof(p_entity->text), "https://www.google.com"); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
977 break; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
978 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
979 } |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
980 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
981 #if defined(INFINITE_CANVAS_DEV_UI) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
982 Canvas_Dev_UI_Init(&g_app->dev_ui, g_app->font, &g_app->theme); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
983 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
984 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
985 #if defined(PLATFORM_WEB) |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
986 emscripten_set_main_loop(Canvas_App_Draw_Frame, 0, 1); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
987 #else |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
988 while (!WindowShouldClose()) Canvas_App_Draw_Frame(); |
|
280
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
989 if (g_app->agent_initialized) { |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
990 Canvas_Agent_Service_Shutdown(&g_app->agent_service); |
|
49e9e591c9bb
Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
MrJuneJune <me@mrjunejune.com>
parents:
278
diff
changeset
|
991 } |
|
276
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
992 Canvas_Web_Surface_Shutdown(&g_app->web_surface); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
993 if (g_app->owns_font) UnloadFont(g_app->font); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
994 Dowa_Arena_Free(p_arena); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
995 g_app = NULL; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
996 CloseWindow(); |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
997 #endif |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
998 |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
999 return 0; |
|
b55c22cff335
Add interactive infinite canvas prototype
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
1000 } |