Commit Graph

4343 Commits

Author SHA1 Message Date
Hajime Hoshi
9e8b23f7dc Update bitmapfont version to v1.2.0 2019-07-14 18:09:09 +09:00
Hajime Hoshi
dfe3116ac8 Update Oto version 2019-07-11 22:27:22 +09:00
Hajime Hoshi
fd9e376ff6 restorable: Add ClearPixels
This hides the implementation details of allocating byte slice.

This change also adds comments about #897.
2019-07-10 02:39:36 +09:00
Hajime Hoshi
5ec2f66524 shareable: Bug fix: Updated maxSize wrongly
Updates #892
2019-07-04 01:57:04 +09:00
Hajime Hoshi
3a0dbd3977 graphicsdriver/opengl: Use sync.Once for concurrent safety 2019-07-04 01:15:51 +09:00
Hajime Hoshi
6b7f21f0c8 driver: Add Graphics.MaxImageSize and use it
There are some devices that cannot accept 4096x4096 pixels
textures. Get the maximum size and use it.

Fixes #892
2019-07-04 01:10:11 +09:00
Hajime Hoshi
51951d6087 glfw: Take a byte pointer instead of a uintptr at the callback
Make 'go vet' happy on Windows.
2019-06-27 22:57:44 +09:00
Hajime Hoshi
9a0cefedce glfw: Bug fix: Missed to initialize a member of VidMode on Windows 2019-06-27 03:38:14 +09:00
Hajime Hoshi
7f15013014 mobile: Unify the empty implementation into one file 2019-06-27 01:44:53 +09:00
Hajime Hoshi
4a02f88ae3 Update Oto version to 0.3.5 2019-06-27 01:08:05 +09:00
Hajime Hoshi
480c5527a3 ui/mobile: Move 'DoWork' logic to ui/mobile package
This simplifies driver.Graphics interface, and will make it easy
to use another graphics driver than OpenGL.
2019-06-27 00:32:37 +09:00
Hajime Hoshi
e499535728 graphics: Move functions to the package ebiten 2019-06-26 22:23:09 +09:00
Hajime Hoshi
ed09406655 graphicscommand: Bug fix: wrong adjustment of texels
Fixes #887
2019-06-26 11:45:09 +09:00
Hajime Hoshi
f40798b586 graphics: Move const definitions to driver package
Let's keep 'graphics' package as a package for utility functions
or testable functions as much as possible.
2019-06-26 01:05:13 +09:00
Hajime Hoshi
9963ae332e graphics: Remove FilterDefault from internal/graphics 2019-06-26 00:33:30 +09:00
Hajime Hoshi
847a8b4d53 graphics: Refactoring 2019-06-26 00:18:40 +09:00
Hajime Hoshi
93c31654da graphicscommand: Refactoring 2019-06-25 23:55:33 +09:00
Hajime Hoshi
09d473ea1b restorable: Add comments 2019-06-25 23:42:18 +09:00
Hajime Hoshi
7e0dee0730 graphicscommand: Bug fix: Use graphics.InternalImageSize before specifying the size
Fixes #887
2019-06-25 22:47:37 +09:00
Hajime Hoshi
26296993f8 graphics: Fix comments again 2019-06-24 17:22:38 +09:00
Hajime Hoshi
f008c6ab80 graphics: Fix comments 2019-06-24 12:54:02 +09:00
Hajime Hoshi
c492920842 graphics: Bug fix: Avoid init-order dependency by sync.Once
graphicsDriver() function can be called from init() functions,
while isMetalSupported is initialized in another init() functions.
There was a hidden dependency on init functions.

This change avoid this by replacing the init function with
sync.Once.

Updates #886
2019-06-24 03:06:33 +09:00
Hajime Hoshi
f7338eb715 graphics: Early return at the driver selector 2019-06-24 02:32:40 +09:00
Hajime Hoshi
de4b439228 uidriver/glfw: Bug fix: Thread must be set before the loop starts
The graphics driver needs to have its thread before the loop
starts, or the driver crashes (nil reference) when it tries to use
the thread.
2019-06-24 02:03:14 +09:00
Hajime Hoshi
0cc49b6923 shareable: Refactoring 2019-06-23 11:33:17 +09:00
Hajime Hoshi
7a399c1b82 shareable: Update page sizes dynamically
Also, all the images cannot use the shareable backends before the
game starts, but it is expected that read-only images will use
shareable backends later.

