This project is an emscripten port of GLFW written in C++ for the web/webassembly platform #wasm
150
stars
320
commits
C++
primary language
Aug 18, 2026
updated
This project is an Emscripten port of GLFW written in C++ for the web/wasm platform. The currently supported GLFW API is 3.5.1.
The main goal of this project is to implement as much of the GLFW API that is possible to implement in the context of a web browser.
Since this project is targeting the web/webassembly platform, which runs in more recent web browsers, it is also trying
to focus on using the most recent features and not use deprecated features (for example, uses keyboardEvent.key
vs keyboardEvent.charcode). As a result, this implementation will most likely not work in older browsers.
Since the code is written in C++, it is trying to minimize the amount of JavaScript code to remain clean and lean.
Main features:
emscripten::glfw3::SetNextWindowCanvasSelector("#canvas2") to specify which canvas to use)emscripten::glfw3::MakeCanvasResizable(...) to make the canvas resizable by user.
Use "window" as the resize selector for full frame canvas (ex: ImGui))[!NOTE] The Comparison page details the differences between this implementation and the Emscripten built-in one.
Check out the live demo of the example code. Note that you need to use a "modern" browser to see it in action. Currently tested on Google Chrome 120+ and Firefox 121+.
The code for the demo is included in this project.
The demo shows 2 canvases each created via a glfwCreateWindow and shows how they respond to keyboard and mouse events
(using direct apis, like glfwGetMouseButton or callback apis like glfwSetMouseButtonCallback)
glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE))emscripten::glfw3::MakeCanvasResizable(window2, "#canvas2-container", "#canvas2-handle"))You can enable/disable each window/canvas independently:
The demo uses webgl to render a triangle (the hellow world of gpu rendering...).
| Application | Description |
|---|---|
| WebGPU Shader Toy (src) | WebGPU Shader Toy is a free and open source tool for experimenting with WebGPU fragment shaders and the WebGPU Shader Language (WGSL) |
| Example | Note |
|---|---|
| Demo (src) | Main test/demo which demonstrates most features of the implementation |
| example_asyncify (src) | The purpose of this example is to demonstrate how to use asyncify which allows the code to be written like you would for a normal desktop application |
| example_hi_dpi (src) | The purpose of this example is to demonstrate how to make the window Hi DPI aware |
| example_minimal (src) | The purpose of this example is to be as minimal as possible: initializes glfw, creates a window, then destroys it, and terminates glfw. Uses the default shell that comes with emscripten |
| example_resizable_container (src) | The purpose of this example is to demonstrate how to make the canvas resizable with another container (a surrounding div) driving its size. The container width is proportional to the size of the window and so as the window gets resized, so does the div, and so does the canvas |
| example_resizable_container_with_handle (src) | The purpose of this example is to demonstrate how to make the canvas resizable with a container that has a handle. The handle can be dragged around (left mouse drag), and the div is resized accordingly which in turn resizes the canvas, making the canvas truly resizable like a window |
| example_resizable_full_window (src) | The purpose of this example is to demonstrate how to make the canvas resizable and occupy the full window |
| example_pthread (src) | The purpose of this example is to demonstrate how to use pthread. It creates 2 threads that are incrementing a counter to simulate work on separate threads. Note that this test will only work if the proper HTTP headers are set. Github does not set these headers. |
| example_offscreen_canvas (src) | The purpose of this example is to demonstrate how to use an offscreen canvas. Note that this test will only work if the proper HTTP headers are set. Github does not set these headers. |
Since ImGui v1.91.0, ImGui can be configured to use this port, allowing full gamepad and clipboard support amongst many other advantages.
Since Emscripten 3.1.55, using this library is really easy via the Emscripten use-port option:
--use-port=contrib.glfw3 (no need to clone this repo at all!).
This is the recommended method to use this project.
Example:
emcc --use-port=contrib.glfw3 main.cpp -o build/index.html
With CMake, you need to provide the option both for compile and link phases:
target_compile_options(${target} PUBLIC "--use-port=contrib.glfw3")
target_link_options(${target} PUBLIC "--use-port=contrib.glfw3")
This is an example from ImGui (examples/example_emscripten_wgpu)
EMS += -s DISABLE_EXCEPTION_CATCHING=1 --use-port=contrib.glfw3
#LDFLAGS += -s USE_GLFW=3 -s USE_WEBGPU=1
LDFLAGS += -s USE_WEBGPU=1
The port can be configured with the following options:
| Option | Description |
|---|---|
disableJoystick | Boolean to disable support for joystick entirely, which can be useful if you don't need it due to polling |
disableWarning | Boolean to disable warnings emitted by the library (for example when using non supported features) |
disableMultiWindow | Boolean to disable multi window support which makes the code smaller and faster if you don't need it |
disableWebGL2 | Boolean to disable support for WebGL2 (which makes the code smaller) if you don't need it |
Example using disableWarning and disableMultiWindow:
emcc --use-port=contrib.glfw3:disableWarning=true:disableMultiWindow=true main.cpp -o build
Note about availability in Emscripten
Emscripten this port 6.0.7 3.5.1.20260809 5.0.3 3.4.0.20260301 4.0.23 3.4.0.20251230 4.0.16 3.4.0.20250927 4.0.14 3.4.0.20250824 4.0.11 3.4.0.20250607 4.0.5 3.4.0.20250305 4.0.4 3.4.0.20250209 4.0.2 3.4.0.20250117 4.0.1 3.4.0.20250112 4.0.0 3.4.0.20241230 Due to the release cadence of Emscripten, if you want to be in charge of which version you use, you can simply use the port checked in under
port:--use-port=port/emscripten-glfw3.py
[!NOTE] Emscripten automatically downloads and builds the library for you and stores it in its cache. If you want to delete the library from the cache, you can use the
embuildertool:# remove library from cache embuilder clear contrib.glfw3 # remove library from cache (with options) embuilder clear contrib.glfw3:disableWarning=true:disableMultiWindow=true
Check the documentation for details on how to use this implementation, including clipboard, joystick, resizable canvas, Hi DPI, etc... Note that care has been taken to be backward compatible with the pure JavaScript Emscripten built-in implementation.
Check the Building page for details on how to build this project.
GLFW_UNLIMITED_MOUSE_BUTTONStabindex attribute, the library automatically adds one to make sure that the
callback, set via glfwSetWindowFocusCallback, is called when the canvas is focused/unfocused.glfwMakeContextCurrent non-complianceemscripten_html5_remove_event_listener which makes the library safer to use (it no longer iterferes with
the client code). Note that the client should also use emscripten_html5_remove_event_listener in order not to
interfere with the library.glfwInit() breaks various input elementsglfwPollEvents()
is called. Make sure to call glfwPollEvents() at the beginning of the loop to ensure a flicker-free experience.
See Events & Main loop for more details.disableWebGL2 to disable support for WebGL2 when not needed (reduces JavaScript code size)GLFW_CONTEXT_VERSION_MAJOR and GLFW_CONTEXT_VERSION_MINORGLFW_CONTEXT_VERSION_MAJOR. Fixes #14.glfwCreateCursor)
canvas.toDataURL())cursor: url(xxx) xhot yhot, auto when calling glfwSetCursor with a custom cursoremscripten::glfw3::OpenURL)emscripten::glfw3::IsRuntimePlatformApple),
mostly used for keyboard shortcuts (Ctrl vs. Cmd).GLFW/emscripten_glfw3_version.h with EMSCRIPTEN_GLFW_VERSION define for compilation time version detectionEMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 port define now also contains the version[!WARNING] Breaking changes! The clipboard async API has been removed. Note that due to emscripten release cadence, these changes were never part of the emscripten port, so it is unlikely going to affect your project. Check the Clipboard support section for details on how to deal with the clipboard in your application.
nullptr issue when clipboard is emptyemscripten_glfw_get_clipboard_string the C version of emscripten::glfw3::GetClipboardString to
retrieve the clipboard asynchronouslyemscripten::glfw3::FutureClipboardString to greatly simplify the more frequent use-casesGetClipboardString::value() now returns the internal clipboard in case of error, instead of throwing exceptionoptimizationLevel option to the emscripten portemscripten::glfw3) included with GLFW3/emscripten_glfw3.h:
std::string_view / std::optional<std::string_view>
vs char const * which may or may not be nullptr)std::future)emscripten::glfw3::GetClipboardString which provides a way of fetching the global
clipboard in a browser environment (glfwGetClipboardString is not the right API due to the asynchronous nature
of the underlying platform API).glfwSetWindowPosCallbackGLFW_HOVEREDemscripten_glfw_make_canvas_resizable does not clean up properly.EM_BOOL (PR #5)Super/Meta key, there is no good solution.
The workaround implemented, releases all keys when Super is released.
Although not a perfect solution, it guarantees that the state is eventually consistent:
Release state)Pressed state)GLFW_PRESS or GLFW_RELEASEglfwGetClipboardString. Note that due to the async (and restrictive) nature of the
navigator.clipboard.readText call, this synchronous API returns whatever was set via a previous call
to glfwSetClipboardString and ignores the external clipboard entirely.glfwSetClipboardStringglfwGetWindowContentScale with nullptrglfw3native.h to GLFW. Although not used (at this moment) by this implementation, this allows
calling code to include it if necessary since it is part of a normal GLFW installation.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, GLFW_GAMEPAD_BUTTON_LEFT_THUMB and GLFW_GAMEPAD_BUTTON_RIGHT_THUMBGLFW_GAMEPAD_AXIS_LEFT_TRIGGER and GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER are now properly represented as an analog
value in the range [-1.0, +1.0]glfwGetPlatform and glfwPlatformSupported uses the GLFW_PLATFORM_EMSCRIPTEN constant defined in
emscripten-glfw3.h (officially reserved value is 0x00060006)glfwInitHint supports the new hint GLFW_PLATFORMglfwGetWindowTitleGLFW_SCALE_FRAMEBUFFER to enable (resp. disable) Hi DPI supportGLFW_FEATURE_UNAVAILABLE failure to report this error instead of a warningGLFW_MOUSE_PASSTHROUGH is not supportedGLFW_CURSOR_CAPTURED cursor input mode is not supported (not possible in a browser context)glfwInitAllocator is implemented as noop (could be supported for the C++ part only if there is demand, not javascript)GLFW_POSITION_X and GLFW_POSITION_Y are not supported (same as glfwSetWindowPos)GLFW_ANGLE_PLATFORM_TYPE is not supported (no direct access in browser, but implementation is most likely using it anyway)GLFW_SCALE_FRAMEBUFFER), the prior
constant used by this port (GLFW_SCALE_TO_MONITOR) is still accepted, but it is now deprecated. In addition,
due to the fact that GLFW_SCALE_FRAMEBUFFER defaults to GLFW_TRUE, this port is now Hi DPI aware by default and
needs to be explicitly turned off (glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_FALSE)) if this is the desired
behavior.emscripten_glfw3.h to work as a C filecreate-archive targetEMSCRIPTEN_GLFW3_DISABLE_JOYSTICK as a CMake optionEMSCRIPTEN_GLFW3_DISABLE_JOYSTICK defineEMSCRIPTEN_GLFW3_DISABLE_MULTI_WINDOW_SUPPORT as a CMake option and made the multi window code conditional
on EMSCRIPTEN_GLFW3_DISABLE_MULTI_WINDOW_SUPPORT defineGLFW_EMSCRIPTEN_CANVAS_SELECTOR window hint in favor of a new api emscripten_glfw_set_next_window_canvas_selectorGLFW_EMSCRIPTEN_CANVAS_RESIZE_SELECTOR and Module.glfwSetCanvasResizableSelector in favor of a new
api emscripten_glfw_make_canvas_resizablegetWindowPosition (canvas position in the browser window)glfwSetTime, glfwGetTimerValue and glfwGetTimerFrequency)glfwExtensionSupportedglfwSetWindowTitle (changes the browser window title)glfwWindowHintString(GLFW_EMSCRIPTEN_CANVAS_RESIZE_SELECTOR, "#canvas2-container")
from c/c++ code or Module.glfwSetCanvasResizableSelector('#canvas2', '#canvas2-container') from javascript)glfwShowWindow and glfwHideWindow)GLFW_FOCUS_ON_SHOW window hint/attributeGLFW_SCALE_FRAMEBUFFER can be used in glfwSetWindowAttrib)glfwSetWindowSizeLimits and glfwSetWindowAspectRatio)Module.glfwOnWindowCreated)EMSCRIPTEN_GLFW3_DISABLE_JOYSTICK compilation flagGLFW_CURSOR (handle all use cases: Normal / Hidden / Locked)glfwCreateStandardCursor and glfwSetCursor)glfwGetWindowOpacity and glfwSetWindowOpacity)glfwSetScrollCallback)glfwSetCursorEnterCallback)This project includes the glfw3.h and glfwnative.h headers (under external/GLFW) which use a ZLib license
C++
78.1%
JavaScript
7.4%
Python
6.2%
HTML
5.1%
CMake
2.6%
This project is an emscripten port of GLFW written in C++ for the web/webassembly platform #wasm
150
stars
320
commits
C++
primary language
Aug 18, 2026
updated
This project is an Emscripten port of GLFW written in C++ for the web/wasm platform. The currently supported GLFW API is 3.5.1.
The main goal of this project is to implement as much of the GLFW API that is possible to implement in the context of a web browser.
Since this project is targeting the web/webassembly platform, which runs in more recent web browsers, it is also trying
to focus on using the most recent features and not use deprecated features (for example, uses keyboardEvent.key
vs keyboardEvent.charcode). As a result, this implementation will most likely not work in older browsers.
Since the code is written in C++, it is trying to minimize the amount of JavaScript code to remain clean and lean.
Main features:
emscripten::glfw3::SetNextWindowCanvasSelector("#canvas2") to specify which canvas to use)emscripten::glfw3::MakeCanvasResizable(...) to make the canvas resizable by user.
Use "window" as the resize selector for full frame canvas (ex: ImGui))[!NOTE] The Comparison page details the differences between this implementation and the Emscripten built-in one.
Check out the live demo of the example code. Note that you need to use a "modern" browser to see it in action. Currently tested on Google Chrome 120+ and Firefox 121+.
The code for the demo is included in this project.
The demo shows 2 canvases each created via a glfwCreateWindow and shows how they respond to keyboard and mouse events
(using direct apis, like glfwGetMouseButton or callback apis like glfwSetMouseButtonCallback)
glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE))emscripten::glfw3::MakeCanvasResizable(window2, "#canvas2-container", "#canvas2-handle"))You can enable/disable each window/canvas independently:
The demo uses webgl to render a triangle (the hellow world of gpu rendering...).
| Application | Description |
|---|---|
| WebGPU Shader Toy (src) | WebGPU Shader Toy is a free and open source tool for experimenting with WebGPU fragment shaders and the WebGPU Shader Language (WGSL) |
| Example | Note |
|---|---|
| Demo (src) | Main test/demo which demonstrates most features of the implementation |
| example_asyncify (src) | The purpose of this example is to demonstrate how to use asyncify which allows the code to be written like you would for a normal desktop application |
| example_hi_dpi (src) | The purpose of this example is to demonstrate how to make the window Hi DPI aware |
| example_minimal (src) | The purpose of this example is to be as minimal as possible: initializes glfw, creates a window, then destroys it, and terminates glfw. Uses the default shell that comes with emscripten |
| example_resizable_container (src) | The purpose of this example is to demonstrate how to make the canvas resizable with another container (a surrounding div) driving its size. The container width is proportional to the size of the window and so as the window gets resized, so does the div, and so does the canvas |
| example_resizable_container_with_handle (src) | The purpose of this example is to demonstrate how to make the canvas resizable with a container that has a handle. The handle can be dragged around (left mouse drag), and the div is resized accordingly which in turn resizes the canvas, making the canvas truly resizable like a window |
| example_resizable_full_window (src) | The purpose of this example is to demonstrate how to make the canvas resizable and occupy the full window |
| example_pthread (src) | The purpose of this example is to demonstrate how to use pthread. It creates 2 threads that are incrementing a counter to simulate work on separate threads. Note that this test will only work if the proper HTTP headers are set. Github does not set these headers. |
| example_offscreen_canvas (src) | The purpose of this example is to demonstrate how to use an offscreen canvas. Note that this test will only work if the proper HTTP headers are set. Github does not set these headers. |
Since ImGui v1.91.0, ImGui can be configured to use this port, allowing full gamepad and clipboard support amongst many other advantages.
Since Emscripten 3.1.55, using this library is really easy via the Emscripten use-port option:
--use-port=contrib.glfw3 (no need to clone this repo at all!).
This is the recommended method to use this project.
Example:
emcc --use-port=contrib.glfw3 main.cpp -o build/index.html
With CMake, you need to provide the option both for compile and link phases:
target_compile_options(${target} PUBLIC "--use-port=contrib.glfw3")
target_link_options(${target} PUBLIC "--use-port=contrib.glfw3")
This is an example from ImGui (examples/example_emscripten_wgpu)
EMS += -s DISABLE_EXCEPTION_CATCHING=1 --use-port=contrib.glfw3
#LDFLAGS += -s USE_GLFW=3 -s USE_WEBGPU=1
LDFLAGS += -s USE_WEBGPU=1
The port can be configured with the following options:
| Option | Description |
|---|---|
disableJoystick | Boolean to disable support for joystick entirely, which can be useful if you don't need it due to polling |
disableWarning | Boolean to disable warnings emitted by the library (for example when using non supported features) |
disableMultiWindow | Boolean to disable multi window support which makes the code smaller and faster if you don't need it |
disableWebGL2 | Boolean to disable support for WebGL2 (which makes the code smaller) if you don't need it |
Example using disableWarning and disableMultiWindow:
emcc --use-port=contrib.glfw3:disableWarning=true:disableMultiWindow=true main.cpp -o build
Note about availability in Emscripten
Emscripten this port 6.0.7 3.5.1.20260809 5.0.3 3.4.0.20260301 4.0.23 3.4.0.20251230 4.0.16 3.4.0.20250927 4.0.14 3.4.0.20250824 4.0.11 3.4.0.20250607 4.0.5 3.4.0.20250305 4.0.4 3.4.0.20250209 4.0.2 3.4.0.20250117 4.0.1 3.4.0.20250112 4.0.0 3.4.0.20241230 Due to the release cadence of Emscripten, if you want to be in charge of which version you use, you can simply use the port checked in under
port:--use-port=port/emscripten-glfw3.py
[!NOTE] Emscripten automatically downloads and builds the library for you and stores it in its cache. If you want to delete the library from the cache, you can use the
embuildertool:# remove library from cache embuilder clear contrib.glfw3 # remove library from cache (with options) embuilder clear contrib.glfw3:disableWarning=true:disableMultiWindow=true
Check the documentation for details on how to use this implementation, including clipboard, joystick, resizable canvas, Hi DPI, etc... Note that care has been taken to be backward compatible with the pure JavaScript Emscripten built-in implementation.
Check the Building page for details on how to build this project.
GLFW_UNLIMITED_MOUSE_BUTTONStabindex attribute, the library automatically adds one to make sure that the
callback, set via glfwSetWindowFocusCallback, is called when the canvas is focused/unfocused.glfwMakeContextCurrent non-complianceemscripten_html5_remove_event_listener which makes the library safer to use (it no longer iterferes with
the client code). Note that the client should also use emscripten_html5_remove_event_listener in order not to
interfere with the library.glfwInit() breaks various input elementsglfwPollEvents()
is called. Make sure to call glfwPollEvents() at the beginning of the loop to ensure a flicker-free experience.
See Events & Main loop for more details.disableWebGL2 to disable support for WebGL2 when not needed (reduces JavaScript code size)GLFW_CONTEXT_VERSION_MAJOR and GLFW_CONTEXT_VERSION_MINORGLFW_CONTEXT_VERSION_MAJOR. Fixes #14.glfwCreateCursor)
canvas.toDataURL())cursor: url(xxx) xhot yhot, auto when calling glfwSetCursor with a custom cursoremscripten::glfw3::OpenURL)emscripten::glfw3::IsRuntimePlatformApple),
mostly used for keyboard shortcuts (Ctrl vs. Cmd).GLFW/emscripten_glfw3_version.h with EMSCRIPTEN_GLFW_VERSION define for compilation time version detectionEMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 port define now also contains the version[!WARNING] Breaking changes! The clipboard async API has been removed. Note that due to emscripten release cadence, these changes were never part of the emscripten port, so it is unlikely going to affect your project. Check the Clipboard support section for details on how to deal with the clipboard in your application.
nullptr issue when clipboard is emptyemscripten_glfw_get_clipboard_string the C version of emscripten::glfw3::GetClipboardString to
retrieve the clipboard asynchronouslyemscripten::glfw3::FutureClipboardString to greatly simplify the more frequent use-casesGetClipboardString::value() now returns the internal clipboard in case of error, instead of throwing exceptionoptimizationLevel option to the emscripten portemscripten::glfw3) included with GLFW3/emscripten_glfw3.h:
std::string_view / std::optional<std::string_view>
vs char const * which may or may not be nullptr)std::future)emscripten::glfw3::GetClipboardString which provides a way of fetching the global
clipboard in a browser environment (glfwGetClipboardString is not the right API due to the asynchronous nature
of the underlying platform API).glfwSetWindowPosCallbackGLFW_HOVEREDemscripten_glfw_make_canvas_resizable does not clean up properly.EM_BOOL (PR #5)Super/Meta key, there is no good solution.
The workaround implemented, releases all keys when Super is released.
Although not a perfect solution, it guarantees that the state is eventually consistent:
Release state)Pressed state)GLFW_PRESS or GLFW_RELEASEglfwGetClipboardString. Note that due to the async (and restrictive) nature of the
navigator.clipboard.readText call, this synchronous API returns whatever was set via a previous call
to glfwSetClipboardString and ignores the external clipboard entirely.glfwSetClipboardStringglfwGetWindowContentScale with nullptrglfw3native.h to GLFW. Although not used (at this moment) by this implementation, this allows
calling code to include it if necessary since it is part of a normal GLFW installation.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, GLFW_GAMEPAD_BUTTON_LEFT_THUMB and GLFW_GAMEPAD_BUTTON_RIGHT_THUMBGLFW_GAMEPAD_AXIS_LEFT_TRIGGER and GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER are now properly represented as an analog
value in the range [-1.0, +1.0]glfwGetPlatform and glfwPlatformSupported uses the GLFW_PLATFORM_EMSCRIPTEN constant defined in
emscripten-glfw3.h (officially reserved value is 0x00060006)glfwInitHint supports the new hint GLFW_PLATFORMglfwGetWindowTitleGLFW_SCALE_FRAMEBUFFER to enable (resp. disable) Hi DPI supportGLFW_FEATURE_UNAVAILABLE failure to report this error instead of a warningGLFW_MOUSE_PASSTHROUGH is not supportedGLFW_CURSOR_CAPTURED cursor input mode is not supported (not possible in a browser context)glfwInitAllocator is implemented as noop (could be supported for the C++ part only if there is demand, not javascript)GLFW_POSITION_X and GLFW_POSITION_Y are not supported (same as glfwSetWindowPos)GLFW_ANGLE_PLATFORM_TYPE is not supported (no direct access in browser, but implementation is most likely using it anyway)GLFW_SCALE_FRAMEBUFFER), the prior
constant used by this port (GLFW_SCALE_TO_MONITOR) is still accepted, but it is now deprecated. In addition,
due to the fact that GLFW_SCALE_FRAMEBUFFER defaults to GLFW_TRUE, this port is now Hi DPI aware by default and
needs to be explicitly turned off (glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_FALSE)) if this is the desired
behavior.emscripten_glfw3.h to work as a C filecreate-archive targetEMSCRIPTEN_GLFW3_DISABLE_JOYSTICK as a CMake optionEMSCRIPTEN_GLFW3_DISABLE_JOYSTICK defineEMSCRIPTEN_GLFW3_DISABLE_MULTI_WINDOW_SUPPORT as a CMake option and made the multi window code conditional
on EMSCRIPTEN_GLFW3_DISABLE_MULTI_WINDOW_SUPPORT defineGLFW_EMSCRIPTEN_CANVAS_SELECTOR window hint in favor of a new api emscripten_glfw_set_next_window_canvas_selectorGLFW_EMSCRIPTEN_CANVAS_RESIZE_SELECTOR and Module.glfwSetCanvasResizableSelector in favor of a new
api emscripten_glfw_make_canvas_resizablegetWindowPosition (canvas position in the browser window)glfwSetTime, glfwGetTimerValue and glfwGetTimerFrequency)glfwExtensionSupportedglfwSetWindowTitle (changes the browser window title)glfwWindowHintString(GLFW_EMSCRIPTEN_CANVAS_RESIZE_SELECTOR, "#canvas2-container")
from c/c++ code or Module.glfwSetCanvasResizableSelector('#canvas2', '#canvas2-container') from javascript)glfwShowWindow and glfwHideWindow)GLFW_FOCUS_ON_SHOW window hint/attributeGLFW_SCALE_FRAMEBUFFER can be used in glfwSetWindowAttrib)glfwSetWindowSizeLimits and glfwSetWindowAspectRatio)Module.glfwOnWindowCreated)EMSCRIPTEN_GLFW3_DISABLE_JOYSTICK compilation flagGLFW_CURSOR (handle all use cases: Normal / Hidden / Locked)glfwCreateStandardCursor and glfwSetCursor)glfwGetWindowOpacity and glfwSetWindowOpacity)glfwSetScrollCallback)glfwSetCursorEnterCallback)This project includes the glfw3.h and glfwnative.h headers (under external/GLFW) which use a ZLib license
C++
78.1%
JavaScript
7.4%
Python
6.2%
HTML
5.1%
CMake
2.6%