Commit Graph

1056 Commits

Author SHA1 Message Date
Hajime Hoshi
477bff3f62 add examples/vectorfont
Updates #1937
2022-11-25 18:49:26 +09:00
Hajime Hoshi
a042af98b1 text: improve rendering quality with HintingVertical
When HintingVertical is used, the interval between two glyphs is not
quantized (i.e. not a whole pixel). The text package didn't consider
this situation.

This change improves the quality by using more various glyph images
with 1/4 pixels granularity in vertical direction.

Closes #2469
2022-11-25 16:45:37 +09:00
Hajime Hoshi
f4b12462e6 ebiten: rename FloatLayouter -> LayoutFer
Updates #2285
2022-11-09 02:00:23 +09:00
Hajime Hoshi
8567c3c654 ebiten: add FloatLayouter
Closes #2285
2022-11-09 01:52:48 +09:00
Hajime Hoshi
156c34a316 ebiten: separate a package for ColorM: colorm
Closes #2171
2022-11-08 23:50:04 +09:00
Hajime Hoshi
d73e8f785d internal/graphicsdriver: render various destination regions as one command
Closes #2232
2022-11-04 20:49:44 +09:00
Artem Yadelskyi
86e694941f
examples: remove example build tag (#2433)
Closes #1462
2022-11-03 20:24:09 +09:00
Artem Yadelskyi
10415d417a
all: replace interface{} with any (#2430)
Closes #2429
2022-11-03 15:33:09 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00
Hajime Hoshi
ac6843639d ebiten: undeprecate SetVsyncEnabled / IsVsyncEnabled
This change deprecates FPSMode and SetFPSMode.

Closes #2342
2022-10-29 01:16:08 +09:00
Hajime Hoshi
b019a3723a internal/ui: optimize GPU usages when the screen doesn't have to be updated
This change skips rendering when 1) the screen is not cleared every frame
(`SetScreenClearedEveryFrame(false)`) and 2) Draw doesn't draw anything
onto the screen. The GPU usages decreased on some machines (e.g. GPU usage
was 10% with an empty Ebitengine project and became 2-3 % on a Windows
machine).

Updates #2341
2022-10-28 18:51:06 +09:00
Hajime Hoshi
6ba14fdb00 vector: rename functions
Fill* was confusing especially when the color is a transparent color.

Closes #2403
2022-10-22 20:29:31 +09:00
Hajime Hoshi
c34c072efa vector: change the specificatino of Path.ArcTo
Closes #2401
2022-10-22 02:03:27 +09:00
Hajime Hoshi
5e15bafde8 vector: add FillCircle and StrokeCircle
Updates #2387
2022-10-22 01:24:51 +09:00
Hajime Hoshi
6f7b1a81d7 vector: add StrokeLine, FillRect, and StrokeRect
Updates #2387
2022-10-21 22:35:01 +09:00
Hajime Hoshi
a75472b524 vector: add (*Path).Close
Updates #2387
2022-10-21 18:16:48 +09:00
Hajime Hoshi
f04e391cb4 all: rename emptyImage -> whiteImage 2022-10-21 15:26:56 +09:00
Hajime Hoshi
9ec23ddeb4 ebiten: add DrawTrianglesOptions.AntiAlias and DrawTrianglesShaderOptions.AntiAlias
Closes #2385
2022-10-21 02:07:41 +09:00
Hajime Hoshi
885a3fa7cc examples/vector: bug fix: wrong offscreen resetting 2022-10-20 14:13:06 +09:00
Hajime Hoshi
e4b056bac6 examples/vector: fill the background with a solid color 2022-10-18 23:45:52 +09:00
Hajime Hoshi
b79495761e ebiten: add Blend and deprecate CompositeMode
Updates #2382
2022-10-16 22:47:00 +09:00
Hajime Hoshi
bcc5dc1703 examples/lines: show FPS/TPS 2022-10-15 02:23:26 +09:00
Hajime Hoshi
d2f6d8593b vector: add LineCap
Closes #1843
2022-10-15 00:40:28 +09:00
Hajime Hoshi
599571c7a7 ebiten: add geoM argument to DrawFinalScreen
Updates #2046
2022-10-14 23:35:58 +09:00
Hajime Hoshi
596efc86fe examples/lines: more dynaic effect 2022-10-14 23:26:15 +09:00
Hajime Hoshi
225bf1bbb4 vector: add StrokeOptions.MiterLimit 2022-10-14 23:25:59 +09:00
Hajime Hoshi
a1a598471b vector: add LineJoin
Updates #1843
2022-10-14 22:11:00 +09:00
Hajime Hoshi
d2eeca3067 examples/flappy: typo 2022-10-14 16:51:32 +09:00
Hajime Hoshi
30cc36b1ba ebiten: add FinalScreenDrawer
FinalScreenDrawer is an interface for a custom screen rendering. If a
game implements FinalScreenDrawer and is passed to RunGame, its
DrawFinalScreen is called after Draw.

Also this adds `-crt` option to examples/flappy.

Closes #2046
2022-10-14 16:49:32 +09:00
Hajime Hoshi
0803342d01 examples/shader: remove the CRT effect 2022-10-14 16:14:46 +09:00
Hajime Hoshi
93c09633ee examples/shader: bug fix: wrong function usages
The tex-coord should have been modified by the source texture
region/size, rather than the destination texture's.
2022-10-14 16:04:09 +09:00
Hajime Hoshi
69c8fd745b vector: add AppendVerticesAndIndicesForStroke
Updates #1843
2022-10-10 23:19:29 +09:00
Hajime Hoshi
010bf69f5a examples/vector: improve readability of the debug message 2022-10-10 00:22:57 +09:00
Hajime Hoshi
5d9acfe7ec examples/vector: add switching anti-alias
This change is a proof-of-concept of anti-alias with a pseudo MSAA
effect.

Updates #663
2022-10-09 21:27:16 +09:00
Hajime Hoshi
cda6fa156f examples/flappy: reorder build tags 2022-09-20 23:56:27 +09:00
Hajime Hoshi
67400d242b examples/resource: use go:embed for images
Closes #1258
2022-09-17 23:27:45 +09:00
Hajime Hoshi
5305735055 examples/resource: use go:embed for audio and fonts
Updates #1258
2022-09-17 22:15:40 +09:00
Hajime Hoshi
289129c9e5 examples/shader: use go:embed
Updates #1258
2022-09-15 23:18:49 +09:00
Hajime Hoshi
d57cd39bb9 examples/resources/images/keyboard: fix comment 2022-09-15 23:18:49 +09:00
Hajime Hoshi
6e6145541d examples/keyboard/keyboard: use go:embed
Updates #1258
2022-09-15 22:58:57 +09:00
Hajime Hoshi
5404e4d68a all: replace io/ioutil with io and os
Closes #1770
2022-09-15 02:54:25 +09:00
Terra Brown
a1cc44833d
add errcheck static analysis (#2293)
Closes #2287
2022-09-10 01:52:46 +09:00
Hajime Hoshi
6b1502ee71 examples/audio: handle errors
Updates #2287
2022-09-09 16:52:03 +09:00
Hajime Hoshi
f7c44f086f replace Ebiten with Ebitengine in comments 2022-08-29 11:17:17 +09:00
Hajime Hoshi
610e9ce14c gofmt -s -w 2022-08-28 00:04:32 +09:00
Terra Brown
de35a5a6f1
ebiten: add Termination for a regular termination (#2272)
Closes #2266
2022-08-27 21:33:40 +09:00
Hajime Hoshi
b858f36d54 remove the dependency on file2byteslice
Specify the version explicitly instead.
2022-08-23 16:34:55 +09:00
Hajime Hoshi
4d03b9fd98 examples/audio: use ebitenutil.DrawCircle
Updates #2250
2022-08-18 15:42:45 +09:00
Hajime Hoshi
bcba362e7e inpututil: add AppendJustReleasedTouchIDs and TouchPreviousPosition
Closes #2057
2022-08-16 02:21:55 +09:00
Hajime Hoshi
e21c881644 examples/paint: refactoring: avoid calling input functions in Draw 2022-08-16 01:06:22 +09:00
Hajime Hoshi
1c548c0641 examples/keyboard: refactoring 2022-08-13 13:37:01 +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
05baee51d2 examples/highdpi: remove an old comment 2022-08-12 00:16:08 +09:00
Hajime Hoshi
094726915b
ebiten: add IsStandardGamepadAxisAvailable and IsStandardGamepadButtonAvailable (#2241)
Closes #2040
2022-08-11 12:35:20 +09:00
Hajime Hoshi
0217ed0544 ebiten: add WritePixels replacing ReplacePixels
Closes #2236
2022-08-08 03:50:27 +09:00
Hajime Hoshi
05dd36ec7b examples/fullscreen: enable to test on mobile browsers
Closes #2060
2022-08-07 19:31:56 +09:00
mattn
2bacecca24
fix typos (#2227) 2022-08-03 22:40:39 +09:00
mattn
3cd0daac67
go generate ./... with Go 1.19 (#2228) 2022-08-03 20:48:02 +09:00
Hajime Hoshi
e41a8be9e4 add tools.go 2022-07-30 02:16:53 +09:00
divVerent
21207f827c
do not require installing file2byteslice to update go generate'd files. (#2221)
The tool is already referenced in go.mod, so it is trivial to just go run it -
that way, go generate can use it without the user explicitly installing it first.
2022-07-29 20:43:23 +09:00
Hajime Hoshi
ca8c36499d ebiten: recommend errors.Is instead of comparing the returned value directly
Closes #2152
2022-07-24 23:25:48 +09:00
Hajime Hoshi
0f52381580 ebiten: rename TPS functions
* SetMaxTPS() -> SetTPS()
* MaxTPS() -> TPS()
* CurrentTPS() -> ActualTPS()
* CurrentFPS() -> ActualFPS()

Closes #2071
2022-07-17 11:30:12 +09:00
Hajime Hoshi
36b7b85477 examples: change the name convention: Num -> Count 2022-07-13 02:02:48 +09:00
Hajime Hoshi
5f17264c74 ebiten: rename Gamepad(Axis|Button)Num -> Gamepad(Axis|Button)Count 2022-07-13 01:27:14 +09:00
Hajime Hoshi
bd72ca971e examples/shader: bug fix: the CRT example crashed 2022-07-09 22:29:59 +09:00
Hajime Hoshi
be356390e0 examples/gamepad: add vibrations 2022-07-09 16:58:54 +09:00
Hajime Hoshi
75e84f6eda audio/mp3, audio/vorbis, audio/wav: add DecodeWithoutResampling
Updates #2055
2022-07-01 01:46:37 +09:00
Hajime Hoshi
4836266c2b examples/tiles: improve readability by calculating tileXNum on the fly 2022-06-10 23:54:45 +09:00
Hajime Hoshi
2c4ac5625b examples/flappy: add GoMain when Windows+Cgo
This is a hack to compile the example with -buildmode=c-archive (.a).

Updates #2084
2022-05-02 22:46:26 +09:00
Hajime Hoshi
b1bcbbeeea ebiten: add comments at DrawTriangles 2022-04-26 23:23:31 +09:00
Julian Merkle
d68f770561
examples/stars: refactor (#2070)
Minor adjustments because of:

* Function abs(int) is unused.
* Color fields are assigned without explicit names
* Color variable shadows the color package name
2022-04-13 18:42:04 +09:00
Hajime Hoshi
8f524b5c23 examples/vibrate: refactoring 2022-04-12 00:11:11 +09:00
Hajime Hoshi
55447679ee examples/vibrate: bug fix: touches didn't work correctly 2022-04-12 00:05:55 +09:00
Hajime Hoshi
699b58c02b examples/flappy: bug fix: touches didn't work
Closes #2067
2022-04-11 10:44:41 +09:00
Hajime Hoshi
b53f93c614 examples/windowclosing: update the message 2022-04-11 01:10:48 +09:00
Hajime Hoshi
e4d6381452 examples/fullscreen: forbid quiting on browsers 2022-04-10 20:04:52 +09:00
Hajime Hoshi
535e64f2bf examples/audioinfiniteloop, examples/audiopanning: avoid resamplings 2022-04-10 19:41:44 +09:00
Hajime Hoshi
a65631bccc examples/spriteshd: remove a call of SetWindowSize 2022-04-10 19:15:39 +09:00
Hajime Hoshi
648c8ed1f9 examples/flappy: use DecodeWithSampleRate instead of Decode 2022-04-10 14:55:48 +09:00
Hajime Hoshi
9b7328442b examples/minify: reorder renderings 2022-04-09 23:27:58 +09:00
Hajime Hoshi
d6fe8ed694 examples/fullscreen: handle F key to enter fullscreen
On browsers, fullscreen requires an explicit user input.
2022-04-09 16:23:23 +09:00
Hajime Hoshi
063960c9bd examples/font: simplify the logic 2022-04-09 16:08:20 +09:00
Hajime Hoshi
d58ef294b2 examples/text: add leading space characters 2022-04-04 00:18:35 +09:00
Hajime Hoshi
7a33837ed7 audio: change the type of SetBufferSize to time.Duration
Updates #2026
2022-03-25 20:47:01 +09:00
Hajime Hoshi
08783542eb audio: add Player.SetBufferSize
This change also adds examples/realtimepcm.

Closes #2026
2022-03-25 19:27:25 +09:00
Bertrand Jung
2453f8f0df
examples/shader: add CRT shader example (#2012)
Closes #2008
2022-03-10 00:02:07 +09:00
divVerent
99aef33970
examples/blur: fix the blur filter example to be a real box blur. (#2000)
Also add a note that this is not how games should implement a blur if avoidable.

Krita's blur and the original blur:
https://rm.cloudns.org/img/uploaded/29c0418f25bf56b802f746d2f269e215.png
The original image and the new blur (Krita's): 
https://rm.cloudns.org/img/uploaded/bd04828baf6c01fcf7301a6672a4c406.png

Note how Ebiten's blur has almost no vertical component.

Note how after the change it looks basically like Krita's.
2022-02-24 03:15:52 +09:00
Hajime Hoshi
2c2c4bc428 ebiten: add WindowResizingModeType and its constants and functions
This allows a new state to disallow resizing the window but allow
making the window fullscreen on macOS by a user.

This change adds the new type WindowResizingModeType. There are
these constants of this type:

 * WindowResizingModeDisabled
 * WindowResizingModeOnlyFullscreenEnabled
 * WindowResizingModeEnabled

Closes #1819
2022-02-11 04:59:04 +09:00
Hajime Hoshi
35b9dd0846 internal/ui: give up SetWindowAspectRatioFixed
Unfortunately, it is almost impossible to provide a consistent behavior
to keep the aspect ratio of the window on Windows. Instead of having an
incomplete API, let's remove this.

Closes #1988
2022-02-10 18:35:00 +09:00
Hajime Hoshi
891ca2a08d ebiten: add IsWindowAspectRatioFixed
This also updates examples/windowsize.

Closes #1804
2022-02-09 20:06:18 +09:00
Hajime Hoshi
7482cae978 internal/ui: bug fix: the aspect ratio must be updated whenever the window size is forcibly updated
This also adds a new flag -aspectratiofixed to examples/windowsize

Updates #1804
2022-02-09 19:56:50 +09:00
Hajime Hoshi
fb3a022327 ebiten: use the DB's name for GamepadName
Updates #1949
2022-01-25 21:14:03 +09:00
Hajime Hoshi
210036a5a5 examples/gamepad: do not get an SDL ID from a disconnected gamepad
The result of ebiten.GamepadSDLID should not be reliable for a
disconnected gamepad.
2022-01-22 21:27:58 +09:00
Elias Daler
12c144070f
internal/uidriver/glfw: fix window float enable/disable (#1962)
Closes #1960
2022-01-17 00:28:25 +09:00
Hajime Hoshi
e687865c8c ebiten: add ColorM.ScaleWithColor
Updates #1944
2022-01-10 17:36:46 +09:00
Hajime Hoshi
245cbc2f4d examples/vibrate: bug fix: compile error
Updates #1452
2022-01-10 16:19:33 +09:00
Hajime Hoshi
3b0ce21a56 Revert "internal/graphicsdriver: bug fix: render semi-transparent vectors correctly"
This reverts commit 202f642395.

Reason: TestImageEvenOdd failed

Updates #1933
2022-01-06 03:19:46 +09:00
Hajime Hoshi
202f642395 internal/graphicsdriver: bug fix: render semi-transparent vectors correctly
Closes #1933
2022-01-06 03:00:25 +09:00
Hajime Hoshi
583c2cf17e examples/resources: reorder items 2021-12-31 05:30:37 +09:00
Jacob Salmela
e77985139b
examples/resources: bug fix: add a missing item Spritesheet_png (#1924)
the Spritesheet_png was not included with go generate so this adds that in

Signed-off-by: Jacob Salmela <me@jacobsalmela.com>
2021-12-31 05:28:41 +09:00
Hajime Hoshi
13c2d38b97 examples/flappy: add main_cbackend.go 2021-12-30 03:02:11 +09:00
ebiiim
4d988b2457
examples/airship: chore: fix typo (#1907) 2021-12-20 21:54:24 +09:00
Hajime Hoshi
12b5a6c3d6 examples: update README 2021-12-13 11:55:08 +09:00
Hajime Hoshi
39ef252c2e
ebiten: Add VibrationOptions to specify intensity (#1891)
Updates #1452
2021-12-04 22:14:02 +09:00
Hajime Hoshi
b4f87f9651 internal/uidriver/mobile: Implement Vibrate for Android
This change also adds AndroidManifest.xml for the example. This is
used for `gomobile install` command.

Updates #1452
2021-11-19 01:49:22 +09:00
Hajime Hoshi
732b125349 text: Add AppendGlyphs and Glyphs
Closes #1767
Closes #1871
2021-11-12 02:31:53 +09:00
wasedaigo
851733397e
examples/audioinfiniteloop: Use const to represent bytePerSample (#1867)
Co-authored-by: wasedaigo <daigo@odencat.com>
2021-11-08 15:52:53 +09:00
Hajime Hoshi
2aa232878d ebiten: Add VibrateGamepad and implement this on browsers
Updates #1452
2021-10-25 02:30:42 +09:00
Hajime Hoshi
7c6f2fd799 ebiten: Vibrate takes time durations instead of the options
Android and browsers can specify only a time duration for vibration.

VibrateOptions is renamed to GamepadVibrateOptions for gamepads.

Updates #1452
2021-10-24 05:02:49 +09:00
Hajime Hoshi
b8a5ea7bd6 ebiten: Add Vibrate and VibrateOptions, and implement this on browsers
Updates #1452
2021-10-24 01:05:33 +09:00
r3vit
57c45a13e4
Remove dot imports from tests - Remove dot imports (#1837)
Closes #1824
2021-10-02 19:58:48 +09:00
Hajime Hoshi
3c8c17eace examples/isometric: Recreate the offscreen when the screen size changes 2021-10-02 13:00:33 +09:00
Hajime Hoshi
0f363615b7 examples/isometric: Update the comment 2021-10-02 12:57:33 +09:00
Hajime Hoshi
291f5b89b8 examples/isometrics: Use an offscreen for a better result 2021-10-02 12:53:49 +09:00
Hajime Hoshi
84f2571ee1 examples/isometric: Refactoring 2021-10-02 09:28:18 +09:00
Hajime Hoshi
b78aef480e examples/isometric: Refactoring 2021-10-01 11:51:25 +09:00
Hajime Hoshi
2f33366f5f examples/isometric: Simplify the logic 2021-10-01 11:42:31 +09:00
Hajime Hoshi
f3318a2cec examples/isometric: Do not create an ebiten.Image every frame 2021-10-01 11:36:38 +09:00
Hajime Hoshi
234a3d8d2a examples/isometric: Remove unused variables 2021-10-01 11:15:52 +09:00
Trevor Slocum
1019e15ccd
Add isometric demo (#1823)
Based on a prototype by Justin Cichra (@jrcichra).

Closes #1112
2021-10-01 11:10:48 +09:00
Hajime Hoshi
52d917eff0 go generate 2021-09-25 03:45:17 +09:00
Hajime Hoshi
0d673a68ab examples/blocks/blocks: Support standard gamepad axes 2021-09-24 23:35:01 +09:00
Hajime Hoshi
159bc8dda1 examples/stars: Reduce the window size 2021-09-24 01:55:18 +09:00
Hajime Hoshi
2b6debf960 examples/windowsize: Bug fix: Wrong comment 2021-09-23 21:40:10 +09:00
Hajime Hoshi
f00bdc99f7 examples: Change the sample rate to 48000
Closes #1649
2021-09-23 01:36:00 +09:00
Hajime Hoshi
07c8cb0e23 examples: Misspelling (//go:generated -> //go:generate) 2021-09-20 15:23:43 +09:00
Hajime Hoshi
537bdb29f8 examples: Update comments 2021-09-20 15:16:09 +09:00
Hajime Hoshi
39dc58658f examples/windowsize: Add -autorestore
Closes #1610
2021-09-19 17:50:55 +09:00
Hajime Hoshi
69300f0c4e examples/windowsize: Rename -screentransparent -> -transparent 2021-09-19 17:49:03 +09:00
Hajime Hoshi
42cd923418 ebiten: Add FillRule
Closes #1715
2021-09-19 17:17:00 +09:00
Hajime Hoshi
4509f2aee4 text: Add FaceWithLineHeight
Closes #1760
2021-09-12 22:56:14 +09:00
Hajime Hoshi
82c41cea39 examples/gamepad: Fix the layout 2021-09-12 21:09:13 +09:00
Hajime Hoshi
ea12ede127 ebiten: Add StandardGamepadButtonValue
Closes #1721
2021-09-12 21:00:48 +09:00
Trevor Slocum
ffe9a6f72d
Minor style fixes (early returns) (#1792) 2021-09-04 00:22:37 +09:00
Hajime Hoshi
d967f0a591 examples/sprites: Make the window resizable 2021-08-08 15:31:49 +09:00
Hajime Hoshi
14f0fbf844 examples/windowsize: Reset TPS when resetting the Vsync mode 2021-08-05 03:01:11 +09:00
Hajime Hoshi
852c787743 examples/flappy: Bug fix: an audio context was created multiple times
Closes #1739
2021-08-04 14:54:06 +09:00
Hajime Hoshi
656d9dccc0 text: Add DrawWithOptions
Closes #1461
2021-07-27 17:36:21 +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
c28bcc26fc internal/clock: Rename UncappedTPS -> SyncWithFPS
Closes #1726
2021-07-22 22:46:24 +09:00
Hajime Hoshi
92bc5c1908 audio: Add (*Context).NewPlayer and (*Context).NewPlayerFromBytes
Closes #1708
2021-07-22 16:41:04 +09:00
Hajime Hoshi
1dc8002689 examples: Reduce global variables
Closes #1669
2021-07-22 01:38:55 +09:00
Hajime Hoshi
c54418c3e4 examples/flappy: Use A/B buttons for the standard gamepad layout
Also this change limits the available keys.
2021-07-20 20:53:19 +09:00
Hajime Hoshi
984275d0a0 examples/blocks: Skip the gamepad configuration if a standard layout is available 2021-07-20 03:48:01 +09:00
Hajime Hoshi
d32b58d050 examples/blocks/blocks: Unify the terms 'abstract' and 'virtual' 2021-07-20 03:02:37 +09:00
Hajime Hoshi
f192971080 ebiten: Rename HasGamepadStandardLayoutMapping -> IsStandardGamepadLayoutAvailable
Updates #1557
2021-07-20 02:46:12 +09:00
Hajime Hoshi
51f83b1527 inpututil: Add APIs for the standard gamepad layout
This change adds these APIs to inpututil:

  * IsStandardGamepadButtonJustPressed
  * IsStandardGamepadButtonJustReleased
  * StandardGamepadButtonPressDuration

Closes #1557
2021-07-20 02:37: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
6b949cede8 examples/gamepad: Always show signs for axis values 2021-07-19 02:19:42 +09:00
Hajime Hoshi
700052519c examples: Use GamepadAxisValue
Updates #1719
2021-07-19 01:31:20 +09:00
Hajime Hoshi
af150ad67b examples/gamepad: Show SDL ID on the terminal 2021-07-18 15:41:20 +09:00
Hajime Hoshi
a9241a45c6 vector: Add Dir
Updates #844
2021-07-17 16:42:14 +09:00
Hajime Hoshi
70ef5e7d5b vector: Add Arc
Updates #844
2021-07-17 01:34:06 +09:00
Hajime Hoshi
873bb35587 vector: Add ArcTo
Updates #844
2021-07-16 22:52:32 +09:00
Hajime Hoshi
cea0aa72cb vector: Rename AppendVerticesAndIndices to AppendVerticesAndIndicesForFilling
Updates #844
2021-07-16 17:20:09 +09:00
Hajime Hoshi
5c4885c988 inpututil: Add AppendJustConnectedTouchIDs
Closes #1705
2021-07-10 23:30:04 +09:00
Hajime Hoshi
e8ea4046cb inpututil: Add AppendJustConnectedGamepadIDs
Updates #1705
2021-07-10 22:32:19 +09:00
Hajime Hoshi
a79c287bb7 inpututil: Add AppendPressedKeys
Updates #1705
2021-07-10 22:18:15 +09:00
Hajime Hoshi
30e3047d29 examples/typewriter: Fix comments 2021-07-10 04:38:26 +09:00
Hajime Hoshi
431cd33839 ebiten: Add AppendInputChars, AppendGamepadIDs, and AppendTouchIDs
These functions reduce unnecessary allocations of arrays.

Closes #1692
2021-07-10 03:03:24 +09:00
Hajime Hoshi
b466a0cbd7 ebiten: Add EvenOdd to DrawTrianglesOptions and DrawShaderTrianglesOptions
Updates #844
Closes #1684
2021-07-05 03:35:55 +09:00
Hajime Hoshi
8ff42f55a1 internal/graphicsdriver/opengl: Give up restorign on browsers
Using restorable images is expensive as this sometimes requires to
load pixels from GPU. On browsers, just reloading the application
should be fine when the context lost happens.

Closes #1603
2021-06-26 16:54:21 +09:00
Hiroki KUMAZAKI
eb5fde74af
examples: Add an example "stars" (#1679) 2021-06-24 22:50:47 +09:00
Hajime Hoshi
a615be69c7 examples: Add //go:build 2021-06-24 21:49:37 +09:00
Hajime Hoshi
bd13e96727 examples/noise: Show FPS 2021-06-24 12:06:59 +09:00
Hajime Hoshi
49c3c30c79 ebiten: Add IsWindowBeingClosed / SetWindowClosingHandled / IsWindowClosingHandled
IsWindowBeingClosed reports whether the window is being closed by
the user.

SetWindowClosingHandled sets whether the window closing is handled
or not. If the state is true, the window is not closed immediately
by the user and the game can handle the closing state. In this case,
the Update function should return an error in order to end the game.

This change also adds examples/windowclosing.

Closes #1574
2021-06-14 02:29:11 +09:00
Hajime Hoshi
b54ad73a2b Add go:build comments with go1.17beta1 fmt 2021-06-11 01:11:46 +09:00
Hajime Hoshi
95a98950b8 examples/resources: Unify jab.wav to 48000 Hz
Updates #1649
2021-05-25 22:32:50 +09:00
Hajime Hoshi
ac526b1b83 examples/wav: Use 48000 Hz
Updates #1649
2021-05-25 22:09:48 +09:00
Hajime Hoshi
0247261d34 examples/flappy: Change the sample rate to 48000 2021-05-23 22:04:41 +09:00
Hajime Hoshi
7f67fb7b90 examples/flappy: Accept gamepads 2021-05-23 19:44:03 +09:00
Hajime Hoshi
44e96f2377 examples/resources/images: Add a license about alert.png 2021-05-04 18:17:17 +09:00
Hajime Hoshi
e1d0b902e1 examples/audio: Add buttons 2021-05-04 02:02:17 +09:00
Tom Lister
bea5ab3335
internal/uidriver/glfw: Native macOS implementation for setting cursor shape (#1624)
Updates #1624
2021-05-02 14:50:50 +09:00
Hajime Hoshi
34be0371be examples/windowsize: Bug fix: Suppress calling SetWindowPosition if the position is not updated
This is a temoprary fix for the issue that the window size unexpectedly
shrunk on Linux.

Updates #1607
Closes #1605
2021-04-20 20:48:46 +09:00
Hajime Hoshi
7f8c3a13b3 examples/audiopanning: Bug fix: Align the buffer size
Closes #1598
2021-04-20 02:47:14 +09:00
Hajime Hoshi
5b96439fed Revert "examples/audiopanning: Bug fix: Out of range at reading bytes"
This reverts commit b1545b115c.

Reason: Calling UnreadByte twice is illegal

Updates #1598
2021-04-20 00:20:21 +09:00
Hajime Hoshi
b1545b115c examples/audiopanning: Bug fix: Out of range at reading bytes
Closes #1598
2021-04-19 22:06:00 +09:00
Hajime Hoshi
2f451e6014 examples/windowsize: Enable to specify either maxwindowsize or minwindowsize 2021-04-18 23:21:34 +09:00
Hajime Hoshi
45642668f7 examples/cursor: Change the background colors
On Windows, cursor colors are determined based on the background
color, and if the background color is gray, the cursor might be
invisible. This change adjust the color so that the cursor should
be visible in any cases.

Closes #1583
2021-04-18 19:34:53 +09:00
Hajime Hoshi
81ef20ddd0 examples: Use the new keys
Updates #1394
2021-04-18 01:13:20 +09:00
Hajime Hoshi
1b70901659 examples/windowsize: Swap arrow keys for resizing 2021-04-18 01:07:09 +09:00
Hajime Hoshi
ed4dded094 examples/hsv, examples/hue: Use wider screens 2021-04-17 22:10:14 +09:00
Hajime Hoshi
c950e03fb1 examples/blocks/blocks: Use gamepads to go back to the title 2021-04-17 21:55:58 +09:00
Hajime Hoshi
c8ed6ec12e examples/keyboard/keyboard: go generate 2021-04-17 19:30:04 +09:00
Hajime Hoshi
9b6ba5ed2c ebiten: Add {Set,}WindowSizeLimits
Closes #1385
2021-04-17 03:58:06 +09:00
Hajime Hoshi
d00d0c8556 ebiten: Add CursorShape/SetCursorShape/CursorShapeType
This change adds APIs to enable to use system cursor shapes other
than the default shape (an arrow).

This change doesn't add these cursors since they seem a little
different on macOS from the other platforms.

 * GLFW_HRESIZE_CURSOR
 * GLFW_VRESIZE_CURSOR

Closes #995
2021-04-16 01:09:19 +09:00
Hajime Hoshi
3043c6cb8e examples/windowsize: Enable to switch CursorMode 2021-04-11 03:33:02 +09:00
Hajime Hoshi
d46b0c5b49 examples/shader: Use const
Closes #1192
2021-04-09 02:02:03 +09:00
Hajime Hoshi
0300be7d9e examples/keyboard: Use inpututil functions in Update rather than Draw
This is not a strict rule, but it is preferrable to use input functions
in Update rather than Draw.
2021-04-07 01:54:53 +09:00
Hajime Hoshi
0fcf5c8470 inpututil: Add PressedKeys
Closes #770
2021-04-07 01:50:39 +09:00
Huw Griffiths
e1e213cc10
Add a new Touch example (#1547) 2021-03-24 22:27:12 +09:00
Hajime Hoshi
2c0108e178 examples/tiles: Misspelling 2021-03-09 03:23:53 +09:00
Hajime Hoshi
a13930650d examples/audiopanning: Bug fix: Fix several issues
* The stream was not looped.
 * The shown position was wrong.

Closes #1502
2021-02-22 02:00:52 +09:00
Hajime Hoshi
311d53ce2e examples/audio: Enable to touch 2021-02-21 19:20:24 +09:00
Hajime Hoshi
6f462e824f examples/audio: Use the same audio file for Ogg and MP3
This also changes the sample rate to 32000 for some special
environments.
2021-02-21 17:57:06 +09:00
Hajime Hoshi
d999b4dc8e internal/uidriver/glfw: Bug fix: Enable to specify ebiten.Image to SetWindowIcon
Closes #1468
2021-02-07 21:18:30 +09:00
Chris S. Kim
3d5733f693
examples/keyboard: Minor typo fix (#1436) 2020-12-15 11:55:17 +09:00
Hajime Hoshi
ede16afd30 examples/shader: Add a new example 'texel' 2020-12-09 23:33:59 +09:00
Hajime Hoshi
ed028110cf ebiten: Allow rendering on a sub-image by scissor test
Fixes #1255
2020-11-08 00:58:44 +09:00