summaryrefslogtreecommitdiffhomepage
path: root/src/platforms
diff options
context:
space:
mode:
authorubkp <[email protected]>2023-12-14 16:55:33 -0300
committerGitHub <[email protected]>2023-12-14 20:55:33 +0100
commit10c82595b0b239f34baf34ae0faa5bca9d5088c8 (patch)
treec1cdecfa1bb01b85d791ca7d8dffa71c09f5941b /src/platforms
parent38626dcffdf03b031491bdc6b6df97d9aee2a6e3 (diff)
downloadraylib-10c82595b0b239f34baf34ae0faa5bca9d5088c8.tar.gz
raylib-10c82595b0b239f34baf34ae0faa5bca9d5088c8.zip
Add GetMonitorWidth() and GetMonitorHeight() implementations for PLATFORM_WEB (#3636)
Diffstat (limited to 'src/platforms')
-rw-r--r--src/platforms/rcore_web.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c
index 76e7dba3..57fd7656 100644
--- a/src/platforms/rcore_web.c
+++ b/src/platforms/rcore_web.c
@@ -572,15 +572,17 @@ Vector2 GetMonitorPosition(int monitor)
// Get selected monitor width (currently used by monitor)
int GetMonitorWidth(int monitor)
{
- TRACELOG(LOG_WARNING, "GetMonitorWidth() not implemented on target platform");
- return 0;
+ int w = 0;
+ w = EM_ASM_INT( { return screen.width; }, 0);
+ return w;
}
// Get selected monitor height (currently used by monitor)
int GetMonitorHeight(int monitor)
{
- TRACELOG(LOG_WARNING, "GetMonitorHeight() not implemented on target platform");
- return 0;
+ int h = 0;
+ h = EM_ASM_INT( { return screen.height; }, 0);
+ return h;
}
// Get selected monitor physical width in millimetres
@@ -946,7 +948,7 @@ int InitPlatform(void)
// NOTE: Some GLFW flags are not supported on HTML5
// e.g.: GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_MOUSE_PASSTHROUGH
-
+
// Scale content area based on the monitor content scale where window is placed on
// NOTE: This feature requires emscripten 3.1.51
//if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE);