Commit Graph

728 Commits

Author SHA1 Message Date
Hajime Hoshi
70ebd34d99 internal/ui: refactoring: separate setWindowSizeInDIPImpl to setWindowSizeInDIP and setFullscreen 2022-09-25 22:55:56 +09:00
Hajime Hoshi
f0dbf86799 internal/ui: refactoring: adjust the width earlier 2022-09-25 22:34:14 +09:00
Hajime Hoshi
c7deed6e72 internal/ui: add setFullscreen 2022-09-25 22:31:26 +09:00
Hajime Hoshi
e47f9ac38f internal/ui: bug fix: wrong bit operations
Closes #2349
2022-09-25 20:10:37 +09:00
Hajime Hoshi
9302230fef internal/ui: refactoring 2022-09-25 19:56:53 +09:00
Hajime Hoshi
98076bd512 internal/ui: refactoring: simplify initializing fullscreen 2022-09-25 18:28:57 +09:00
Hajime Hoshi
6167cc4f54 internal/ui: remove unnecessary function calls
updateSize was introduced at 7eff5cbd4a, but
apparently calling setWindowSizeInDIP was originally not needed.
2022-09-25 18:19:35 +09:00
Hajime Hoshi
25405783a7 internal/ui: refactoring
Updates #1816
2022-09-25 02:05:26 +09:00
Hajime Hoshi
c5867c3357 internal/ui: bug fix: avoid 0 as arguments for Layout
Updates #2340
2022-09-20 22:50:39 +09:00
Hajime Hoshi
b5ddee3e4a internal/ui: bug fix: reentering updateImpl caused double unlocking
updateImpl can be invoked in multiple ways. This should have been
protected by a mutex, or this caused unexpected reentrance.

