Commit Graph

216 Commits

Author SHA1 Message Date
Hajime Hoshi
f04e391cb4 all: rename emptyImage -> whiteImage 2022-10-21 15:26:56 +09:00
Hajime Hoshi
9ec23ddeb4 ebiten: add DrawTrianglesOptions.AntiAlias and DrawTrianglesShaderOptions.AntiAlias
Closes #2385
2022-10-21 02:07:41 +09:00
Hajime Hoshi
6e9e57b3bd ebiten: skip slow tests on 32bit Windows
Updates #2332
Updates #2382
2022-10-18 01:02:44 +09:00
Hajime Hoshi
da5f5ea327 ebiten: add blend factors
Updates #2382
2022-10-18 00:21:13 +09:00
Hajime Hoshi
15ae074c43 ebiten: clean up tests 2022-10-17 11:45:31 +09:00
Hajime Hoshi
180e456a8e ebiten: rename members of Blend
Updates #2382
2022-10-17 00:51:55 +09:00
Hajime Hoshi
e03825bf08 ebiten: add BlendOperationSubtract and BlendOperationReverseSubtract
Updates #2382
2022-10-17 00:30:24 +09:00
Hajime Hoshi
b79495761e ebiten: add Blend and deprecate CompositeMode
Updates #2382
2022-10-16 22:47:00 +09:00
Hajime Hoshi
058b8d5635 ebiten: add ColorScaleFormat to DrawTrianglesOptions
Closes #2365
2022-10-02 14:14:11 +09:00
Hajime Hoshi
f6c4b29a3d ebiten: add TestImageColorMAndScale 2022-10-02 01:02:29 +09:00
Hajime Hoshi
0217ed0544 ebiten: add WritePixels replacing ReplacePixels
Closes #2236
2022-08-08 03:50:27 +09:00
Hajime Hoshi
ea04e2a9de ebiten: remove returning error from ReadPixels
- As ReadPixels should often be used at Draw, error handling would be hard.
- Make the API consistent with ReplacePixels.

