comparison infinite_canvas/web_surface.h @ 276:b55c22cff335

Add interactive infinite canvas prototype
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 16:57:56 -0700
parents
children 8d560f50ed4c
comparison
equal deleted inserted replaced
274:c9be578316a6 276:b55c22cff335
1 #ifndef INFINITE_CANVAS_WEB_SURFACE_H
2 #define INFINITE_CANVAS_WEB_SURFACE_H
3
4 #include "infinite_canvas/canvas.h"
5
6 #define CANVAS_MAX_WEB_VIEWS 12
7
8 typedef struct {
9 uint32 entity_id;
10 Canvas_Entity_Type entity_type;
11 void *p_native;
12 uint8 *p_pixels;
13 Texture2D texture;
14 int32 texture_width;
15 int32 texture_height;
16 size_t pixel_capacity;
17 char url[128];
18 boolean active;
19 boolean browser_created;
20 boolean texture_ready;
21 boolean pixels_dirty;
22 } Canvas_Web_View;
23
24 typedef struct {
25 Dowa_Arena *p_arena;
26 void *p_native;
27 Canvas_Web_View views[CANVAS_MAX_WEB_VIEWS];
28 uint32 focused_entity_id;
29 boolean initialized;
30 } Canvas_Web_Surface;
31
32 #if defined(__cplusplus)
33 extern "C" {
34 #endif
35
36 int32 Canvas_Web_Surface_Execute_Subprocess(int argc, char **p_argv);
37 boolean Canvas_Web_Surface_Init(
38 Canvas_Web_Surface *p_surface,
39 Dowa_Arena *p_arena);
40 boolean Canvas_Web_Surface_Update_Input(
41 Canvas_Web_Surface *p_surface,
42 const Canvas_Camera *p_camera,
43 const Canvas_Scene *p_scene);
44 void Canvas_Web_Surface_Sync(
45 Canvas_Web_Surface *p_surface,
46 const Canvas_Camera *p_camera,
47 const Canvas_Scene *p_scene);
48 void Canvas_Web_Surface_Draw(
49 const Canvas_Web_Surface *p_surface,
50 const Canvas_Camera *p_camera,
51 const Canvas_Scene *p_scene);
52 boolean Canvas_Web_Surface_Is_Focused(const Canvas_Web_Surface *p_surface);
53 void Canvas_Web_Surface_Shutdown(Canvas_Web_Surface *p_surface);
54
55 #if defined(__cplusplus)
56 }
57 #endif
58
59 #endif