Commit Graph

393 Commits

Author SHA1 Message Date
Hajime Hoshi
e499535728 graphics: Move functions to the package ebiten 2019-06-26 22:23: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
f48a72a43e shareable: Refactoring: Remove PutQuadVertices 2019-06-22 21:13:44 +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
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
5c93462a9d graphics: Refactoring: Merge DrawImage and drawImage 2019-06-12 23:54:59 +09:00
Hajime Hoshi
cc8e8aef19 graphics: Bounds doesn't work when the image is disposed 2019-05-11 22:44:52 +09:00
Hajime Hoshi
6022d8856e graphics: Bug fix: level must be >= 0
There was a cache that level can be negative. This change fixes
this.
2019-04-25 02:49:59 +09:00
Hajime Hoshi
cce41e8152 graphics: Rename DrawImage -> DrawTriangles for consistency 2019-04-22 23:12:36 +09:00
Hajime Hoshi
c8cc98e307 graphics: Fix documents about At 2019-04-11 14:12:22 -07:00
Hajime Hoshi
61156dd90e graphics: Rename pixelsToSet -> pendingPixels 2019-04-11 14:02:41 -07:00
Hajime Hoshi
3cb9d18fc4 graphics: Bug fix: Too small mipmap
Bug: #839
2019-04-07 05:29:46 +09:00
Hajime Hoshi
5195161253 graphics: Remove SetFinalizer at Image
Package shareable should take care of this.

Finalizers are called at arbitrary timing in a different goroutine
and might cause tough problems. This might be related to #821.
2019-02-22 11:08:34 +09:00
Hajime Hoshi
6c47e31f49 graphics: Do nothing at Dispose of a subimage 2019-02-22 00:08:19 +09:00
Hajime Hoshi
9595f7ae26 graphics: Refactoring: Use a value type of bounds instead of a pointer 2019-02-21 23:51:05 +09:00
Hajime Hoshi
5ed6565d1d graphics: Bug fix: SubImage's SubImage's bounds was wrong 2019-02-21 23:44:57 +09:00
Hajime Hoshi
8f133c443e graphics: Change the definition of isSubImage 2019-02-21 23:27:40 +09:00
Hajime Hoshi
75a0d109be graphics: Rename isSubimage -> isSubImage 2019-02-21 23:24:02 +09:00
Hajime Hoshi
8934f8296f graphics: Bug fix: Don't touch pixelsToSet when disposing a subimage
This change also removes finalizer for subimages since this is not
necessary.

Fixes #823
2019-02-21 23:07:11 +09:00
Hajime Hoshi
ef31a6bb21 graphics: Update comments about makeVolatile 2019-02-13 09:47:30 +09:00
Hajime Hoshi
83da4ea112 graphics: Forbid mipmap for a volatile image explicitly 2019-02-13 01:58:08 +09:00
Hajime Hoshi
5990da4844 graphics: Add makeVolatile instead of newVolatileImage 2019-02-13 00:41:26 +09:00
Hajime Hoshi
5fed3d3bed shareable: Add MakeVolatile 2019-02-13 00:41:24 +09:00
Hajime Hoshi
b962d58097 graphics: Fix comments 2019-02-12 14:36:06 +09:00
Hajime Hoshi
a3eddeb50f Improve panic messages 2019-02-06 23:43:03 -10:00
Jake Bentvelzen
4cb79888fe graphics: Clear mipmap map to avoid unnecessary allocation (#799)
This change uses a pattern that Go 1.11+ compilers can optimize to a clear operation
https://github.com/golang/go/blob/master/doc/go1.11.html#L447
2019-01-27 21:30:30 +09:00
Hajime Hoshi
b5ee209e0b graphics: Bug fix: Filter was not used when SourceRect is used 2019-01-24 14:22:53 +09:00
Hajime Hoshi
15b13c8b62 graphics: Fix comments to be more precise 2019-01-22 00:18:32 +09:00
Hajime Hoshi
8f3ef39d74 graphics: Fix some comments to adjust 80 chars in one line 2019-01-21 11:58:41 +09:00
Hajime Hoshi
29211238d3 graphics: Misspelling again 2019-01-21 11:24:43 +09:00
Hajime Hoshi
234f29e5f6 graphics: Misspelling 2019-01-21 11:22:35 +09:00
Hajime Hoshi
92d6c6bc58 graphics: Fix documents about DrawImage and ColorM 2019-01-21 11:19:23 +09:00
Hajime Hoshi
aa2919ada4 graphics: Add comments about DrawImage 2019-01-20 03:27:02 +09:00
Hajime Hoshi
10cb0bba5f graphics: Add documentation about texture atlas size 2019-01-19 22:14:50 +09:00
Hajime Hoshi
c1c0306471 graphics: Update the document about DrawImage 2019-01-19 22:14:04 +09:00
Hajime Hoshi
58cc5cb105 graphics: Better error message for At and Set (#790) 2019-01-19 02:59:22 +09:00
Hajime Hoshi
dd59d8ae6e Fix comments 2019-01-19 02:30:06 +09:00
Hajime Hoshi
107dfe5074 graphics: Improve Set speed
On GopherJS, copying a struct is very heavy. This change avoids
copying (color) structs when possible.
2019-01-14 04:25:43 +09:00
Hajime Hoshi
6b110bf99e graphics: Better implementation of Set 2019-01-14 04:07:26 +09:00
Hajime Hoshi
128e99b6af graphics: Implement (*Image).Set 2019-01-14 02:25:36 +09:00
Hajime Hoshi
1e1f309a1c shareable: Add Fill
Before introducing Fill, filling an image with a solid color was
implemented by ReplacePixels. When an offscreen image is used, the
offscreen image is not fully cleared or filled with a color and
out of (0,0)-(width,height) region. This causes a glitch thin line
on mobile platforms.

This change adds (*shareable.Image).Fill to fill the whole
framebuffer region of the image.
2019-01-13 02:12:47 +09:00
Hajime Hoshi
d5e6e6893e graphics: Refactoring 2019-01-13 00:56:33 +09:00
Hajime Hoshi
ea9eac0461 graphics: Add explicit types for documents (godoc.org) 2018-12-24 19:36:41 +09:00
Hajime Hoshi
f1582c2d73 graphics: Add Address representing a sampler address mode
Fixes #761
2018-12-24 17:29:31 +09:00
Hajime Hoshi
529cd3376b graphics: Fix comments about Vertex 2018-12-23 06:14:35 +09:00
Hajime Hoshi
189b8a17e9 graphics: Use source-border check even at DrawTriangles
DrawTriangles can now take a sub-image.
2018-12-23 03:24:39 +09:00
Hajime Hoshi
1a54ff34e6 graphics: Forbid nil at ReplacePixels explicitly 2018-11-28 22:26:34 +01:00
Hajime Hoshi
b48d501bc0 graphics: Explicit limitation of indices at DrawTriangles
Fixes #728
2018-11-23 19:02:10 +09:00
Hajime Hoshi
7586c660d5 graphics: Change the number of floats for a vertex from 10 to 12
This is a preparation for Metal, that forces 4 floats for a vertex
position.
2018-11-17 15:30:11 +09:00