Fixes #879
2019-06-22 23:05:28 +09:00
Hajime Hoshi
f48a72a43e shareable: Refactoring: Remove PutQuadVertices 2019-06-22 21:13:44 +09:00
Hajime Hoshi
5d4f150094 shareable: Add comments about highp
Updates #879
2019-06-22 17:41:19 +09:00
Hajime Hoshi
9bff33472a driver: Add (Graphics).HasHighPrecisionFlaot
This enables to determine whether vertices should be adjusted or
not.

Fixes #879
2019-06-22 14:57:53 +09:00
Hajime Hoshi
cddb93b9f6 graphicscommand: Move the texel adjustment logic to graphicscommand package
This is a preparation for #879. The value of the texel adjustment
depends on the graphics driver (GLSL float precisions), and this
can be accessed only after the run loop runs. The place where
graphics commands are executed seems an appropriate place.

Updates #879
2019-06-22 03:52:51 +09:00
Hajime Hoshi
f3cdb0537b graphics: Move the vertices backend to ebiten package
Now restorable/sharable packages cannot use the same vertices
backend, but I think this won't affect the performance
significantly.
2019-06-22 00:02:22 +09:00
Hajime Hoshi
69ebc481e8 graphics: Refactoring: Unify PutVertex and PutQuadVertices implementation 2019-06-21 23:49:05 +09:00
Hajime Hoshi
8dc2301e54 thread: Bug fix: Queue funcs instead of panic
Now the thread object is created at (*UserInterface).Run, we don't
have to care whether the (main) thread is started or not when
Call is called. Admit queueing the functions.

Fixes #884
2019-06-21 11:10:27 +09:00
Hajime Hoshi
3eee4754c5 graphics: Use the common vertices backend for PutVertex 2019-06-21 02:30:58 +09:00
Hajime Hoshi
008de78cec graphics: Refactoring: Change QuadVertices -> PutQuadVertices for consistency 2019-06-21 02:20:31 +09:00
Hajime Hoshi
c7ab66e0e1 graphicsdriver/metal: Move MTLDevice and CAMetalLayer to the other struct
On iOS, they are given or included in a MTKView and we don't have
to (or should not) make them. Let's move them to a different
struct.
2019-06-19 02:17:45 +09:00
Hajime Hoshi
57d493a549 web: Optimization: Cache user agent value 2019-06-17 10:56:50 +09:00
Hajime Hoshi
4396978d4b jsutil: Refactoring 2019-06-17 10:48:36 +09:00
Hajime Hoshi
ab61a2d23c Update Oto version 2019-06-17 03:01:00 +09:00
Hajime Hoshi
34187d03a8 jsutil: Remove unused functions 2019-06-15 01:34:28 +09:00
Hajime Hoshi
7efe4758bd Update Oto version to master for Go 1.13 (tip)
Updates #878
2019-06-15 01:15:27 +09:00
Hajime Hoshi
c52e043006 Add jsutil package for new API of Go 1.13
Audio part still cannot be compiled due to Oto.

Fixes #878
2019-06-15 00:49:57 +09:00
Hajime Hoshi
a19bf4214b Improve testability on Wasm 2019-06-14 23:59:38 +09:00
Hajime Hoshi
a5c260b4b5 Update flock to v0.7.1 2019-06-13 09:44:03 +09:00
Hajime Hoshi
8044b7405a go mod tidy (and go test) 2019-06-13 09:35:44 +09:00
Hajime Hoshi
5c93462a9d graphics: Refactoring: Merge DrawImage and drawImage 2019-06-12 23:54:59 +09:00
Hajime Hoshi
3679bd11f5 affine: Add TestGeoMEquals
Updates #866
2019-06-09 06:56:25 +09:00
Hajime Hoshi
3af351a2aa graphicsdriver/metal: Make this compilable on iOS
This change adds #ifs to enable to compile the driver on iOS.

This also removes BOOL, which can be a duplicated definition.
C's _Bool does not work well with Cgo. Use uint8_t instead for
boolean values.
2019-06-09 05:51:10 +09:00
Hajime Hoshi
67230ec499 graphicsdriver/metal/mtl: Remove CopyAllDevices
CopyAllDevices is not used at Ebiten, and not defined on iOS.
2019-06-09 04:32:48 +09:00
Hajime Hoshi
42cf9d1750 mobile: Lock the OS thread before using mutex
As switching the OS thread by mutex could theoretically happen
(I think this is almost 0% in Ebiten's case), locking the OS
thread should happen before the mutex.
2019-06-08 02:00:40 +09:00