Commit Graph

146 Commits

Author SHA1 Message Date
Hajime Hoshi
c88ee0d0ad internal/uidriver/glfw: Bug fix: Unregister SetSize callback when undecorate the window
Closes #1586
2021-04-18 21:24:56 +09:00
Hajime Hoshi
f5a4216434 internal/uidriver/glfw: Bug fix: Do not call setWindowSize on iconifying
The window size might be 0 after iconifying. An iconified window is
invisible to users so setting a window size doesn't make sense anyway.

Closes #1585
2021-04-18 21:06:04 +09:00
Hajime Hoshi
78732d93f6 internal/uidriver/glfw: Bug fix: Crash on some operations on native fullscreen mode (macOS)
This change forbids some operations when the wiindow is natively
fullscreened on macOS in order to avoid crashes.

Closes #1578
2021-04-18 18:11:33 +09:00
Hajime Hoshi
fda1fd9a95 internal/uidriver/glfw: Bug fix: FramebufferSize callback was not called when the window size was not changed
Closes #1580
2021-04-18 15:22:51 +09:00
Hajime Hoshi
f09cf7fa47 internal/uidriver/glfw: Bug fix: Crash at Iconify
This is the same reason as Maximize.

Updates #1576
2021-04-18 01:03:13 +09:00
Hajime Hoshi
b5d4c834b8 internal/uidriver/glfw: Bug fix: More precise window size adjustment
Before this change, setWindowSize converts the size in device-
independent pixels once, invokes adjustWindowSizeBasedOnSizeLimitsInDP,
and then restore the values in device-dependent pixels. This might
introduce a slight error and then SetSize be unexpectedly invoked.
Such SetSize call with a slightly different size might not invoke
the FramebufferSize callback, and then this blocked forever when
maximizing the window.

This change fixes this by adjusting the size limits instead of the
window size so that the window size is not modified unexpectedly.

Closes #1577
2021-04-18 00:56:37 +09:00
Hajime Hoshi
d6ab27a5a2 internal/uidriver/glfw: Bug fix: Crash at Restore
This is the same reason as Maximize.

Updates #1576
2021-04-18 00:10:40 +09:00
Hajime Hoshi
37944d67c4 internal/uidriver/glfw: Update comments
Updates #1576
2021-04-18 00:05:48 +09:00
Hajime Hoshi
ab8477a21a internal/uidriver/glfw: Bug fix: Crash on Maximize
At least on macOS, Maximize invokes the SetSize callback in the game's
Update. This change fixes this issue by unregisting the callback
temporarily like what #1505 did.

Closes #1576
2021-04-18 00:02:58 +09:00
Hajime Hoshi
6df87a0383 internal/uidriver: Add comments
Updates #1575
2021-04-17 18:17:26 +09:00
Hajime Hoshi
deba352384 internal/uidriver/glfw: Prefer currentMonitor to get the monitor at deviceScaleFactor 2021-04-17 17:03:50 +09:00
Hajime Hoshi
585f173d1c internal/uidriver/glfw: Bug fix: Treat pixel units correctly
Updates #1385
2021-04-17 04:43:33 +09:00
Hajime Hoshi
99b2b5c1ee internal/glfw: Bug fix: compile error on Windows
Updates #1385
2021-04-17 04:24:19 +09:00
Hajime Hoshi
9b6ba5ed2c ebiten: Add {Set,}WindowSizeLimits
Closes #1385
2021-04-17 03:58:06 +09:00
Hajime Hoshi
d00d0c8556 ebiten: Add CursorShape/SetCursorShape/CursorShapeType
This change adds APIs to enable to use system cursor shapes other
than the default shape (an arrow).

This change doesn't add these cursors since they seem a little
different on macOS from the other platforms.

 * GLFW_HRESIZE_CURSOR
 * GLFW_VRESIZE_CURSOR

Closes #995
2021-04-16 01:09:19 +09:00
Hajime Hoshi
71e899acf3 internal/uidriver/glfw: Refactoring 2021-04-15 02:01:20 +09:00
Hajime Hoshi
990fb14f17 internal/uidriver/glfw: Separate createWindow and registring the callback
createWindow created a window and also registered the SetSize callback.
This was problematic in setWindowSize, since the callback was invoked
in setWindowSize unexpectedly.

This change separates createWindow and registring the callback so that
the created window in setWindowSize doesn't invoke the callback until
setWindowSize finishes.

Closes #1505
2021-03-06 17:48:28 +09:00
Hajime Hoshi
fda421c5fe internal/uidriver/glfw: Bug fix: SEGV at setWindowSize
u.window can be a different value before and after the function
setWindowSize.

Closes #1522
2021-03-03 23:04:35 +09:00
Hajime Hoshi
d913e66cd9 Revert "uidriver/glfw: Bug fix: Do not iconify the fullscreen window automatically"
This reverts commit 61bf10e73e.

Reason: This prevents the app from iconifying when toggling apps.

Updates #1405
Closes #1504
2021-02-23 20:13:21 +09:00
Hajime Hoshi
18d526c2d3 internal/uidriver/glfw: Bug fix: Crash when returning from fullscreen
ForceUpdate was called unexpectedly inside Update. This caused the
race condition.

