-
Hi, I would like to enable the Is there any C API for that, or I have to use JavaScript code? I have tried doing the following: #ifdef __EMSCRIPTEN__
EM_ASM(
const ext = gl.getExtension("EXT_color_buffer_float");
if (!ext) {
console.error("need EXT_color_buffer_float");
}
);
#endif But I get the following error:
Do I need to "import" something to use gl? I don't know much JS. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
tuket
Jun 2, 2022
Replies: 1 comment
-
Found my solution here: https://stackoverflow.com/questions/26736126/enable-webgl-extensions-from-asm-js-emscripten #ifdef __EMSCRIPTEN__
const EMSCRIPTEN_WEBGL_CONTEXT_HANDLE webGlContext = emscripten_webgl_get_current_context();
const EM_BOOL enabledOk = emscripten_webgl_enable_extension(webGlContext, "EXT_color_buffer_float");
#endif |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tuket
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found my solution here: https://stackoverflow.com/questions/26736126/enable-webgl-extensions-from-asm-js-emscripten