Add GetMonitorScale() for PLATFORM_WEB
This commit is contained in:
parent
ab79cdb2f7
commit
0969f51298
|
|
@ -754,8 +754,11 @@ int GetMonitorRefreshRate(int monitor)
|
||||||
// Get specified monitor scale
|
// Get specified monitor scale
|
||||||
Vector2 GetMonitorScale(int monitor)
|
Vector2 GetMonitorScale(int monitor)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "GetMonitorScale() not implemented on target platform");
|
// NOTE: Returned scale is relative to the current monitor where the browser window is located
|
||||||
return (Vector2){ 1.0f, 1.0f };
|
Vector2 scale = { 1.0f, 1.0f };
|
||||||
|
scale.x = (float)EM_ASM_DOUBLE( { return window.devicePixelRatio; } );
|
||||||
|
scale.y = scale.x;
|
||||||
|
return scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the human-readable, UTF-8 encoded name of the selected monitor
|
// Get the human-readable, UTF-8 encoded name of the selected monitor
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user