Commit Graph

112 Commits

Author SHA1 Message Date
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
10d6a3ad67 uidriver/glfw: Bug fix: Crash on Wine when getting a monitor 2020-08-23 02:31:52 +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
d08f57e610 uidriver/glfw: Bug fix: Skip some special 'joysticks'
Apparently, there are some special devices that are recognized as
joysticks by GLFW, even though they are not. Such devices can have
too many 'buttons'. Skip them as a tentative solution.

Updates #1173
2020-07-03 22:58:49 +09:00
Hajime Hoshi
b7a1e85788 uidriver/glfw: Remove unused logics 2020-07-03 22:24:30 +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
e3def4ae50 uidriver/glfw: Update comments 2020-03-29 01:12:53 +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
4fe5acd711 ui: Panic on MaximizeWindow when the window is not resizable
On Windows, the window could be maximized even when the window was
not resizable. This behavior is confusing. Forbid it so that the
behavior will be clearer.
2020-03-28 22:08:48 +09:00
Hajime Hoshi
3e244d7a7c uidriver/glfw: Bug fix: compile error on Linux 2020-03-28 21:29:24 +09:00
Hajime Hoshi
8cca713d74 uidriver/glfw: Bug fix: adjustWindowPosition should consider the monitor position 2020-03-28 21:26:57 +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
6bc62b8f17 uidriver/glfw: Update comments 2020-03-15 15:42:05 +09:00
Hajime Hoshi
682f454fc2 input: Refactoring: Rename variables 2020-02-19 10:52:58 +09:00
corfe83
61c2d7cfe8
Simple optimization in IsKeyPressed (#1080)
Simple optimization on IsKeyPressed to avoid iterating through whole map of possible keys.
2020-02-16 02:02:05 +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
e797aed6c9 uidriver/glfw: Refactoring 2020-01-13 18:23:18 +09:00
Hajime Hoshi
c1adf60e69 uidriver/glfw: Rename files 2020-01-13 18:15:39 +09:00
Hajime Hoshi
b4819c4523
input: Rename GamepadGUID -> GamepadSDLID (#1049)
Gamepad GUID is a SDL specific notion and, strictly speaking,
they are not GUID (UUID) since they don't follow UUID's
specifications.

Renaming the function makes the situation clearer.

Updates #1048
2020-01-11 15:50:37 +09:00
Jake Bentvelzen
c17946bb82 ui: Add GamepadGUID and GamepadName functions (#1035)
Fixes #1034
2020-01-09 22:11:32 +09:00
Hajime Hoshi
9be3495077 driver: Remove Graphics.SetWindow
Fixes #1026
2020-01-03 19:04:48 +09:00
Hajime Hoshi
fa95275a02 uidriver/glfw: Bug fix: js should be excluded from compiling targets 2020-01-03 19:01:45 +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