Commit Graph

51 Commits

Author SHA1 Message Date
Artem Yadelskyi
10415d417a
all: replace interface{} with any (#2430)
Closes #2429
2022-11-03 15:33:09 +09:00
Hajime Hoshi
690e73c11b all: replace reflect.SliceHeader with unsafe.Slice
Closes #2420
2022-10-30 12:25:30 +09:00
Hajime Hoshi
8a7d860632 all: unify Windows error handlings for Windows HANDLE
Updates #2366
2022-10-02 02:22:06 +09:00
Hajime Hoshi
a9ba0db3d1 internal/glfwwin, internal/graphicsdriver/directx: bug fix: wrong error handlings for Windows HANDLE
Closes #2366
2022-10-02 01:57:24 +09:00
Hajime Hoshi
78802f18d9 internal/glfwwin: remove GetProcAddress 2022-09-18 18:04:02 +09:00
Hajime Hoshi
b1fff313ac internal/glfwwin: remove .errcheck_excludes_windows
The third returning value of Syscall is GetLastError, and the functions
like glGetIntegerv should not change the error state. Then it is safe
to ignore the errors.

Updates #2287
2022-09-10 02:18:37 +09:00
Terra Brown
a1cc44833d
add errcheck static analysis (#2293)
Closes #2287
2022-09-10 01:52:46 +09:00
Hajime Hoshi
7fab62158d internal/glfwwin: bug fix: do not allow maximizing window when the max size is specified
Closes #2289
2022-09-01 22:48:38 +09:00
Hajime Hoshi
abcacc26d8 internal/glfwwin: update for GLFW v3.3.8
Closes #2214
2022-08-07 15:03:33 +09:00
Hajime Hoshi
95fb4370db internal/glfwwin: remove the call of RemovePropW
This is unnecessary, and doesn't work on Xbox.

Also DestroyWindow doesn't work on Xbox so skip this on Xbox.

Updates #2084
2022-07-30 18:42:43 +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
c6c45aadfa Revert "Revert "internal/glfwwin: ignore errors from DWM functions""
This reverts commit 991cec993c.

Reason: Reverted a wrong commit
2022-06-03 13:59:16 +09:00
Hajime Hoshi
991cec993c Revert "internal/glfwwin: ignore errors from DWM functions"
This reverts commit 9ad87c0153.

Reason: Specifying nil for reading ranges is not efficient
2022-06-03 13:49:45 +09:00
Hajime Hoshi
9ad87c0153 internal/glfwwin: ignore errors from DWM functions
DWM functions might not be implemented on Proton. In the original
GLFW implementation, the returning values are not checked.

Updates #2113
2022-06-03 01:36:31 +09:00
Hajime Hoshi
c29c423686 internal/glfwwin, internal/graphicsdriver/directx: bug fix: HRESULT and Errno are imcompatible 2022-06-03 00:41:04 +09:00
Hajime Hoshi
7d95dddb1a internal/glfwwin: refactoring 2022-06-03 00:32:36 +09:00
Hajime Hoshi
666d50e83d internal/glfwwin: use HRESULT for an error value instead of GetLastError
GetLastError might not be reliable for some APIs like DwmFlush.

Updates #2113
2022-06-02 23:02:09 +09:00
Hajime Hoshi
4a684c4195 treat Windows error values as uint32 instead of windows.Handle
The error value are defined as windows.Handle (64bit) in
golang.org/x/sys/windows, but an actual type should be HRESULT (32bit).
This causes an issue that a returning value from a Windows API was
recognized as a non-zero error value though the value was not an error,
when the value's lower 32-bits are all zero.

See also https://github.com/golang/go/issues/48736#issuecomment-1143993096

Updates #2113
2022-06-02 12:10:21 +09:00
Hajime Hoshi
432365ff92 internal/glfwwin: ignore the error at SetProcessDpiAwarenessContext
Updates #2113
2022-06-01 23:11:06 +09:00
Hajime Hoshi
285a5cbc69 internal/glfwwin: skip some functions for Xbox
Updates #2084
2022-06-01 12:08:03 +09:00
Hajime Hoshi
6fc71e97bb internal/glfwwin: skip some functions for Xbox
Updates #2084
2022-06-01 00:35:43 +09:00
Hajime Hoshi
aa4a2b64e0 internal/glfwwin: bug fix: update _glfw.windows 2022-06-01 00:01:07 +09:00
Hajime Hoshi
ad380a32f4 internal/glfwwin: split GDK part to a new package internal/microsoftgdk
Updates #1162
2022-05-29 19:25:26 +09:00
Hajime Hoshi
7f46938ff7 internal/glfwwin: return an error at initWGL on Xbox
Updates #1162
2022-05-29 17:37:06 +09:00
Hajime Hoshi
59e6d4578b internal/glfw: skip some Win32APIs for Xbox
Updates #1162
2022-05-29 17:04:47 +09:00
Hajime Hoshi
ce147a7e38 internal/glfwwin: refactoring: remove Monitor.currentMode 2022-05-29 16:00:18 +09:00
Hajime Hoshi
2efbb819e0 internal/glfw: skip some Win32APIs for Xbox
Updates #1162
2022-05-29 15:54:37 +09:00
Hajime Hoshi
05d49c5a52 internal/glfwwin: create a pseudo monitor for Xbox
Updates #1162
2022-05-29 15:38:17 +09:00
Hajime Hoshi
f8163f93c0 internal/glfwwin: refactoring 2022-05-29 14:22:22 +09:00
Hajime Hoshi
ef7d10a36e internal/glfwwin: add a build tag microsoftgdk
Updates #1162
2022-05-29 01:31:42 +09:00
Hajime Hoshi
ac922742bf internal/glfw: use shorter copyright comments 2022-05-27 20:38:45 +09:00
Hajime Hoshi
f7d1a43e98 internal/glfwwin: remove GammaRamp 2022-05-27 20:19:12 +09:00
Hajime Hoshi
df0208ec79 internal/glfwwin: remove unused exported functions 2022-05-27 20:15:36 +09:00
Hajime Hoshi
3a6b707b29 internal/glfwwin: remove unused members (a monitor size) 2022-05-27 20:12:43 +09:00
Hajime Hoshi
f7172f41c8 internal/glfwwin: skip detecting monitors for Xbox
Updates #2084
2022-05-27 15:55:23 +09:00
Hajime Hoshi
604f14d2d4 internal/glfwwin: refactoring: reduce risky unsafe.Pointer usages 2022-05-25 02:21:30 +09:00
Hajime Hoshi
0d7062335e internal/glfwwin: remove GetProp and SetProp
GetProp and SetProp forced a risky usage of pointers.
2022-05-25 02:11:00 +09:00
Hajime Hoshi
ec2df98c70 internal/glfwwin: skip functions for Xbox
Updates #2084
2022-05-25 02:00:59 +09:00
Hajime Hoshi
847357c3ea internal/glfwwin: remove an unused function GetKeyName
MapVirtualKeyW is not available on Xbox.

Updates #2084
2022-05-25 01:00:32 +09:00
Hajime Hoshi
ffc9a0876a internal/glfwwin: remove changing the foreground lock timeout
See 58b48a3a00

Updates #2084
2022-05-25 00:34:54 +09:00
Hajime Hoshi
6cd655b5ce internal/glfwwin: bug fix: error values were not returned 2022-05-22 22:05:48 +09:00
Hajime Hoshi
0577a28aed all: add struct members for go-vet
Updates #1306
2022-05-22 22:05:40 +09:00
Hajime Hoshi
7eeef3ae0f internal/glfwwin: bug fix: WGL extension functions didn't work
Closes #2101
2022-05-22 00:40:50 +09:00
Hajime Hoshi
6fa39d5e73 internal/glfw: make panic messages consistent 2022-05-21 13:19:11 +09:00
Hajime Hoshi
9a1eb0b124 internal/glfwwin: bug fix: wrong type casts (TlsGetValue) 2022-05-21 00:59:14 +09:00
Hajime Hoshi
93731673ad internal/glfwwin: bug fix: wrong type casts 2022-05-21 00:56:22 +09:00
Hajime Hoshi
374f1cf8e6 internal/glfwwin: fix typo 2022-05-21 00:18:36 +09:00
Hajime Hoshi
bd2a31bdd8 internal/glfwwin: remove unnecessary comments 2022-05-20 23:17:03 +09:00
Hajime Hoshi
8c467aaa1b internal/glfwwin: update GLFW to 3.3.7
Reference: 597ae79a86
2022-05-20 23:09:16 +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