Commit Graph

4168 Commits

Author SHA1 Message Date
Hajime Hoshi
0bf12d5519 graphics: Unify dumping logic 2019-07-20 01:46:33 +09:00
Hajime Hoshi
d78db1738d graphicscommand: Fix comments 2019-07-20 01:22:13 +09:00
Hajime Hoshi
94852b07b2 graphics: Use ID for dumped internal images
Updates #900
2019-07-19 23:41:56 +09:00
Hajime Hoshi
0793d35c40 graphicscommand: Improve debug messages
Fixes #900
2019-07-19 23:35:13 +09:00
Hajime Hoshi
38a1ee7f57 restorable: Split pixel records into regions
Fixes #897
2019-07-19 10:59:48 +09:00
Hajime Hoshi
b4dddd330a restorable: Refactoring: Use width/height instead of length at Pixels 2019-07-17 23:20:03 +09:00
Hajime Hoshi
efb6f9c453 graphicscommand: Remove CopyPixels command
This is an optimization. This change enables to avoid reading
pixels from GPU when extending an image.

Updates #897
2019-07-17 23:19:57 +09:00
Hajime Hoshi
736a840d53 restorable: More restricted Extend
As a side effect, ReplacePixels always record pixels even when
restoring is not needed. As CopyPixels reads pixels in any cases,
this shortcut was originally useless.
2019-07-17 22:15:37 +09:00
Hajime Hoshi
353d81fd58 restorable: Rename NewImageFromImage to Extend 2019-07-17 03:32:08 +09:00
Hajime Hoshi
91a4329f0d restorable: Disallow ReplacePixels for a part after Fill
This simplifies Pixels struct. This is a preparation to change
how to record pixels.

Updates #897
2019-07-17 03:15:03 +09:00
Hajime Hoshi
2735f4eddc restorable: Fix comments 2019-07-17 02:42:26 +09:00
Hajime Hoshi
4ee586b7a5
docs: Update 'cheat sheet' link to ebiten.org 2019-07-16 15:00:38 +09:00
Hajime Hoshi
349a290aa3 restorable: Refactoring 2019-07-16 03:08:26 +09:00
Hajime Hoshi
8ae2fef817 restorable: Refactoring: Do not have to update basePixels in some cases
If there is no draw-traiangles command, the image can keep its
basePixels.
2019-07-16 02:48:52 +09:00
Hajime Hoshi
6d20e3f951 restorable: Add assertion at fillImage 2019-07-16 02:18:52 +09:00
Hajime Hoshi
2b632d0707 restorable: Remove Pixels.Slice() 2019-07-16 02:03:15 +09:00
Hajime Hoshi
f3fa535afb restorable: Refactoring: Disallow nil at ReplacePixels 2019-07-16 01:44:56 +09:00
Hajime Hoshi
052697e305 Update dependencies 2019-07-15 13:16:57 +09:00
Hajime Hoshi
84aabd075f restorable: Use DrawTriangles to restore the image
This can avoid allocating a big byte slice.
2019-07-15 05:03:46 +09:00
Hajime Hoshi
7e4e9cc893 restorable: Refactoring 2019-07-15 04:17:52 +09:00
Hajime Hoshi
701c4eeb7c restorable: Fix comments 2019-07-15 03:24:18 +09:00
Hajime Hoshi
66b00c6f87 graphics: Remove println 2019-07-15 03:12:53 +09:00
Hajime Hoshi
801e0c4d47 graphics: Refactoring 2019-07-15 03:10:37 +09:00
Hajime Hoshi
a7e7e007ca restorable: Bug fix: PutQuadVertices should take the source image
Fixes #898
2019-07-15 03:10:03 +09:00
Hajime Hoshi
aee26eec1e restorable: Refactoring: Replace CopyPixels with NewImageFromImage 2019-07-15 02:04:23 +09:00
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