Hajime Hoshi
f6390abad7
png: Update for Go 1.13
2019-11-25 22:24:33 +09:00
Hajime Hoshi
21ba42325c
graphicsdriver/opengl: Use smaller PBOs
2019-11-24 18:32:35 +09:00
Hajime Hoshi
78e912e30b
graphicsdriver/opengl: Fix comments
2019-11-24 18:11:45 +09:00
Hajime Hoshi
3d3a1be1c4
graphicsdriver/opengl: Use glTexSubImage2D instead of glTexImage2D
2019-11-24 18:07:21 +09:00
Hajime Hoshi
9f483ddc60
graphicsdriver/opengl: Adopt WRITE_ONLY for PBOs
...
It looks like it is safe to use WRITE_ONLY:
https://stackoverflow.com/questions/30248594/write-only-glmapbuffer-what-if-i-dont-write-it-all
2019-11-24 17:42:28 +09:00
Hajime Hoshi
4c4f67197f
graphicsdriver/opengl/gl: Bug fix: compile error on non-Windows (again)
2019-11-24 03:05:14 +09:00
Hajime Hoshi
ac6a3f0900
graphicsdriver/opengl/gl: Bug fix: compile error on non-Windows
2019-11-24 02:02:40 +09:00
Hajime Hoshi
0ef8009c11
graphicsdriver/opengl: Use uintptr whenever possible instead of unsafe.Pointer
2019-11-20 02:00:02 +09:00
Hajime Hoshi
4296c11256
graphicsdriver/opengl: Refactoring
2019-11-24 00:08:38 +09:00
Hajime Hoshi
3df198f68e
graphicsdriver/opengl: Use GL_READ_WRITE at glMapBuffer
...
Updates #993
2019-11-22 00:27:20 +09:00
Hajime Hoshi
65fdf48cbf
graphicsdriver: Refactoring: ReplacePixels takes multiple arguments
...
This reduces the number of graphics commands, and this works more
efficiently if the driver has an efficient way.
2019-11-21 23:52:12 +09:00
Hajime Hoshi
161771cc99
graphicsdriver/opengl: Refactoring
2019-11-20 12:23:45 +09:00
Hajime Hoshi
52f6be2639
graphicsdriver/opengl: Fix suspicious GL function calls
...
Before this change, the pixel object buffer is unbound just after
getting a pointer by glMapBuffer. This seemed suspicious.
This change fixes to do all pixel manipulations once between
glMapBuffer and glUnmapBuffer without changing a bound buffer.
This might fix a wrong rendering on some machines, but I am not
sure.
Updates #993
2019-11-20 02:41:34 +09:00
Hajime Hoshi
95d3561a3a
packing: Better panic message
2019-11-18 00:27:34 +09:00
Hajime Hoshi
63f9ac2ccc
packing: Add Rollback/CommitExntension
...
This enables to dry-run to extend pages without cloning.
Fixes #990
2019-11-18 00:23:13 +09:00
Hajime Hoshi
61839506d8
packing: Add an extending count at Extend
2019-11-17 23:39:16 +09:00
Hajime Hoshi
74902d47af
graphicsdriver/metal/mtl: Bug fix: need to link CoreGraphics as of Catalina
...
Fixes #989
2019-11-17 22:59:21 +09:00
Hajime Hoshi
725cc22200
uidriver/mobile: Rename Render -> Update
2019-11-17 21:52:06 +09:00
Hajime Hoshi
92e056c508
uidriver/glfw: Bug fix: an unexpected window at launching
...
Fixes #986
2019-11-17 19:58:44 +09:00
Hajime Hoshi
3aaeee78dd
graphicsdriver/metal: Reduce flushing at ReplacePixels
2019-11-17 16:00:24 +09:00
Hajime Hoshi
800b98a0c6
ui: Bug fix: a window was alwasy 'unfocused' on Windows
...
There is an issue in GLFW that a window was recognized as unfoces
on Windows (glfw/glfw#1573). As a workaround, skip the logic for
an unfocused window on Windows. On Windows, even if a window is in
another workspace, vsync works. Then there seems no problem.
Fixes #987
2019-11-17 14:10:38 +09:00
Hajime Hoshi
4120e868be
graphicsdriver/opengl: Remove unused functions
2019-11-17 05:10:22 +09:00
Hajime Hoshi
acc933b7c3
graphicsdriver/opengl: Experimental PBO implementation
...
This change is an experimental implementation to use Pixel Buffer
Objects. This reduces calls of glTexSubImage2D.
This works only on desktops. Unfortunately WebGL does not have
this features. Mobiles can have PBO as of OpenGL ES 3.
Updates #976
2019-11-17 05:01:43 +09:00
Hajime Hoshi
16b3a5c296
buffered: Bug fix: Needed to copy pixels when buffering
...
Updates #983
2019-11-16 16:39:02 +09:00
Hajime Hoshi
e42cff071c
restorable: Merge two 'copy' into one
...
Fixes #983
2019-11-16 02:10:53 +09:00
Hajime Hoshi
aa6fc67736
Revert "graphics: Avoid all copying pixels"
...
This reverts commit c60a32a479
.
Reason: This breaks backward comptibility and it was not obvious how to fix examples.
2019-11-16 02:04:46 +09:00
Hajime Hoshi
c60a32a479
graphics: Avoid all copying pixels
...
This is a breaking change: ReplacePixels now takes the ownership
of the given pixels.
Fixes #983
2019-11-16 01:51:36 +09:00
Hajime Hoshi
f1091910bd
Revert "graphicscommand: Remove copying pixels"
...
This reverts commit 339a96b7e6
.
Reason: this causes panic on extending textures
2019-11-16 00:43:22 +09:00
Hajime Hoshi
339a96b7e6
graphicscommand: Remove copying pixels
...
Now ReplacePixels takes the ownership.
Updates #983
2019-11-16 00:29:37 +09:00
Hajime Hoshi
bfd5774faf
graphicsdriver/glfw: Bug fix: CPU was busy when the window is hidden
...
Fixes #982
2019-11-14 23:11:36 +09:00
Hajime Hoshi
8c54cf639a
graphicsdriver/opengl: Reduce glFlush calls
...
Fixes #981
2019-11-14 01:21:08 +09:00
Hajime Hoshi
c2eae69b47
graphicscommand: Refactoring
2019-11-14 00:08:44 +09:00
Hajime Hoshi
a1a294df72
uidriver/glfw: Bug fix: Freeze on Wayland
...
Fixes #974
2019-11-10 19:26:49 +09:00
Hajime Hoshi
572780ed6d
uidriver/glfw: Bug fix: errors are ignored at (*UserInterface).run
...
Updates #978
2019-11-10 19:09:41 +09:00
Hajime Hoshi
d43e203ccf
uidriver/glfw: Remove a redundant 'if' branch
2019-11-10 17:34:14 +09:00
Hajime Hoshi
63f73ddd75
web: Bug fix: iPad was not recognized as iOS
...
Fixes #979
2019-11-10 16:52:49 +09:00
Hajime Hoshi
8d12446dbe
buffered: Bug fix: reset the flag when invalidating the pending pixels
...
Updates #977
2019-11-09 05:54:27 +09:00
Hajime Hoshi
ec59e9b9ae
buffered: Bug fix: Resolve pixels only when Set is called
...
Fixes #977
2019-11-09 05:43:36 +09:00
Hajime Hoshi
ddba7f0ee0
driver: Bug fix: unused import
2019-11-04 03:15:09 +09:00
Hajime Hoshi
889bc12093
driver: Remove IsPlayground
2019-11-04 03:04:00 +09:00
Hajime Hoshi
3c29fbdce2
jsutil: Refactoring: SliceToTypedArray -> CopySliceToJS
...
This unifieslocations of the temporary buffer.
2019-10-30 00:35:48 +09:00
Hajime Hoshi
31f56efd75
jsutil: Add doc.go
...
This is to avoid no-Go-files error on TravisCI.
https://travis-ci.org/hajimehoshi/ebiten/builds/603539948
2019-10-28 01:28:50 +09:00
Hajime Hoshi
49a5a2bf4e
uidriver/js: Bug fix: Needed to initialize pseudoScale with the given scale
...
Updates #960 , #973
2019-10-27 17:16:49 +09:00
Hajime Hoshi
06bbc08e9b
web: Bug fix: IsAndroidChrome always returned true
2019-10-24 00:20:33 +09:00
Hajime Hoshi
e7611139c3
uidriver/js: Bug fix: Watch the state regularly instead of events
...
visibilitystate is sometimes not called and in this case the app
does not come back.
This fix creates another goroutine to watch the state, and remove
event handlers.
Fixes #961
2019-10-21 00:04:07 +09:00
Hajime Hoshi
e578b0bd49
graphicscommand: Bug fix: Needed to adjust vertices when highp is not available
...
Fixes #962
2019-10-19 17:05:04 +09:00
Hajime Hoshi
43a8881ab8
uidriver/ui: Reduce calls of syscall/js
2019-10-16 02:56:58 +09:00
Hajime Hoshi
72248fa3ef
ui: Bug fix: Focus canvas explicitly on input
...
Fixes #961
2019-10-15 23:57:16 +09:00
Hajime Hoshi
75721e6fc1
ui: Auto scaling on browsers
...
This change forces Ebiten apps on browsers 'fullscreen' mode.
After this change, 'scale' value is no longer used on browsers.
Note that this breaks backward compatibility, but as long as the
game works in an iframe, this should not be problematic.
Fixes #960
2019-10-15 00:02:02 +09:00
Hajime Hoshi
30c185f254
uidriver/js: Bug fix: context must not be accessed before loop
2019-10-14 02:41:04 +09:00
Hajime Hoshi
5027bc1af5
buffered: Allow Set before the game runs
...
Fixes #949
2019-10-12 03:13:29 +09:00
Hajime Hoshi
cbe4844fa0
Fix misspellings
2019-10-12 01:10:53 +09:00
Hajime Hoshi
4bfe60fb8a
graphicsdriver/metal: Bug fix: SetFragmentBytes must be called anytime
...
Fixes #954
2019-10-10 03:13:55 +09:00
Hajime Hoshi
3c976eae02
cmd/ebitenmobile: Use Metal on iOS
...
The emulators still use OpenGL.
Fixes #737
2019-10-09 02:13:47 +09:00
Hajime Hoshi
4088de5349
graphicsdriver/opengl/gl: Fix go-vet errors on Windows
...
Updates #889
2019-10-06 23:19:59 +09:00
Hajime Hoshi
3a0f8655e6
graphicsdriver/opengl/gl: Indentation
2019-10-06 23:02:15 +09:00
Hajime Hoshi
378be6be80
graphicsdriver/opengl/gl: Remove unused functions
...
This improves `go vet` results.
Updates #889
2019-10-06 22:49:38 +09:00
Hajime Hoshi
0d56207672
graphicsdriver/opengl/gl: Remove unnecessary consts
2019-10-06 04:27:57 +09:00
Hajime Hoshi
7e7751bd43
restorable: Performance tuning
...
This is based on the result of examples/set (Wasm).
2019-10-04 02:02:36 +09:00
Hajime Hoshi
382f6365fd
shareable: Avoid defer for performance
2019-10-04 01:52:27 +09:00
Hajime Hoshi
38ee9113ee
graphicsdriver/opengl/gl: Remvoe PtrOffset
...
Updates #889
2019-10-01 01:48:42 +09:00
Hajime Hoshi
ffbdda9a25
shareable: Avoid defer for performance
2019-09-29 03:50:43 +09:00
Hajime Hoshi
907302c440
graphicscommand: Keep the capacity at q.commands
2019-09-29 03:23:40 +09:00
Hajime Hoshi
86b4e9ffeb
restorable: Bug fix: Do not mutate graphics.QuadIndices
2019-09-29 02:57:11 +09:00
Hajime Hoshi
6c8c064a58
restorable: Add TestMutateSlices
2019-09-29 02:36:06 +09:00
Hajime Hoshi
9cb631e30f
Reland: graphics: Reuse vertices backend and reduce allocating
...
This is a reland of 74f1e5519f
.
The vertex slice is now copied before saving as the drawing
history items.
2019-09-29 01:36:00 +09:00
Hajime Hoshi
4feb0a4f3e
restorable: Bug fix: indices has to be copied
2019-09-29 01:30:26 +09:00
Hajime Hoshi
5e6bdc25e5
gofmt
2019-09-28 23:09:20 +09:00
Hajime Hoshi
f873b66267
graphicscommand: Reduce calling InternalWidth/InternalHeight
2019-09-28 23:03:11 +09:00
Hajime Hoshi
791f96f980
graphicscommand: Reduce division operators
2019-09-28 02:31:04 +09:00
Hajime Hoshi
7bb2895415
clock: Avoid calling (js.Value).Get() for performance
2019-09-28 01:47:48 +09:00
Hajime Hoshi
af6bda48c3
Reduce division operators
...
It looks like runtime.wasmDiv takes account for a big part at CPU
usages with examples/sprites.
2019-09-27 03:29:10 +09:00
Hajime Hoshi
3cf867035d
buffered: Do not delay commands if possible
...
Delaying commands causes memory allocations, which can be heavy
especially on browsers.
This avoids to use 'defer' for performance.
2019-09-27 03:27:47 +09:00
Hajime Hoshi
3291ec51bb
buffered: Use a raw function to avoid allocating structs
2019-09-27 00:37:31 +09:00
Hajime Hoshi
fc3e8bebe4
Use 0-length slice instead of nil to keep capacities
2019-09-27 00:34:55 +09:00
Hajime Hoshi
59333ba1ad
jsutil: Avoid allocating ArrayBuffer unnecessarily
2019-09-26 23:59:00 +09:00
Hajime Hoshi
9a42b264fd
web: Speed optimization
2019-09-26 22:11:16 +09:00
Hajime Hoshi
899fc38d23
Add wasm test with wasmbrowsertest
...
Fixes #881
2019-09-23 02:45:37 +09:00
Hajime Hoshi
33c7f39f0f
graphicsdriver/opengl/gl: Exclude all the files for Wasm
...
Fixes #938
2019-09-23 00:42:54 +09:00
Hajime Hoshi
79b32c7601
graphics: Add buffered package
...
Moved the command queue to the package.
2019-09-21 22:34:37 +09:00
Hajime Hoshi
0a872b342a
shareable: Change the argument to color.RGBA at Fill
...
The argument will be copied explicitly.
2019-09-21 21:16:46 +09:00
Hajime Hoshi
9d867850dc
shareable: Rename Dispose -> MarkDisposed
...
Before this change, it was not clear that shareable's Dispose can
be called from finalizers since finalizers must not be blocked by
a mutex. Actually Dispose could be locked and must not be called
from finalizers.
This change renames the function to avoid confusion of the API,
and make the function available from finalizers.
2019-09-21 20:05:21 +09:00
Hajime Hoshi
053f5a0ce7
shareable: Refactoring
2019-09-21 19:15:49 +09:00
Hajime Hoshi
1c2c932c6c
graphics: Remove MakeVolatile/IsVolatile
2019-09-21 14:53:52 +09:00
Hajime Hoshi
06d198cc0e
shareable: Rename files
2019-09-21 06:09:52 +09:00
Hajime Hoshi
bc4d092710
shareable: Remove (*Image).Size()
2019-09-21 05:56:34 +09:00
Hajime Hoshi
3023cc69c3
restorable: Remove (*Image).Size()
2019-09-21 05:40:05 +09:00
Hajime Hoshi
629d58b93a
graphics: Remove PutQuadVertices
2019-09-21 04:14:25 +09:00
Hajime Hoshi
6095cd965b
shareable: Remove (*Image).PutVertex
2019-09-21 04:01:44 +09:00
Hajime Hoshi
ea52aa52bb
shareable: Fix tests
2019-09-21 03:58:50 +09:00
Hajime Hoshi
d491cab465
restorable: Remvoe unused arguments
2019-09-21 03:44:45 +09:00
Hajime Hoshi
9e78d8c656
graphicscommand: Bug fix: Fix tests
2019-09-21 03:36:48 +09:00
Hajime Hoshi
6fa7d59468
shareable: Remove lock from (*Image).PutVertex
...
Updates #941
2019-09-21 02:17:14 +09:00
Hajime Hoshi
70a38dc09a
graphicscommand: Move pixel->texel conversion to graphicscommand
2019-09-20 23:59:04 +09:00
Hajime Hoshi
915ed91f25
restorable: Remove (*Image).PutVertices
2019-09-20 23:44:09 +09:00
Hajime Hoshi
93dc9ad589
restorable: Refactoring: Remove (*Image).internalSize()
2019-09-20 01:55:18 +09:00
Hajime Hoshi
e0790ee950
Revert "graphics: Delay draw commands and execute them only when needed"
...
This reverts commit 0c70823f27
.
Reason: Switching apps on Android sometimes broke the screen
2019-09-19 01:18:53 +09:00
Hajime Hoshi
0c70823f27
graphics: Delay draw commands and execute them only when needed
...
This change introduces a queue for delayed graphics commands.
When an image's pixels are retrieved or the screen is rendered,
Ebiten calculates the set of the necessary draw commands and
execute them.
This reduces the number of draw calls especially for the launching
phase.
Fixes #921
2019-09-19 01:09:48 +09:00
Hajime Hoshi
845f2bdeb8
Remove unneeded comments
2019-09-18 10:49:20 +09:00
Hajime Hoshi
439599a145
mobile/ebitenmobileview: Bug fix: ebitenmobile should be ignored on non-mobile platforms
2019-09-18 10:46:35 +09:00