Closes #1505
2021-02-23 16:52:12 +09:00
Hajime Hoshi
1517f80430 internal/uidriver/glfw: Refactoring 2021-02-11 04:02:18 +09:00
Hajime Hoshi
ec912e5cad internal/uidriver/glfw: Remove the dirty hack creating a temporary UI instance
Updates #1122
2021-02-11 03:45:39 +09:00
Hajime Hoshi
fea802b39d internal/uidriver: Replace mutex usages with atomic
Updates #1073
2021-02-11 02:38:15 +09:00
Hajime Hoshi
9400efa9a5 internal/uidriver/glfw: Update the screen on resizing
Closes #1204
2021-02-07 23:03:56 +09:00
Hajime Hoshi
d999b4dc8e internal/uidriver/glfw: Bug fix: Enable to specify ebiten.Image to SetWindowIcon
Closes #1468
2021-02-07 21:18:30 +09:00
Hajime Hoshi
61bf10e73e uidriver/glfw: Bug fix: Do not iconify the fullscreen window automatically
Fixes #1405
2020-10-27 03:14:55 +09:00
Jake Coffman
290f05060a
ebiten: Add ebitensinglethread build tag (#1396)
Updates #1367
2020-10-21 02:55:17 +09:00
Hajime Hoshi
f39f80c7c3 uidriver/glfw: Refactoring 2020-10-17 17:45:29 +09:00
Hajime Hoshi
974ec525fa uidriver/glfw: Refactoring 2020-10-17 15:09:12 +09:00
Hajime Hoshi
33fd7c935a uidriver/glfw: Avoid (*thread).Call when possible at (*UserInterface).loop
Updates #1367
2020-10-17 06:08:15 +09:00
Hajime Hoshi
cbb70d045c uidriver/glfw: Eliminate (*thread).Call at (*UserInterface).update
Updates #1367
2020-10-17 06:03:38 +09:00
Hajime Hoshi
ee50f611ee uidriver/glfw: Reduce (*thread).Call at (*UserInterface).updateSize
Updates #1367
2020-10-17 05:53:21 +09:00
Hajime Hoshi
d9906835ad uidriver/glfw: Reduce (*thread).Call at (*UserInterface).update
Updates #1367
2020-10-17 05:33:34 +09:00
Hajime Hoshi
1864c22ad6 uidriver/glfw: Reduce (*thread).Call at (*Input).update 2020-10-17 05:22:23 +09:00
Hajime Hoshi
495b2b722a uidriver/glfw: Reduce (*thread).Call at (*UserInterface).update 2020-10-17 04:38:15 +09:00
Hajime Hoshi
7762f5dcec uidriver/glfw: Reduce (*thread).Call 2020-10-17 04:33:34 +09:00
Hajime Hoshi
1db7bed2a7 uidriver/glfw: Refactoring 2020-10-17 02:57:03 +09:00
Hajime Hoshi
770661c609 driver: Refactoring: Remove (UIContext).Draw 2020-10-15 01:27:50 +09:00
Hajime Hoshi
eed619ad0f graphicsdriver/metal, graphicsdriver/opengl: Reland: Remove the thread usages for performance
Instead, graphicscommand package has a thread.

Updates #1367
2020-10-13 02:46:31 +09:00
Hajime Hoshi
713eee1117 Revert "graphicsdriver/metal, graphicsdriver/opengl: Remove the thread usages for performance"
This reverts commit 2942f10d9d.

Reason: Compile error on mobiles and runtime error on browsers
2020-10-13 02:12:02 +09:00
Hajime Hoshi
2942f10d9d graphicsdriver/metal, graphicsdriver/opengl: Remove the thread usages for performance
Instead, graphicscommand package has a thread.

Updates #1367
2020-10-13 01:50:54 +09:00
Hajime Hoshi
ee4ebaaa95 Clean up the 'js' build tags
Updates #1129
2020-10-07 02:07:03 +09:00
Hajime Hoshi
41cf90a321 ebiten: Change the default value of IsRunningOnUnfocused to be true
Fixes #1180
2020-10-07 00:30:49 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Hajime Hoshi
9890dc51da uidriver/glfw: Bug fix: Need to call updateVsync after setWindowSize
Fixes #1363
2020-09-22 18:45:56 +09:00
Hajime Hoshi
ee52c88e98 uidriver/glfw: Bug fix: Set the correct window size when going back from fullscreen 2020-09-21 19:20:58 +09:00
Hajime Hoshi
3fc328db8d uidriver/glfw: Adjust monitor sizes with math.Ceil
deviceScaleFactor() sometimes returns an unnice value (e.g.,
1.502361). Add math.Ceil whenever the calculation involves the
device scale factor.
2020-09-21 18:52:27 +09:00
Hajime Hoshi
40e35fa047 uidriver/glfw: Bug fix: Unscale the size for framebuffers on Linux/UNIX
Fixes #1307
2020-09-19 01:04:18 +09:00
Hajime Hoshi
97607f5779 graphicsdriver/glfw: Bug fix: Convert window size unit correctly on Linux/UNIX
Updates #1307
2020-09-19 00:31:34 +09:00
Hajime Hoshi
5278a7c6d6 uidriver/glfw: Bug fix: Use the correct scale for GLFW APIs on Linux/UNIX
Updates #1307
2020-09-19 00:21:10 +09:00