Commit Graph

2854 Commits

Author SHA1 Message Date
Hajime Hoshi
8967384dac internal/graphicsdriver: Bug fix: getting a WebGL2 context might fail even though WebGL2RenderingContext exists
Closes #1738
2021-08-01 22:00:47 +09:00
Hajime Hoshi
4e6a5a9fa2 internal/atlas: Bug fix: Wrong screenshot size
Updates #1736
2021-07-29 16:33:54 +09:00
Hajime Hoshi
18903db1c6 internal/atlas: Bug fix: Unexpected padding in screenshots
Closes #1736
2021-07-29 16:09:29 +09:00
Hajime Hoshi
59aa41a3c2 internal/affine: Improve ColorM Scale's performance
The benchmark result comparing the previous commit and this commit is this:

```
name           old time/op    new time/op    delta
ColorMScale-8    9.75µs ± 6%    1.30µs ±22%  -86.67%  (p=0.000 n=10+9)

name           old alloc/op   new alloc/op   delta
ColorMScale-8   1.34kB ±100%    1.19kB ±19%     ~     (p=0.421 n=10+8)

name           old allocs/op  new allocs/op  delta
ColorMScale-8      3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=10+10)
```

Updates #1658
2021-07-27 13:45:09 +09:00
Hajime Hoshi
bcb30f8595 Update go-gl/glfw for GLFW 3.3.4 2021-07-27 12:54:11 +09:00
Hajime Hoshi
e4329d0349 internal/driver: Refactoring: Reduce dependencies on affine 2021-07-27 12:19:50 +09:00
Hajime Hoshi
21aa96f9f5 internal/affine: Refactoring: Make ColorM interface 2021-07-27 12:10:22 +09:00
Hajime Hoshi
5f03f4f195 internal/affine: Add coloMImpl interface and colorMImplScale
Closes #1658
2021-07-26 22:18:10 +09:00
Hajime Hoshi
7e5b259dd2 internal/affine: Use a pointer of an array for UnsafeElements 2021-07-26 21:19:53 +09:00
Hajime Hoshi
2c26e85183 internal/affine: Replace isInited with isIdentity 2021-07-26 21:07:51 +09:00
Hajime Hoshi
d0ae73084b internal/affine: Separate ColorM implementation
Updates #1658
2021-07-26 15:21:12 +09:00
Hajime Hoshi
e84506dfc3 internal/affine: Add String 2021-07-26 14:26:59 +09:00
Hajime Hoshi
18757cff16 internal/affine: Refactoring 2021-07-25 22:10:38 +09:00
Hajime Hoshi
1706d9436a ebiten: Add FPSModeType, FPSMode, SetFPSMode, and ScheduleFrame
This change adds these APIs:

  * type FPSModeType
  * func FPSMode
  * func SetFPSMode
  * func ScheduleFrame

and deprecates these APIs:

  * func SetVsyncEnabled
  * func IsVsyncEnabled

Closes #1556
2021-07-24 16:09:13 +09:00
Hajime Hoshi
fee004c28d internal/uidriver/js: Remove unnecessary event handlers 2021-07-23 11:23:01 +09:00
Hajime Hoshi
0ec5b7b857 internal/uidriver/js: Bug fix: Suppress warnings on SetFullscreen
Closes #1727
2021-07-23 02:15:46 +09:00
Hajime Hoshi
2503323557 internal/driver: Add FPSMode
Updates #1556
2021-07-23 00:47:09 +09:00
Hajime Hoshi
c28bcc26fc internal/clock: Rename UncappedTPS -> SyncWithFPS
Closes #1726
2021-07-22 22:46:24 +09:00
Hajime Hoshi
50320eeb5b internal/glfw: Bug fix: Crash after disconnecting a gamepad on Windows (Wine) 2021-07-21 17:50:47 +09:00
Hajime Hoshi
d7bedd165a internal/driver: Bug fix: Compile error for browsers 2021-07-21 17:20:09 +09:00
Hajime Hoshi
93a156a718 internal/uidriver/glfw: Use glfwGameGamepadState
This change replaces the usage of gamepaddb package with glfwGetGamepadState.

Updates #1557
2021-07-21 16:09:30 +09:00
Hajime Hoshi
ee4ec5047e internal/gamepaddb: Support general XInput devices 2021-07-21 14:38:47 +09:00
Hajime Hoshi
1fce527414 internal/uidriver/js: Use the same gamepad API on go2cpp 2021-07-20 23:10:56 +09:00
Hajime Hoshi
8656786721 internal/uidriver/js: Refactoring: Detect the standard layout at update 2021-07-20 21:56:15 +09:00
Hajime Hoshi
f192971080 ebiten: Rename HasGamepadStandardLayoutMapping -> IsStandardGamepadLayoutAvailable
Updates #1557
2021-07-20 02:46:12 +09:00
Hajime Hoshi
aa694be6f6 ebiten: Add the standard gamepad layout
This change introduces the standard gamepad layout. This changes adds
these APIs:

  * func HasGamepadStandardLayoutMapping
  * func IsGamepadStandardButtonPressed
  * func GamepadStandardAxisValue
  * type StandardGamepadButton
  * type StandardGamepadAxis

