Commit Graph

1888 Commits

Author SHA1 Message Date
Hajime Hoshi
c243bfcdd8 uidriver/glfw: Fix comments 2019-12-08 23:03:13 +09:00
Hajime Hoshi
3e89e7e561 uidriver/glfw: Bug fix: Show the window at last on initialization 2019-12-08 23:00:10 +09:00
Hajime Hoshi
e00a190f22 uidriver/glfw: Refactoring: Add toDeviceIndependentPixel / toDeviceDependentPixel 2019-12-08 22:09:12 +09:00
Hajime Hoshi
a0cf8bac21 uidriver/glfw: Refactoring: Limit the calls of devicescale.GetAt 2019-12-08 20:55:40 +09:00
Hajime Hoshi
8e9f5b9535 driver: Remove Suspend/ResumeAudio from UIContext 2019-12-08 16:17:02 +09:00
Hajime Hoshi
63fbffa9f6 uidriver/glfw: Fix thread issues at reqWidth/reqHeight 2019-12-08 02:44:14 +09:00
Hajime Hoshi
22e3db6814 uidriver/glfw: Add comments
Updates #1004
2019-12-08 02:04:04 +09:00
Hajime Hoshi
80fbc9701c uidriver/glfw: Force to swap buffer or recreate an window after toggling fullscreen
This change resolves a bug that an image lag remains after
toggling fullscreen.

On OpenGL, swapping buffer is necessary after toggling fullscreen.

On Metal, recreating a window works after toggling fullscreen.

Fixes #1004
2019-12-08 01:47:32 +09:00
Hajime Hoshi
2180613e2a uidriver/glfw: Refactoring: Add createWindow 2019-12-07 19:56:56 +09:00
Hajime Hoshi
67ee0ff5d4 uidriver/glfw: Refactoring: Remove forceSetScreenSize 2019-12-07 17:35:57 +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
42056c2d61 restorable: Refactoring: Remove Clear
Fill now fills the whole texture.
2019-12-02 03:03:07 +09:00
Hajime Hoshi
b35ffa57b3 Revert "uidriver/glfw: Remove the dirty hack for GLFW 3.2"
This reverts commit d1da5b4920.

Reason: The dirty hack might still be needed.
2019-12-02 01:06:55 +09:00
Hajime Hoshi
d1da5b4920 uidriver/glfw: Remove the dirty hack for GLFW 3.2
See also https://github.com/glfw/glfw/issues/1334.

Updates #703
2019-12-02 01:04:28 +09:00
Hajime Hoshi
5153713469 uidriver/glfw: Make the panic messages more consistent 2019-12-01 03:34:09 +09:00
Hajime Hoshi
0ec447e0d0 ui: Add SetScreenTransparent / IsScreenTransparent
Fixes #1001
2019-12-01 03:31:32 +09:00
Hajime Hoshi
b8a099e354 ui: Bug fix: (Set)WindowPosition didn't work well with fullscreen mode 2019-12-01 00:39:04 +09:00
Hajime Hoshi
6cd0b44baa uidriver/glfw: Use invalidPos instead of pointers 2019-12-01 00:21:11 +09:00
Hajime Hoshi
e463f9e611 ui: Make (Set)WindowPosition concurrent safe 2019-12-01 00:11:46 +09:00
Hajime Hoshi
9b2f864fc8 ui: Add SetWindowPosition(x, y int)
Fixes #936
2019-11-30 23:22:39 +09:00
Hajime Hoshi
c021d6be6a ui: Add WindowPosition()
Fixes #936
2019-11-30 22:37:56 +09:00
Hajime Hoshi
e0d780b029 uidriver/glfw: Enable to call SetWindowDecorated after Run
Fixes #556
2019-11-26 11:46:18 +09:00
Hajime Hoshi
995ba3afcf glfw: Update GLFW 3.3 2019-11-26 11:21:07 +09:00
Hajime Hoshi
a040aae83b glfw: Update to GLFW 3.3
Fixes #1000
2019-11-26 01:19:20 +09:00
Hajime Hoshi
5f33d47711 png: Add stdlibfuzz.go 2019-11-26 00:13:50 +09:00
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