// ==================== ХОЛСТ 3D (WebGL) — GrechkaCraft v2 ==================== // Тот же контракт, что canvas.js: выставляет state.W/H, хранит canvas. // WebGL-контекст создаёт render3d (лениво, при первом кадре). import { state } from './state.js'; export function initCanvas() { const gameEl = document.getElementById('game'); const canvas = document.getElementById('c'); const dpr = Math.max(1, window.devicePixelRatio || 1); function resize() { state.W = gameEl.clientWidth; state.H = gameEl.clientHeight; } window.addEventListener('resize', resize); resize(); state.gameEl = gameEl; state.canvas = canvas; state.ctx = null; state.lightC = null; state.lightCtx = null; state.dpr = dpr; } export function getCanvas() { return state.canvas; } export function getCtx() { return null; } export function getLightC() { return null; } export function getLightCtx() { return null; }