refactor(render): 抽象图形后端并迁移渲染器 (#313)

* refactor(render): 抽象图形后端并迁移渲染器

- 新增 engine-shared 包,定义 GraphicsBackend trait 抽象层
- 实现 WebGL2Backend 作为首个后端实现
- 迁移 Renderer2D、SpriteBatch、GridRenderer、GizmoRenderer 使用新抽象
- 修复 VAO 创建时索引缓冲区绑定状态泄漏问题
- 新增 create_vertex_buffer_sized 方法支持预分配缓冲区

* fix(serialization): 修复序列化循环引用导致栈溢出

- 在 serializeValue 添加 WeakSet 检测循环引用
- 跳过已访问对象避免无限递归

* refactor(serialization): 提取 ValueSerializer 统一序列化逻辑

- 新增 ValueSerializer 模块,函数式设计
- 支持可扩展类型处理器注册
- 移除 ComponentSerializer/SceneSerializer 重复代码
- 内置 Date/Map/Set 类型支持

* fix: CodeQL 类型检查警告
This commit is contained in:
YHH
2025-12-19 22:46:33 +08:00
committed by GitHub
parent 4b74db3f2d
commit 96b5403d14
31 changed files with 6096 additions and 2114 deletions

View File

@@ -16,6 +16,9 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook"]
[dependencies]
# Shared types and traits | 共享类型和trait
es-engine-shared = { path = "../engine-shared" }
# WASM bindings | WASM绑定
wasm-bindgen = "0.2"
js-sys = "0.3"