Now there are APIs to use shaders
And there are some builtin functions for shaders
I'm not satisfied with this yet. I think the API can be more minimal and simple. For example, I think it is fine to merge DrawTriangles and DrawTrianglesShader, like what DrawImage does. For builtin functions, they can be more consistent and concise.
I'll rename
CC @tomlister @nanoslayer
Seems like a good fit 👍
imageSrc[N]BoundsAt sounds a little odd but I didn't come up with a better name. imageSrc[N]AtWithBoundaryCheck seems verbose.
imageSrc[N]AtFast and imageSrc[N]At?imageSrc[N]AtUnsafe and imageSrc[N]At?imageSrc[N]At and imageSrc[N]AtSafe?My current plan:
imageSrc[N]BoundsAt -> imageSrc[N]AtimageSrc[N]At -> imageSrc[N]UnsafeAtNow there are APIs to use shaders
DrawImageDrawRectShaderDrawTrianglesAnd there are some builtin functions for shaders
imageSrcTextureSize / imageDstTextureSize // returns the size in pixelsimageSrcTextureRegion // returns the region in texelsimage[N]UnsafeAtimage[N]AtI'll rename imageSrcTextureRegion to imageSrcRegionOnTexture
Good stuff 👍
On Sat, 19 Sep 2020, 8:30 pm Hajime Hoshi, notifications@github.com wrote:
Now there are APIs to use shaders
- DrawImage
- DrawRectShader
- DrawTriangles
And there are some builtin functions for shaders
- imageSrcTextureSize / imageDstTextureSize
- imageSrcTextureRegion
- image[N]UnsafeAt
- image[N]At
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/hajimehoshi/ebiten/issues/1325#issuecomment-695196386,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSK64Z5E5FGI3DZJBBIEYDSGSB2VANCNFSM4QRNJJVQ
.
||Number of source images|How source images are specified|Note|
|-|-|-|-|
|DrawImage [1]|1|An argument|The most common function|
|DrawRectShader [2]|0 to 4|An option|Newly introduced|
|DrawTriangles|0 to 4|An argument and an option [3]|The lowest-level function|
[1] DrawImage now can take a shader, but is this needed?
[2] DrawRect seems more consistent?
[3] This might be changed in the future #1352
I'll change the API like this for consistency:
||Number of source images|How source images are specified|Shader|
|-|-|-|-|
|DrawImage|1|An argument|No|
|DrawRectShader|0 to 4|An option|Yes|
|DrawTriangles|1|An argument|No|
|DrawTrianglesShader|0 to 4|An option|Yes|
Sorry for going back and forth.
OK let's go with them and see how things go!
Most helpful comment
I'll rename
CC @tomlister @nanoslayer