Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!gl.getExtension("WEBGL_draw_buffers")) { | ||
| console.warn("WEBGL_draw_buffers extension unavailable; rendering will fail."); | ||
| if (msg) { | ||
| msg.innerText = "WEBGL_draw_buffers is required for SEC3DEMO."; | ||
| } |
There was a problem hiding this comment.
Fail-fast check leaves demo in inconsistent state
When WEBGL_draw_buffers is unavailable, setupScene now returns early here (return at line 527), but main() still calls setKeyInputs, SEC3.renderer.init(), etc. (lines 203‑221) assuming scene, interactor, and lights were created. In browsers where the extension is missing, this path now triggers runtime exceptions (e.g., interactor.onKeyDown or renderer init using scene) instead of a graceful exit. The fail-fast should either halt the rest of main() or propagate a failure signal so the remaining initialization is skipped.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@codex I think without drawbuffers the move is to fail gracefully. Let's check how common it would be that they wouldn't be available these days.
There was a problem hiding this comment.
Summary
- Made
setupScenereturn explicit success status for WebGL context acquisition, extension availability, and FBO initialization so failures exit early with clear messaging. demos/SEC3DEMO.jsL506-L636 - Updated
mainto skip key/input setup and renderer initialization when scene setup fails, preventing runtime errors when WEBGL_draw_buffers is missing. demos/SEC3DEMO.jsL203-L220
Testing
⚠️ Not run (not requested).
Summary
Testing
Codex Task