Tweaks on fullsccreen detection...
This commit is contained in:
parent
e5b5aea998
commit
5aed36e76d
1 changed files with 7 additions and 5 deletions
|
@ -498,7 +498,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
|||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData);
|
||||
static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData);
|
||||
static EM_BOOL EmscriptenKeyboardCallback(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData);
|
||||
static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
||||
static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData);
|
||||
|
@ -703,6 +703,7 @@ void InitWindow(int width, int height, const char *title)
|
|||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
// Detect fullscreen change events
|
||||
emscripten_set_fullscreenchange_callback("#canvas", NULL, 1, EmscriptenFullscreenChangeCallback);
|
||||
|
||||
// Support keyboard events
|
||||
|
@ -4424,7 +4425,6 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
|||
#endif
|
||||
|
||||
#if defined(PLATFORM_WEB)
|
||||
|
||||
// Register fullscreen change events
|
||||
static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *event, void *userData)
|
||||
{
|
||||
|
@ -4437,10 +4437,12 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte
|
|||
|
||||
if (event->isFullscreen)
|
||||
{
|
||||
CORE.Window.fullscreen = true;
|
||||
TRACELOG(LOG_INFO, "Canvas scaled to fullscreen. ElementSize: (%ix%i), ScreenSize(%ix%i)", event->elementWidth, event->elementHeight, event->screenWidth, event->screenHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
CORE.Window.fullscreen = false;
|
||||
TRACELOG(LOG_INFO, "Canvas scaled to windowed. ElementSize: (%ix%i), ScreenSize(%ix%i)", event->elementWidth, event->elementHeight, event->screenWidth, event->screenHeight);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue