2025-11-21 10:03:18 +08:00
|
|
|
/**
|
2025-12-01 22:28:51 +08:00
|
|
|
* @esengine/platform-web
|
|
|
|
|
*
|
|
|
|
|
* Web/H5 平台适配器 - 仅包含平台差异代码
|
|
|
|
|
* 通用运行时逻辑在 @esengine/runtime-core
|
|
|
|
|
*
|
2025-11-21 10:03:18 +08:00
|
|
|
* @packageDocumentation
|
|
|
|
|
*/
|
|
|
|
|
|
2025-12-01 22:28:51 +08:00
|
|
|
// Web 平台子系统
|
2025-11-21 10:03:18 +08:00
|
|
|
export { WebCanvasSubsystem } from './subsystems/WebCanvasSubsystem';
|
|
|
|
|
export { WebInputSubsystem } from './subsystems/WebInputSubsystem';
|
|
|
|
|
export { WebStorageSubsystem } from './subsystems/WebStorageSubsystem';
|
|
|
|
|
export { WebWASMSubsystem } from './subsystems/WebWASMSubsystem';
|
|
|
|
|
|
2025-12-01 22:28:51 +08:00
|
|
|
// Web 特定系统
|
|
|
|
|
export { Canvas2DRenderSystem } from './systems/Canvas2DRenderSystem';
|
2025-11-27 20:42:46 +08:00
|
|
|
|
2025-11-21 10:03:18 +08:00
|
|
|
export function isWebPlatform(): boolean {
|
|
|
|
|
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
|
|
|
}
|
2025-12-01 22:28:51 +08:00
|
|
|
|
|
|
|
|
export function getWebCanvas(canvasId: string): HTMLCanvasElement | null {
|
|
|
|
|
return document.getElementById(canvasId) as HTMLCanvasElement | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function createWebCanvas(width: number, height: number): HTMLCanvasElement {
|
|
|
|
|
const canvas = document.createElement('canvas');
|
|
|
|
|
canvas.width = width;
|
|
|
|
|
canvas.height = height;
|
|
|
|
|
return canvas;
|
|
|
|
|
}
|