Updates #1995
2022-08-08 02:48:25 +09:00
Hajime Hoshi
c382cb2b05 ebiten: use %v for consistency 2022-08-08 01:43:11 +09:00
Hajime Hoshi
81bd5b488c ebiten: add (*Image).ReadPixels
Closes #1995
2022-08-08 01:42:26 +09:00
mattn
2bacecca24
fix typos (#2227) 2022-08-03 22:40:39 +09:00
Hajime Hoshi
b48c2aa103 internal/graphicsdriver/directx: bug fix: too many constant buffers could be allocated
Closes #2204
2022-07-15 03:40:24 +09:00
Hajime Hoshi
afed6a83c6 internal/graphics: change the naming convention: Num -> Count
This change also renames ebiten.MaxIndicesNum -> ebiten.MaxIndicesCount.
2022-07-13 02:02:44 +09:00
Hajime Hoshi
80c26e6dcc ebiten: bug fix: Set after Set resulted in a wrong color
Updates #2154
Updates #2176
2022-07-05 01:13:45 +09:00
Hajime Hoshi
66bf40dc84 ebiten: bug fix: resolveSetVerticesCacheIfNeeded could resolve more vertices
Closes #2178
2022-07-05 00:28:53 +09:00
Hajime Hoshi
a70e069f0d ebiten: add tests
Updates #2178
2022-07-04 23:58:00 +09:00
Hajime Hoshi
ddced3af9f ebiten: bug fix: Fill and Clear doesn't work on an image whose upper-left is not (0, 0)
Closes #2159
2022-06-24 02:02:00 +09:00
Hajime Hoshi
acd70d6e34 ebiten: add NewImageFromImageWithOptions
Closes #2013
Closes #2017
Closes #2124
2022-06-15 14:19:16 +09:00
Hajime Hoshi
bac34a4474 ebiten: add NewImageWithOptions and NewImageOptions
This change adds NewImageWithOptions, that creates a new image with
the given options.

NewImageWithOptions takes image.Rectangle instead of a width and a
height, then a user can create an image with an arbitrary bounds.
A left-upper position can be a negative number.

NewImageWithOptions can create an unmanged image, that is no longer
on an automatic internal texture atlas. A user can have finer controls
over the image.

This change also adds tests for this function.

Updates #2013
Updates #2017
Updates #2124
2022-06-15 02:20:19 +09:00
Hajime Hoshi
9ddcf58728 ebiten: allow passing ebiten.Image to NewImageFromImage
Closes #1917
2022-04-02 06:10:22 +09:00
Hajime Hoshi
696bbc088f internal/ui: rename variables 2022-03-20 16:51:23 +09:00
Hajime Hoshi
673556d03f internal/ui: move the error handlings to the ui package 2022-03-20 16:26:26 +09:00
Hajime Hoshi
b59dd45239 internal/buffered: separate ReplacePixels with the large-area and small-area versions
For the large-area version, this doesn't require a graphics driver.
This is necessary to ensure that ReplacePixels never needs a graphics
driver.
2022-03-20 04:13:31 +09:00
Hajime Hoshi
d4d4b9c070 internal/graphicsdriver/metal, internal/graphicsdriver/opengl: more efficient modulo 2022-03-04 03:47:55 +09:00
divVerent
62229e82a6
Pre-failing test for color interpolation during rendering. (#2001)
Before #1996, this failed with:

image_test.go:1997: At(1, 0): got: {64 64 128 255}, want: {0 128 128 255}

The difference is:

- Before, colors were interpolated in straight-color space:
  - Background: {0 0 255 255}
  - Vertex A: {255 0 0 0}
  - Vertex B: {0 255 0 255}
  - Interpolated: {128 128 0 128}
  - Premultiplied: {64 64 0 128}
  - Onto Background: {64 64 128 255}
- After, colors are interpolated in premultiplied space:
  - Background: {0 0 255 255}
  - Vertex A: {255 0 0 0}
  - Vertex A premultiplied: {0 0 0 0}
  - Vertex B: {0 255 0 255}
  - Vertex B premultiplied: {0 255 0 255}
  - Interpolated: {0 128 0 128}
  - Onto Background: {0 128 128 255}

This DIFFERS from the sample fragment shader, which returns the color as is
(Kage allows vertex color values to be used for arbitrary purposes and
interpolates independently):

- Shader sample:
  - Background: {0 0 255 255}
  - Vertex A: {255 0 0 0}
  - Vertex B: {0 255 0 255}
  - Interpolated: {128 128 0 128}
  - Onto Background: {128 128 128 255}

as the blend function is `GL_ONE` / `GL_ONE_MINUS_SRC_ALPHA`. This shader behavior
is unchanged but has been documented by #1996.
2022-02-24 03:12:33 +09:00
Hajime Hoshi
f182b185d9 internal/graphicscommand: bug fix: overflow when len(vertices) > len(indices)
Closes #1913
2021-12-26 06:15:12 +09:00
r3vit
57c45a13e4
Remove dot imports from tests - Remove dot imports (#1837)
Closes #1824
2021-10-02 19:58:48 +09:00
Hajime Hoshi
65c2fd4bcd ebiten: Bug fix: Test compile error 2021-09-19 17:54:13 +09:00
Trevor Slocum
92d8562b1d
ebiten: Add (*Image).RGBA64At (#1773)
Closes #1769.
2021-08-21 15:15:48 +09:00
Hajime Hoshi
a29748ab2b ebiten: Refactoring: Move a test 2021-08-18 01:13:40 +09:00
Hajime Hoshi
415ceded79 ebiten: Bug fix: Colorm.Concat crashed when the argument is an initial value
Closes #1765
2021-08-18 01:09:07 +09:00
Hajime Hoshi
c06e8a5501 ebiten: Fix tests for a very restricted environment (Steam Runtime)
Updates #1733
2021-07-28 22:04:13 +09:00
Hajime Hoshi
79e067b0f8 ebiten: Add BenchmarkColorMScale
Updates #1658
2021-07-27 13:31:37 +09:00
Hajime Hoshi
674802d2f5 ebiten: Bug fix: Draw commands with EvenOdd should not be merged
Updates #1684
2021-07-05 18:08:55 +09:00
Hajime Hoshi
daa883d799 ebiten: Bug fix: Stencil buffers should not be cleared until all the vertices are rendered
Updates #1684
2021-07-05 17:41:06 +09:00
Hajime Hoshi
66be53804d ebiten: Bug fix: Fill on a sub-image didn't work correctly
Closes #1691
2021-07-02 22:42:28 +09:00
Hajime Hoshi
ed028110cf ebiten: Allow rendering on a sub-image by scissor test
Fixes #1255
2020-11-08 00:58:44 +09:00
Hajime Hoshi
fa53160e18 mipmap: Stop using negative mipmaps
Negative mipmaps tend to allocate extremely big images.

Instead, encourage to use images with explicit padding when enlarging
the image.

Fixes #1400
2020-10-31 02:52:40 +09:00
Hajime Hoshi
2259378430 ebiten: Panic immediately when zero size is given to NewImage(FromImage) 2020-10-23 00:42:57 +09:00
Hajime Hoshi
d6eac8c5bf ebiten: Better test name
Updates #1399
2020-10-21 11:33:08 +09:00
Hajime Hoshi
e7d080ca4a mipmap: Bug fix: Too big scale tried to allocate too big images
Fixes #1399
2020-10-21 11:28:05 +09:00
Hajime Hoshi
a3cb78558b mipmap: Bug fix: Scale could be Inf/0 and caused a forever loop
Fixes #1398
2020-10-21 10:55:36 +09:00
Hajime Hoshi
00f3d83d4c Remove supporting GopherJS
Fixes #1129
2020-10-07 01:10:09 +09:00
Hajime Hoshi
1b816eb249 ebiten: Remove the error returning value from NewImageFromImage
Updates #1380
2020-10-06 01:03:33 +09:00
Hajime Hoshi
c6053bcf14 ebiten: Remove the error returning value from NewImage
Updates #1380
2020-10-06 00:48:56 +09:00
Hajime Hoshi
54da0d9763 ebiten: Remove the returning value from (*Image).DrawImage
Updates #1380
2020-10-06 00:21:17 +09:00