Commit Graph

156 Commits

Author SHA1 Message Date
Hajime Hoshi
85cbc7e56b Enable to compile Ebiten on js/wasm with Go 1.14
Fixes #1024
2019-12-19 00:45:53 +09:00
Hajime Hoshi
a3343afc36 graphicsdriver/opengl/gl: Use pkg-config instead of LDFLAGS
Updates #1012
2019-12-11 03:00:25 +09:00
Hajime Hoshi
c9bc5913fd driver: Refactoring: Remove Graphics.Flush
Updates #226
2019-12-06 08:56:55 +09:00
Hajime Hoshi
7991ba4cfa graphicsdriver/metal: Bug fix: Failed to compile for iOS
The definition of BOOL is different between macOS and iOS. C's
bool is used on iOS, but C's bool is hard to use from Go (e.g.,
an integer cannot be converted to C's bool). Use unsigned char
instead.

Fixes #1006
2019-12-03 01:03:44 +09:00
Hajime Hoshi
0ec447e0d0 ui: Add SetScreenTransparent / IsScreenTransparent
Fixes #1001
2019-12-01 03:31:32 +09:00
Hajime Hoshi
a040aae83b glfw: Update to GLFW 3.3
Fixes #1000
2019-11-26 01:19:20 +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
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
3aaeee78dd graphicsdriver/metal: Reduce flushing at ReplacePixels 2019-11-17 16:00:24 +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
8c54cf639a graphicsdriver/opengl: Reduce glFlush calls
Fixes #981
2019-11-14 01:21:08 +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
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
38ee9113ee graphicsdriver/opengl/gl: Remvoe PtrOffset
Updates #889
2019-10-01 01:48:42 +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
3fb9c02e2f graphicsdriver/metal: Bug fix: Use correct pixel format for the screen 2019-09-08 03:52:29 +09:00
Hajime Hoshi
52900fac79 Move back driver getters to ebiten package 2019-09-03 01:46:11 +09:00
Hajime Hoshi
01297fe015 graphicsdriver: Fix a panic message 2019-08-15 21:29:37 +09:00
Hajime Hoshi
df8fdc855a Bug fix: Compile error on GOOS=linux CGO_ENABLED=0 2019-08-01 08:17:58 +09:00
Hajime Hoshi
de915a1736 Move driver getters to graphicsdriver/uidriver packages
This enables to add internal functions to these packages so that
the driver selector logics can be modified.
2019-08-01 00:40:59 +09:00
Hajime Hoshi
4a9a7f936d Make go vet a little happier on macOS
Updates #889
2019-07-22 20:16:22 +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
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
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
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
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
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
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
1e93d9c699 graphicsdriver/opengl: Use context.Context when possible 2019-06-08 01:30:15 +09:00
Hajime Hoshi
85dcafe176 thread: Rename Run -> Call 2019-06-06 00:25:57 +09:00