Skip to content

Add console warnings when WebGL is unavailable#107

Open
himself65 wants to merge 1 commit intoshuding:mainfrom
himself65:warn-webgl-not-working
Open

Add console warnings when WebGL is unavailable#107
himself65 wants to merge 1 commit intoshuding:mainfrom
himself65:warn-webgl-not-working

Conversation

@himself65
Copy link
Copy Markdown

@himself65 himself65 commented Mar 18, 2026

Summary

  • Add console.warn when neither WebGL2 nor WebGL1 context can be obtained (unsupported browser/device)
  • Add console.warn when shader programs fail to compile
  • Add webglcontextlost / webglcontextrestored event listeners to warn on runtime context loss
  • Properly clean up event listeners in destroy()

Previously, all WebGL failures silently returned no-op objects, making it difficult for developers to understand why the globe wasn't rendering.

Test plan

  • Verify warning appears in console when WebGL is disabled (e.g., via browser flags or in a non-WebGL environment)
  • Verify warning appears when WebGL context is lost (can be simulated via WEBGL_lose_context extension)
  • Verify no warnings appear during normal operation
  • Verify event listeners are cleaned up after destroy() is called

Previously, COBE silently returned no-op objects when WebGL was
unavailable or shaders failed to compile, making it hard to debug.
This adds console.warn messages for three failure scenarios:
- WebGL not supported by browser/device
- Shader program compilation failure
- Runtime WebGL context loss/restoration
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 18, 2026

@himself65 is attempting to deploy a commit to the shu Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cobe Ready Ready Preview, Comment Mar 19, 2026 2:41pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant