瀏覽代碼

send fake screensize

pull/4480/head
ColleagueRiley 4 月之前
父節點
當前提交
2776510f47
共有 2 個文件被更改,包括 11 次插入12 次删除
  1. +3
    -3
      src/external/RGFW.h
  2. +8
    -9
      src/platforms/rcore_desktop_rgfw.c

+ 3
- 3
src/external/RGFW.h 查看文件

@ -8318,10 +8318,10 @@ EM_BOOL Emscripten_on_resize(int eventType, const EmscriptenUiEvent* e, void* us
}
EM_BOOL Emscripten_on_fullscreenchange(int eventType, const EmscriptenFullscreenChangeEvent* e, void* userData) {
static kt">bool fullscreen = false;
static n">u8 fullscreen = RGFW_FALSE;
static RGFW_rect ogRect;
if (fullscreen == b">false) {
if (fullscreen == ">RGFW_FALSE) {
ogRect = RGFW_root->r;
}
@ -8334,7 +8334,7 @@ EM_BOOL Emscripten_on_fullscreenchange(int eventType, const EmscriptenFullscreen
RGFW_root->r = RGFW_RECT(0, 0, e->elementWidth, e->elementHeight);
if (fullscreen == b">false) {
if (fullscreen == ">RGFW_FALSE) {
emscripten_set_canvas_element_size("#canvas", ogRect.w, ogRect.h);
RGFW_root->r = RGFW_RECT(0, 0, ogRect.w, ogRect.h);
}

+ 8
- 9
src/platforms/rcore_desktop_rgfw.c 查看文件

@ -1279,15 +1279,20 @@ int InitPlatform(void)
platform.window = RGFW_createWindow(CORE.Window.title, RGFW_RECT(0, 0, CORE.Window.screen.width, CORE.Window.screen.height), flags);
#ifndef PLATFORM_WEB_RGFW
RGFW_area screenSize = RGFW_getScreenSize();
CORE.Window.display.width = screenSize.w;
CORE.Window.display.height = screenSize.h;
/*
#else
CORE.Window.display.width = CORE.Window.screen.width;
CORE.Window.display.height = CORE.Window.screen.height;
#endif
/*
I think this is needed by Raylib now ?
If so, rcore_destkop_sdl should be updated too
*/
SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
if (CORE.Window.flags & FLAG_VSYNC_HINT) RGFW_window_swapInterval(platform.window, 1);
RGFW_window_makeCurrent(platform.window);
@ -1301,12 +1306,6 @@ int InitPlatform(void)
CORE.Window.render.height = CORE.Window.screen.height;
CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height;
TRACELOG(LOG_INFO, "DISPLAY: Device initialized successfully");
TRACELOG(LOG_INFO, " > Display size: %i x %i", CORE.Window.display.width, CORE.Window.display.height);
TRACELOG(LOG_INFO, " > Screen size: %i x %i", CORE.Window.screen.width, CORE.Window.screen.height);
TRACELOG(LOG_INFO, " > Render size: %i x %i", CORE.Window.render.width, CORE.Window.render.height);
TRACELOG(LOG_INFO, " > Viewport offsets: %i, %i", CORE.Window.renderOffset.x, CORE.Window.renderOffset.y);
}
else
{

Loading…
取消
儲存