Closes #2339
2022-09-20 13:19:43 +09:00
TotallyGamerJet
043397c20e
internal/ui: remove Cgo on darwin in ui_glfw_darwin.go (#2329)
Updates #1162
2022-09-16 11:53:46 +09:00
Hajime Hoshi
655cd4bf68 all: remove the build tag
Updates #1415
2022-09-15 00:23:40 +09:00
Hajime Hoshi
86706c0335 internal/graphicsdriver/opengl: add opengles build tag
This enables to use OpenGL ES instead of OpenGL.

Closes #292
2022-09-13 11:10:48 -07:00
Terra Brown
a1cc44833d
add errcheck static analysis (#2293)
Closes #2287
2022-09-10 01:52:46 +09:00
Hajime Hoshi
e505098e55 internal/ui: handle error at forceUpdateOnMinimumFPSMode
Updates #2287
2022-09-09 22:49:34 +09:00
Hajime Hoshi
bd43b42ee5 internal/ui: reland the screen shader in Kage
This change relads a part of the change to use the screen shader
instead of FilterScreen, but with the issue on iOS fixed.

Let's remove FilterScreen later.

Updates #2282
2022-09-06 18:48:19 +09:00
Hajime Hoshi
1d487be57b internal/ui: refactoring: remove unused members from EbitengineWindowDelegate
Closes #2297
2022-09-03 23:48:40 +09:00
Hajime Hoshi
55f6e8c3a1 internal/ui: rename EbitenWindowDelegate -> EbitengineWindowDelegate 2022-09-02 23:34:02 +09:00
Hajime Hoshi
0a92204e04 internal/ui: remove comments 2022-09-02 20:39:16 +09:00
Hajime Hoshi
7045605fdf internal/ui: bug fix: restore the window position after fullscreen exit on macOS
glfw.PollEvents was necessary to enable SetPos and SetSize after
exiting from fullscreen on macOS.

Closes #2296
2022-09-02 20:31:48 +09:00
Hajime Hoshi
4e4533c89d internal/ui: bug fix: do not call setFrame in windowDidExitFullScreen
Calling setFrame in windowDidExitFullScreen caused unexpected results
like a strange window size after fullscreen. Let's remove this.

By removing this, setting window position and size during fullscreen
will no longer work again. Let's fix this later.

Closes #2295
2022-09-02 17:48:23 +09:00
Kacper Drobny
9c177c1b8e
internal/ui: allow maximizeWindow when no max boundaries are set (#2291)
Closes #2290
2022-09-01 22:34:17 +09:00
Hajime Hoshi
ae41530f1c internal/graphicscommand: move availableFilename to graphicscommand 2022-08-31 13:26:14 +09:00
Hajime Hoshi
63e3c4adea Revert "internal/graphics: remove FilterScreen and use an original Kage program instead"
This reverts these commits

* 3259ef3daf
* 7c55065490
* 5bb70f485e

Reason: iOS crash. Probably we have to prepare a special rendering
pipeline for the final screen.

Closes #2278
2022-08-30 01:56:06 +09:00
Hajime Hoshi
3259ef3daf internal/ui: fix comments 2022-08-26 22:55:22 +09:00
Hajime Hoshi
7c55065490 internal/ui: simplify the screen shader 2022-08-26 22:49:17 +09:00
Hajime Hoshi
5bb70f485e internal/graphics: remove FilterScreen and use an original Kage program instead
Updates #2046
2022-08-26 17:41:29 +09:00
Hajime Hoshi
3b50e57f19 internal/ui: move convertUniforms to ui.Shader
This is a preparation to use a Kage program as the screen filter.

Update #2046
2022-08-26 17:41:26 +09:00
Hajime Hoshi
833473316f internal/ui: forbide RestoreWindow when the window size limits are specified
Closes #2259
2022-08-20 22:36:37 +09:00
Hajime Hoshi
31141d5112 internal/ui: forbid maximizing window when a window size is limited
Closes #2258
2022-08-20 22:24:13 +09:00
Hajime Hoshi
e150745598 internal/ui: bug fix: do not register a framebuffer-size callback on macOS
When a decorating state is switched, a framebuffer-size callback was
invoked but with wrong parameters on macOS.

This callback was originally implemented for i3 window manager, and
was not needed for macOS. Then, let's not use this on macOS. Probably
we can also skip this registering on Windows.

Updates #1960
Closes #2257
2022-08-20 19:10:42 +09:00
Hajime Hoshi
5b182efe7e internal/ui: forbide SetWindowSize when the window is maximized
On Windows, changing the size of a maximized window results in
unexpected states. Let's forbid this.

On macOS, a maximized window is just a regular window so it is
OK to allow resizing by `SetWindowSize`.

On Linux or other Unix, the behavior depends on window systems
and it is hard to expect what would happen, so forbid this just in
case.

Closes #1986
2022-08-15 16:29:20 +09:00
Hajime Hoshi
bc8e2fe6ac internal/glfw: bug fix: the window should be focused when closing is handled
Closes #2165
2022-08-12 22:34:19 +09:00
Hajime Hoshi
8081d0636a internal/cbackend: rename to nintendosdk
Updates #2242
2022-08-12 17:19:37 +09:00
Hajime Hoshi
e7c0a121c4 all: remove the build tag 'ebitencbackend'
This also automatically enables 'egl' when 'nintendosdk' is specified.

Updates #2242
2022-08-12 13:15:39 +09:00
Hajime Hoshi
dac6548c0c all: rename ebitenginecbackend to nintendosdk
Updates #2242
2022-08-12 02:05:29 +09:00
Hajime Hoshi
85aabf734b internal/ui: remove panic at (*glfwWindow).Maximize
Just doing nothing is more consistent with other functions.

Updates #1990
2022-08-10 22:18:55 +09:00
Hajime Hoshi
4104abdf77 internal/ui: refactoring 2022-08-10 21:34:39 +09:00
Hajime Hoshi
b5196a5a7c internal/ui: bug fix: glfwWindow.IsMaximized should not return true on fullscreen
Closes #2239
2022-08-10 21:17:13 +09:00
Hajime Hoshi
7a936f7052 internal/ui: enable SetWindowSize even with fullscreen on macOS
Closes #1590
2022-08-10 15:57:59 +09:00
Hajime Hoshi
085b64006d internal/ui: refactoring: indentation 2022-08-10 15:47:50 +09:00
Hajime Hoshi
2ab255dd1c internal/ui: refactoring: delay the call of outsideSize() 2022-08-10 14:53:28 +09:00
Hajime Hoshi
7eff5cbd4a internal/ui: refactoring: separate updateSize into updateSize and outsideSize 2022-08-10 14:50:20 +09:00
Hajime Hoshi
2480871155 internal/ui: bug fix: compile error 2022-08-10 12:11:32 +09:00
Hajime Hoshi
57fc4d438b internal/ui: refactoring: separate the Windows API part to another file 2022-08-10 11:51:35 +09:00
Hajime Hoshi
a57560105f internal/ui: refactoring: add userInterfaceImplNative for each OS 2022-08-10 11:44:03 +09:00
Hajime Hoshi
d0fa68691c internal/ui: enable some functions even on fullsceen
This is thanks to a GLFW v3.3.8 change:
9950cc52df

Updates #1590
2022-08-10 09:00:33 +09:00
Hajime Hoshi
a84a738360 internal/ui: bug fix: collectionBehavior mattered for fullscreen
Closes #2238
2022-08-10 01:06:26 +09:00
Hajime Hoshi
34aa52459e internal/ui: rename ReplacePixels -> WritePixels
Updates #2236
2022-08-08 03:32:26 +09:00
Hajime Hoshi
bd1b9cdb9b internal/mipmap: rename ReplacePixels -> WritePixels
Updates #2236
2022-08-08 03:32:21 +09:00
Hajime Hoshi
ea04e2a9de ebiten: remove returning error from ReadPixels
- As ReadPixels should often be used at Draw, error handling would be hard.
- Make the API consistent with ReplacePixels.

Updates #1995
2022-08-08 02:48:25 +09:00
Hajime Hoshi
81bd5b488c ebiten: add (*Image).ReadPixels
Closes #1995
2022-08-08 01:42:26 +09:00
Hajime Hoshi
72d5002e72 remove go2cpp support
Closes #2126
2022-08-07 22:17:53 +09:00
Hajime Hoshi
98894d66fb internal/ui: revert the fix for #2183
- `CGEventSourceKeyState` cannot treat right modifier keys correctly.
- Unpaired keyup and keydown are very common (especially on browsers)
  and this is not a serious issue.

Updates #2183
2022-08-06 11:19:56 +09:00
Hajime Hoshi
6d87be7169 internal/ui, internal/mipmap: refactoring: replace At with ReadPixels
Updates #1995
2022-08-06 00:32:42 +09:00
Hajime Hoshi
7b6ce7dcba internal/ui: bug fix: reset key states when the window is not focused on macOS
Updates #2183
2022-08-05 20:22:50 +09:00
Hajime Hoshi
e81c46a0d7 internal/ui: bug fix: vkKey definitions were not found on iOS 2022-08-05 19:10:42 +09:00
Hajime Hoshi
50f66963b0 internal/ui: refactoring 2022-08-05 19:07:47 +09:00
Hajime Hoshi
a7135ce10b internal/ui: fix build tags 2022-08-05 19:07:37 +09:00
Hajime Hoshi
a6004517dc internal/ui: use a direct method to get key states instead of events on macOS
Closes #2183
2022-08-05 19:04:01 +09:00
mattn
2bacecca24
fix typos (#2227) 2022-08-03 22:40:39 +09:00
Vseslav Kochenov
3ac37e250f
ebiten: add ReadDebugInfo for getting debug info (only graphics libray so far) (#2222)
Closes #2177
2022-07-31 02:56:16 +09:00
Hajime Hoshi
afed6a83c6 internal/graphics: change the naming convention: Num -> Count
This change also renames ebiten.MaxIndicesNum -> ebiten.MaxIndicesCount.
2022-07-13 02:02:44 +09:00
Hajime Hoshi
2203c3c448 internal/ui: remove the keypress event and the charCode preperty usages
These APIs are deprecated.

Closes #2199
2022-07-12 23:36:58 +09:00
Hajime Hoshi
55adc2113e internal/clock: Update -> UpdateFrame 2022-07-12 13:18:49 +09:00
Hajime Hoshi
e05df6a778 internal/ui: refactoring 2022-07-12 12:47:34 +09:00
Hajime Hoshi
c5e952d196 internal/ui: refactoring: reduce members from globalState 2022-07-12 12:35:07 +09:00
Hajime Hoshi
08e54ae1a6 internal/ui: rename the TPS functions
Updates #2071
2022-07-12 12:25:57 +09:00
Hajime Hoshi
28fd3ec9e5 add the ebitengine version build tags besides the ebiten version
Closes #2111
Updates #2190
2022-07-09 15:38:03 +09:00
Hajime Hoshi
428b1263d9 add ebitenginecbackend build tag besides ebitencbackend
Updates #2111
Updates #2190
2022-07-09 15:23:52 +09:00
Hajime Hoshi
204fb5935b add new environment variables with the EBITENGINE_ suffix
Updates #2111
Updates #2190
2022-07-09 15:00:28 +09:00
Hajime Hoshi
08ebab0558 internal/ui: better fix for initialMonitorByOS
Updates #2179
2022-07-04 14:42:21 +09:00
Hajime Hoshi
47c65a92ae internal/graphicsdriver/directx: bug fix: ignore DXGI_STATUS_OCCLUDED
When a screen is locked, an Ebitengine application crashed as the
swap chain's Present returned DXGI_STATUS_OCCLUDED.

Let's ignore the error and continue to run the applications. In the
ideal world, an application should stop running during the screen lock,
so let's revisit this later.

This fix also fixes the issue that a Win32API GetCursorPos returned
an error ERROR_ACCESS_DENIED when the screen was locked.

Closes #2179
2022-07-04 12:55:36 +09:00
Hajime Hoshi
f1037d8bff internal/ui: handle gamepad errors 2022-06-24 20:20:49 +09:00
Hajime Hoshi
506d534370 internal/ui: fix window sizes for Xbox
Updates #2084
2022-06-23 14:50:41 +09:00
Hajime Hoshi
9962fc5ee5 internal/graphicsdriver/direct: replace Get -> NewGraphics
Updates #2142
2022-06-17 11:48:40 +09:00
Hajime Hoshi
138463e219 internal/ui: rename chooseGraphicsDriver -> newGraphicsDriver 2022-06-17 02:40:39 +09:00
Hajime Hoshi
7484df0c5e internal/graphicsdriver/metal: replace Get with NewGraphics
This is a prepartion to return an error when a graphics driver, especially
DirectX, fails to initialize.

Updates #2142
2022-06-17 02:40:35 +09:00
Hajime Hoshi
a6d415ebf2
internal/graphicsdriver/opengl: replace Get with NewGraphics (#2146)
This is a prepartion to return an error when a graphics driver, especially
DirectX, fails to initialize.

Updates #2142
2022-06-17 02:02:29 +09:00
Hajime Hoshi
44cfb92cee internal/ui: bug fix: MaximizeWindow before Run caused an unexpected error on Windows
Closes #2137
2022-06-13 12:28:20 +09:00
Hajime Hoshi
71a32d2036 internal/ui: pass the canvas element directly instead of an ID 2022-06-11 15:34:17 +09:00
Hajime Hoshi
95628ee5f7 internal/ui: add a unique ID to the canvas for browsers 2022-06-11 15:24:50 +09:00
Hajime Hoshi
83ac234142 internal/ui: bug fix: offscreen images were created too often unexpectedly 2022-06-08 09:26:22 +09:00
Hajime Hoshi
81f91658ff internal/atlas: refactoring: remove SetVolatile and SetIsolate
Pass an image type to NewImage instead.
2022-06-08 01:08:00 +09:00
Hajime Hoshi
d3e3df812a internal/ui: recreate an offscreen image when isScreenClearedEveryFrame is toggled
This is a preparation to remove SetVolatile and SetIsolated in
the atlas package.
2022-06-07 23:16:42 +09:00
Hajime Hoshi
86a0a4154d internal/atlas: rename SetIsolate -> SetIsolated 2022-06-06 07:17:45 +09:00
Hajime Hoshi
b9012fc6ed internal/atlas: unify the term 'isolate' and 'independent' to 'isolate' 2022-06-06 00:28:23 +09:00
Hajime Hoshi
2eb4ef1a94 internal/gamepad: give a window from another package instead of GetActiveWindow
GetActiveWindow doesn't work on Xbox.

Updates #2084
2022-06-03 18:42:54 +09:00
Hajime Hoshi
0adb0c3860 internal/ui: bug fix: compile error 2022-06-01 02:09:10 +09:00
Hajime Hoshi
9c15bda275 internal/ui: return a null Window on Xbox
Updates #2084
2022-06-01 01:26:31 +09:00
Hajime Hoshi
ff868ba39f internal/ui: skip some functions for Xbox
Updates #2084
2022-06-01 00:58:36 +09:00
Hajime Hoshi
dcb5bb47c6 internal/glfw: unify the naming convension for Win32API 2022-06-01 00:48:22 +09:00
Hajime Hoshi
c379873a1f rename Ebiten -> Ebitengine 2022-05-25 22:48:19 +09:00
Hajime Hoshi
55657e72ae internal/ui: skip hideConsoleWindowOnWindows in Xbox
Updates #2084
2022-05-25 00:13:28 +09:00
Hajime Hoshi
ad5ebae3cc internal/ui: refactoring 2022-05-22 21:53:42 +09:00
Hajime Hoshi
f67b4cc1d6 internal/glfw: use a pure Go implementation of GLFW
This change removes internal/glfw/glfw, that is a DLL loader, and
replaces the usages with internal/glfwwin, that is a pure Go
implementation of GLFW for Windows.

The build tag `ebitenexternaldll` is also removed.

Closes #1764
2022-05-20 22:10:00 +09:00
Hajime Hoshi
eec5ea00ec internal/glfw: refactoring: use pointers or functions for callbacks 2022-05-20 17:49:46 +09:00
Hajime Hoshi
8d2b08dd14 internal/glfw: refactoring: make callback handlers consistent 2022-05-19 01:49:21 +09:00
Hajime Hoshi
3d00bb1fa2 internal/gamepad, internal/ui: type-cast returning values from Win32APIs just in case 2022-05-11 00:48:44 +09:00
Hajime Hoshi
38a2aa11fd internal/ui: bug fix: deadlock at Layout with Ebiten's image functions called
Closes #2079
2022-04-26 01:12:57 +09:00