The standard gamepad layout is based on the web standard. See
https://www.w3.org/TR/gamepad/#remapping.

On desktops, the SDL's gamecontrllerdb.txt is used. If the gamepad is
listed in the text file, the mapping works. GLFW's mapping featrue is
not used.

On browsers, the property of a gamepad 'mapping' is used. When the
mapping value is 'standard', the gamepad is recognized to have the
standard mapping.

On mobiles, the implementation is still WIP.

Updates #1557
2021-07-20 01:32:28 +09:00
Hajime Hoshi
fcfdf9b2ba Update URLs 2021-07-19 23:09:27 +09:00
Hajime Hoshi
a6fe7801ff internal/uidriver/glfw: Rename gamePad -> gamepad 2021-07-19 22:25:43 +09:00
Hajime Hoshi
dbcb220742 ebiten: Add GamepadAxisValue replacing GamepadAxis
Updates #1718
Closes #1719
2021-07-19 01:22:35 +09:00
Hajime Hoshi
342bf6ae7e Update GLFW: suppress joystick issue at PollEvents
Updates #1229
2021-07-15 11:19:39 +09:00
Hajime Hoshi
ec5b034cbf Update GLFW: suppress joystick issue (again)
Updates #1229
2021-07-15 01:02:57 +09:00
Hajime Hoshi
66dbca7fdd Update GLFW: suppress joystick issue
Updates #1229
2021-07-14 23:54:48 +09:00
Hajime Hoshi
50d2d7ed61 internal/graphicsdriver/opengl: Remove unused code using PBO
Updates #1678
2021-07-14 21:51:27 +09:00
Hajime Hoshi
99a6b1b03e internal/driver: Change some functions to Append*
Updates #1692
2021-07-10 01:52:21 +09:00
Hajime Hoshi
5d2c8ad9be internal/uidriver/mobile: Bug fix: Use mutex at RuneBuffers 2021-07-10 01:39:32 +09:00
Hajime Hoshi
853c1f2b92 internal/shaderir/glsl: Bug fix: Remove uncalled functions
Some built-in functions like dFdx is not available in a vertex shader,
then a function that calls such built-in function should not be in
a vertex shader.

Closes #1701
2021-07-09 20:22:40 +09:00
Hajime Hoshi
b0106e95b9 internal/restorable: Bug fix: Test failed on macOS (Metal) 2021-07-09 20:21:04 +09:00
Hajime Hoshi
4573883b03 internal/graphicsdriver/metal: Make FPS stable by 'presentsWithTransaction'
Closes #1196
2021-07-08 18:11:19 +09:00
Hajime Hoshi
ae0e30196b internal/graphicsdriver/metal: Bug fix: The store action must always be 'store'
Closes #1700
2021-07-08 17:39:37 +09:00
Hajime Hoshi
337d8d5113 internal/graphicsdriver/metal: Separate GCing the buffers
Updates #1196
2021-07-08 02:10:26 +09:00
Hajime Hoshi
edc2f8b961 internal/graphicsdriver/metal: Delay to get a texture for nextDrawable
See https://developer.apple.com/documentation/quartzcore/cametallayer

> To avoid stalls in your app, request a new drawable only when you
> need it, and release any references to it as quickly as possible
> after you’re done with it.

Updates #1196
2021-07-08 01:56:14 +09:00
Hajime Hoshi
b314b6b9b6 Revert "internal/graphicsdriver/metal: Do not retain MTLCommandBuffer for MTLBuffer"
This reverts commit e0fbfc2bb0.

Reason: Rendering issue

Closes #1699
2021-07-08 00:27:33 +09:00
Hajime Hoshi
6213c17abc internal/driver: Add Graphics.Initialize 2021-07-07 13:58:42 +09:00
Hajime Hoshi
519363930a internal/uidriver/glfw: Bug fix: Memory leak in Objective-C code
Use an autorelease pool block.

Closes #1698
2021-07-07 04:34:21 +09:00
Hajime Hoshi
e0fbfc2bb0 internal/graphicsdriver/metal: Do not retain MTLCommandBuffer for MTLBuffer
Before this change, a command buffer is retained indirectly by
a buffer, and this might extend the life of drawable unexpectedly.

This change stops using command buffers as a key of the buffers pool,
and use a counter increated by nextDrawable calls.

Updates #1196
2021-07-07 02:52:04 +09:00
Hajime Hoshi
80ac0646d5 internal/graphicsdriver/metal: Optimize the screen writing 2021-07-07 02:07:09 +09:00
Hajime Hoshi
5e83f409e6 internal/graphicscommand: Add a missing colon to a command string 2021-07-07 01:54:22 +09:00
Hajime Hoshi
38ce325958 internal/graphicsdriver/metal: Skip clearing the screen on Metal 2021-07-07 01:45:51 +09:00
Hajime Hoshi
9cb1ff9cea internal/graphicsdriver/metal: Set framebufferOnly true
Updates #1196
2021-07-07 00:38:55 +09:00
Hajime Hoshi
bd3f16dbba internal/graphicsdriver/metal: Change the order of GCed buffers
As a big buffer is likely reused, we should remove smaller buffers
first.

Updates #1196
2021-07-06 21:56:27 +09:00