Hajime Hoshi
a3b41515a9
ui: Replace the native window's type (unsafe.Pointer) with uintptr
...
Updates #1306
2020-09-04 00:51:48 +09:00
Hajime Hoshi
349faa0f34
thread: Use an error value instead of context.Context
2020-08-30 02:18:12 +09:00
Hajime Hoshi
1ed2b09ba0
uidriver/glfw: Ensure that canceling happens after all the queued tasks are done
2020-08-29 23:27:20 +09:00
Hajime Hoshi
932d599c98
uidriver/glfw: Bug fix compilation failure on macOS and Windows
2020-08-24 03:31:46 +09:00
Hajime Hoshi
a7d234e3c8
uidriver/glfw: Refactoring: make currentMonitorByOS more explicit
2020-08-24 03:27:38 +09:00
Hajime Hoshi
9bff1c79be
uidriver/glfw: Refactoring
2020-08-24 03:05:38 +09:00
Hajime Hoshi
af6961fc17
uidriver/glfw: Bug fix: isInitWindowMaximized didn't unlock the mutex
2020-08-24 02:55:31 +09:00
Hajime Hoshi
b1bc06935a
uidriver/glfw: Update comments
2020-08-24 00:57:48 +09:00
Hajime Hoshi
ed3a4a734e
uidriver/glfw: Refactoring
2020-08-24 00:34:57 +09:00
Hajime Hoshi
9f8054c2d5
uidriver/glfw: Misspelling
2020-08-24 00:10:43 +09:00
Hajime Hoshi
07480ed66d
uidriver/glfw: Add better fallbacks for currentMonitorFromPosition
...
Updates #1119
2020-08-23 23:38:03 +09:00
Hajime Hoshi
77fa0cb9ef
ui: Add SetInitFocused
...
Fixes #769
2020-08-23 02:19:09 +09:00
Hajime Hoshi
3eaa7dd0e1
uidriver/glfw: Set No-API when creating a hidden window first
...
GLFW tries to create an OpenGL context by default when creating a
window. This is not necessary when OpenGL is not used. This is an
optimization by skipping to create an OpenGL context if possible.
2020-07-05 15:01:06 +09:00
Hajime Hoshi
d98713728a
uidriver/glfw: Bug fix: SetVsyncEnabled(false) did not work before the main loop
...
Fixes #1197
2020-06-14 11:50:58 +09:00
Hajime Hoshi
7b960a2df4
uidriver/glfw: Use the actual window size for the offscreen
...
On Windows, a specified window size might not match with the
actual window size when the size is too big. In this case, Ebiten
could not render the offscreen well and the upper side was cropped.
To avoid this, use the actual window size for the offscreen.
Fixes #1163
2020-05-22 18:18:38 +09:00
Hajime Hoshi
8777140e91
driver: Simplify UIContext.Update
2020-04-03 00:18:27 +09:00
Hajime Hoshi
a718ddbf7e
driver: Add UIDriver.Draw
...
This is a preparation for XNA.
Updates #1078
2020-04-01 02:55:50 +09:00
Hajime Hoshi
b09fe7157b
uidriver/glfw: Update comments
2020-03-29 01:33:23 +09:00
Hajime Hoshi
9d5c35f029
uidriver/glfw: Bug fix: Initilizing the window position and the size in this order on Windows
...
It looks like the order is different on Windows from Linux. We
are not sure why.
Updates #1118
2020-03-29 00:50:19 +09:00
Hajime Hoshi
b7ab3d2df4
uidriver/glfw: Avoid using the window position before initializing
...
Especially in the initial phase before calling Run/RunGame, the
window position is not reliable and then getting the device scale
factor does not make sense based on the window position. Avoid
using the window position, and instead use the glfw.Monitor in
this situation.
2020-03-29 00:09:08 +09:00
Hajime Hoshi
14200eb42c
uidriver/glfw: Add comments
2020-03-29 00:02:33 +09:00
Hajime Hoshi
8480f888dd
Revert "uidriver/glfw: Bug fix: Do not use the window position for monitors"
...
Revert "uidriver/glfw: Bug fix: compile error on Linux"
This reverts commit 0a5126f776
.
This reverts commit 3e244d7a7c
.
Reason: GetMonitor is available only on fullscreen mode
2020-03-28 23:56:03 +09:00
Hajime Hoshi
e628350d4e
uidriver/glfw: Bug fix: Initializing order mattered
...
Especially on Linux, the window size and the window position must
be initialized in this order.
Fixes #1118
2020-03-28 23:37:21 +09:00
Hajime Hoshi
34acf788d2
uidriver/glfw: Bug fix: Call Maximize explictly instead of the hint
...
Fixes #1117
2020-03-28 22:34:01 +09:00
Hajime Hoshi
0a5126f776
uidriver/glfw: Bug fix: Do not use the window position for monitors
...
Especially in the initial phase before calling Run/RunGame, the
window position is not reliable and then getting the device scale
factor does not make sense based on the window position. Avoid
using the window position, and instead use the glfw.Monitor.
2020-03-28 21:13:30 +09:00
Hajime Hoshi
7b5fb0a0d0
ui: Bug fix: The window was not shown on the secondary monitor on launching
...
This change changes the behavior of WindowPosition /
SetWindowPosition. The window position is now a relative position
and the origin position is the left-upper of the current monitor.
Fixes #1115
2020-03-28 19:51:47 +09:00
Hajime Hoshi
f317f3b5fd
ui: Add fuctions to maximize or minimize the window
...
This change adds these functions:
* MaximizeWindow
* IsWindowMaximized
* MinimizeWIndow
* IsWindowMinimized
* RestoreWindow
Fixes #994
2020-03-21 22:13:58 +09:00
Hajime Hoshi
978ee26898
ui: Add function aliases *OnUnfocused for *InBackground
...
Now a window can be floating with SetWindowFloating, the functions
that have suffix 'IsBackground' seems misleading. However, we
cannot rename them due to backward compatibility. Then, let's add
aliases and revisit them when updating the major version of Ebiten.
Fixes #1102
2020-03-21 00:42:00 +09:00
Hajime Hoshi
56358fd0c4
ui: Rename IsForeground -> IsFocused
...
Updates #1102
2020-03-21 00:12:47 +09:00
Hajime Hoshi
4ef3b3e804
ui: Add SetWindowFloating / IsWindowFloating
...
Fixes #880
2020-03-20 22:16:27 +09:00
Hajime Hoshi
d59aea1db1
driver: Remove the return value from RunWithoutMainLoop
2020-02-11 23:56:53 +09:00
Hajime Hoshi
c927d33457
mobile/ebitenmobileview: Use the common uiContext for layouting
...
This means that the whole offscreen is cleared correctly.
This change is a little breaking change: SetScreenSize or other
functions no longer works on ebitenmobile. Use Layout instead.
Fixes #1019
2020-02-11 19:40:47 +09:00
Hajime Hoshi
099ce1b3b4
Revert "ui: Add SetInitFocused"
...
This reverts commit bb04fc8a29
.
Reason: glfw.Focused / glfw.FocusOnShow did not work
Updates #769
2020-02-10 01:10:40 +09:00
Hajime Hoshi
bb04fc8a29
ui: Add SetInitFocused
...
Updates #769
2020-02-09 23:45:59 +09:00
Zachary Burkett
6686044452
ui: Add IsForeground API to glfw driver ( #1058 )
...
Updates #1037
2020-01-16 10:47:23 +09:00
Hajime Hoshi
9be3495077
driver: Remove Graphics.SetWindow
...
Fixes #1026
2020-01-03 19:04:48 +09:00
Hajime Hoshi
982b7d6ddc
driver: Let UI have Graphics
...
Now UIs own the implementation of Graphics.
Updates #1026
2020-01-03 18:32:27 +09:00
zamadatix
c4dfc69c81
Typo Corrections from https://goreportcard.com/ ( #1042 )
...
Correct typo found by https://goreportcard.com/
2020-01-01 23:59:56 +09:00
Hajime Hoshi
9ed8279fc8
driver: Add interface Window
2019-12-25 00:24:21 +09:00
Hajime Hoshi
049aa552d4
ui: Add SetWindowResizable
...
This change also fixes example/windowsize.
Fixes #320
2019-12-22 19:26:04 +09:00
Hajime Hoshi
c9863284cf
uidriver/glfw: Set a default window size
...
Now RunGame can be called without SetWindowSize.
2019-12-22 12:51:36 +09:00
Hajime Hoshi
7d56e4335e
ui: Add RunGame, WindowSize and SetWindowSize
...
This change introduces the new APIs RunGame, WindowSize and
SetWindowSize. These new APIs hides the notion of 'scale', and is
more flexible with the outside size change. This means that we can
introduce a resizable window.
This change also adds -legacy flag to examples/windowsize. If the
flag is off, the new APIs are used.
This change deprecates these functions since the notion of 'scale'
is deprecated:
* ScreenScale
* ScreenSizeInFullscreen
* SetScreenScale
* SetScreenSize
Fixes #943 , #571
Updates #320
2019-12-22 03:35:31 +09:00
Hajime Hoshi
57d527bea2
driver: Remove 'title' argument from UI.Run
2019-12-22 01:41:51 +09:00
Hajime Hoshi
8b995b086b
driver: Remove some arguments from UI.Run
2019-12-21 22:52:23 +09:00
Hajime Hoshi
dabaf66b81
uidriver: Remove width/height/scale arguments from run
...
The initial window position is determined on ebiten package side.
Updates #943
2019-12-21 20:10:58 +09:00
Hajime Hoshi
d07028735f
uidriver/glfw: Refactoring
2019-12-21 19:52:07 +09:00
Hajime Hoshi
987f333d95
uidriver/glfw: Rename variables
2019-12-21 17:34:58 +09:00
Hajime Hoshi
2e8358529c
uidriver/glfw: Bug fix: WindowPos/SetWindowPos should convert pixels
...
This change also enables these functions even on fullscreen mode.
Fixes #1010
2019-12-21 17:03:19 +09:00
Hajime Hoshi
bda11b0e17
driver: Add UI.SetWindowSize and UIContext.Layout
...
This is a preparation to introduce RunGame function.
Updates # 943 (Fix this line before committing)
2019-12-15 02:29:43 +09:00
Zachary Burkett
ed19d6fae9
Add cursor capture functionality ( #1016 )
...
Fixes #1016
2019-12-14 12:30:03 +09:00
Hajime Hoshi
2871795895
uidriver/glfw: Refactoring: Remove mutex from Input
...
Mixing a thread and a mutex is risky. Use a thread if possible.
2019-12-12 03:20:24 +09:00
Hajime Hoshi
00fb4cd2f9
uidriver/glfw: Refactoring: Remove windowWidthInDP
2019-12-09 01:39:42 +09:00
Hajime Hoshi
190feb6ecd
uidriver/glfw: Rename variables
...
DP represents a device independent pixel.
2019-12-09 00:19:38 +09:00
Hajime Hoshi
c243bfcdd8
uidriver/glfw: Fix comments
2019-12-08 23:03:13 +09:00
Hajime Hoshi
3e89e7e561
uidriver/glfw: Bug fix: Show the window at last on initialization
2019-12-08 23:00:10 +09:00
Hajime Hoshi
e00a190f22
uidriver/glfw: Refactoring: Add toDeviceIndependentPixel / toDeviceDependentPixel
2019-12-08 22:09:12 +09:00
Hajime Hoshi
a0cf8bac21
uidriver/glfw: Refactoring: Limit the calls of devicescale.GetAt
2019-12-08 20:55:40 +09:00
Hajime Hoshi
8e9f5b9535
driver: Remove Suspend/ResumeAudio from UIContext
2019-12-08 16:17:02 +09:00
Hajime Hoshi
63fbffa9f6
uidriver/glfw: Fix thread issues at reqWidth/reqHeight
2019-12-08 02:44:14 +09:00
Hajime Hoshi
22e3db6814
uidriver/glfw: Add comments
...
Updates #1004
2019-12-08 02:04:04 +09:00
Hajime Hoshi
80fbc9701c
uidriver/glfw: Force to swap buffer or recreate an window after toggling fullscreen
...
This change resolves a bug that an image lag remains after
toggling fullscreen.
On OpenGL, swapping buffer is necessary after toggling fullscreen.
On Metal, recreating a window works after toggling fullscreen.
Fixes #1004
2019-12-08 01:47:32 +09:00
Hajime Hoshi
2180613e2a
uidriver/glfw: Refactoring: Add createWindow
2019-12-07 19:56:56 +09:00
Hajime Hoshi
67ee0ff5d4
uidriver/glfw: Refactoring: Remove forceSetScreenSize
2019-12-07 17:35:57 +09:00
Hajime Hoshi
b35ffa57b3
Revert "uidriver/glfw: Remove the dirty hack for GLFW 3.2"
...
This reverts commit d1da5b4920
.
Reason: The dirty hack might still be needed.
2019-12-02 01:06:55 +09:00
Hajime Hoshi
d1da5b4920
uidriver/glfw: Remove the dirty hack for GLFW 3.2
...
See also https://github.com/glfw/glfw/issues/1334 .
Updates #703
2019-12-02 01:04:28 +09:00
Hajime Hoshi
5153713469
uidriver/glfw: Make the panic messages more consistent
2019-12-01 03:34:09 +09:00
Hajime Hoshi
0ec447e0d0
ui: Add SetScreenTransparent / IsScreenTransparent
...
Fixes #1001
2019-12-01 03:31:32 +09:00
Hajime Hoshi
b8a099e354
ui: Bug fix: (Set)WindowPosition didn't work well with fullscreen mode
2019-12-01 00:39:04 +09:00
Hajime Hoshi
6cd0b44baa
uidriver/glfw: Use invalidPos instead of pointers
2019-12-01 00:21:11 +09:00
Hajime Hoshi
e463f9e611
ui: Make (Set)WindowPosition concurrent safe
2019-12-01 00:11:46 +09:00
Hajime Hoshi
9b2f864fc8
ui: Add SetWindowPosition(x, y int)
...
Fixes #936
2019-11-30 23:22:39 +09:00
Hajime Hoshi
c021d6be6a
ui: Add WindowPosition()
...
Fixes #936
2019-11-30 22:37:56 +09:00
Hajime Hoshi
e0d780b029
uidriver/glfw: Enable to call SetWindowDecorated after Run
...
Fixes #556
2019-11-26 11:46:18 +09:00
Hajime Hoshi
a040aae83b
glfw: Update to GLFW 3.3
...
Fixes #1000
2019-11-26 01:19:20 +09:00
Hajime Hoshi
92e056c508
uidriver/glfw: Bug fix: an unexpected window at launching
...
Fixes #986
2019-11-17 19:58:44 +09:00
Hajime Hoshi
800b98a0c6
ui: Bug fix: a window was alwasy 'unfocused' on Windows
...
There is an issue in GLFW that a window was recognized as unfoces
on Windows (glfw/glfw#1573). As a workaround, skip the logic for
an unfocused window on Windows. On Windows, even if a window is in
another workspace, vsync works. Then there seems no problem.
Fixes #987
2019-11-17 14:10:38 +09:00
Hajime Hoshi
bfd5774faf
graphicsdriver/glfw: Bug fix: CPU was busy when the window is hidden
...
Fixes #982
2019-11-14 23:11:36 +09:00
Hajime Hoshi
a1a294df72
uidriver/glfw: Bug fix: Freeze on Wayland
...
Fixes #974
2019-11-10 19:26:49 +09:00
Hajime Hoshi
572780ed6d
uidriver/glfw: Bug fix: errors are ignored at (*UserInterface).run
...
Updates #978
2019-11-10 19:09:41 +09:00
Hajime Hoshi
d43e203ccf
uidriver/glfw: Remove a redundant 'if' branch
2019-11-10 17:34:14 +09:00
Hajime Hoshi
d7aa24c295
uidriver/glfw: Bug fix: Wrong usage of RWLock
2019-08-19 01:47:55 +09:00
Hajime Hoshi
4d0e23c460
uidriver/glfw: Reduce mutex to avoid potential deadlock
2019-08-19 01:01:43 +09:00
Hajime Hoshi
e6a88a7d1f
uidriver/glfw: Add panic in the case of Windows Remote Desktop
...
Updates #903
2019-07-21 23:41:55 +09:00
Hajime Hoshi
de4b439228
uidriver/glfw: Bug fix: Thread must be set before the loop starts
...
The graphics driver needs to have its thread before the loop
starts, or the driver crashes (nil reference) when it tries to use
the thread.
2019-06-24 02:03:14 +09:00
Hajime Hoshi
8dc2301e54
thread: Bug fix: Queue funcs instead of panic
...
Now the thread object is created at (*UserInterface).Run, we don't
have to care whether the (main) thread is started or not when
Call is called. Admit queueing the functions.
Fixes #884
2019-06-21 11:10:27 +09:00
Hajime Hoshi
449679665b
thread: Use standard context.Context
2019-06-08 01:46:06 +09:00
Hajime Hoshi
85dcafe176
thread: Rename Run -> Call
2019-06-06 00:25:57 +09:00
Hajime Hoshi
15a5896efd
thread: Rename mainthread -> thread and add struct Thread
...
This enables thread available not only for the main thread but also
any threads.
This is a preparation for iOS Metal, that runs drawing functions on
a particular thread.
Updates #737
2019-06-06 00:25:53 +09:00
Hajime Hoshi
db689f4e50
driver: Remove UI.Loop and add UI.RunWithoutMainLoop
2019-04-09 21:55:59 -04:00
Hajime Hoshi
24fdcdd8e4
uidriver: Rename updateGraphics -> updateSize
2019-04-08 23:49:31 -04:00
Hajime Hoshi
f6367308fc
driver: Rename GraphicsContext -> UIContext
2019-04-08 23:28:08 -04:00
Hajime Hoshi
aecfd6b13d
uidriver: Remove dependency on hooks package
2019-04-08 23:13:44 -04:00
Hajime Hoshi
0aa3135082
driver: Remove UI.AdjustPosition
2019-04-07 19:31:49 +09:00
Hajime Hoshi
26c32d36b5
uidriver: Move input implementation to uidrivers
2019-04-07 19:16:00 +09:00
Hajime Hoshi
a1697feeb1
driver: Add UI.Input()
2019-04-07 18:37:54 +09:00
Hajime Hoshi
7e5085f15b
Add uidriver package and move UI implementation to this packaage
2019-04-07 18:21:16 +09:00