Commit Graph

108 Commits

Author SHA1 Message Date
Hajime Hoshi
c768860f3f internal/graphicsdriver/opengl: remove fnGetExtension 2022-11-17 12:40:56 +09:00
Hajime Hoshi
bae5aa7732 internal/graphicsdriver/opengl: move initGL to NewGraphics
As restoring from context lost doesn't happen on browsers, initilizing
GL doesn't have to be done at reset.
2022-11-17 12:34:55 +09:00
Hajime Hoshi
4082223aec internal/graphicsdriver/opengl: remove webGLVersion 2022-11-17 12:27:32 +09:00
Hajime Hoshi
74d9515345 internal/graphicsdriver/opengl: refactoring: move gl_js to gl/context_js.go
This unifies the OpenGL context interface for all the platforms.
2022-11-17 12:22:46 +09:00
Hajime Hoshi
f08983e14d internal/graphicsdriver/opengl: remove unused variables
It should be safe to assume 0 is an invalid texture ID in OpenGL.

https://registry.khronos.org/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
> If texture is zero, or is a non-zero value that is not currently the
> name of a texture, or if an error occurs, glIsTexture returns GL_FALSE.
2022-11-17 10:53:28 +09:00
Hajime Hoshi
de3702e4c2 internal/graphicsdriver/opengl: reduce unnecessary slice allocations 2022-11-17 03:01:31 +09:00
Hajime Hoshi
e8810495cf internal/graphicsdriver/opengl/gl: reland: refactoring: reduce opengles build tags
This is a reland of c9cff69dcb.

Updates #292
2022-11-14 02:21:18 +09:00
Hajime Hoshi
5cfb7c9469 internal/graphicsdriver/opengl: make context_gles.go closer to context_gl.go
Updates #2451
2022-11-13 14:20:47 +09:00
Hajime Hoshi
0c5a77eaa4 internal/graphicsdriver/opengl/gles: integrate gles and glconst into gl
Updates #2451
2022-11-13 14:15:22 +09:00
Hajime Hoshi
879cf50aaf internal/graphicsdriver/opengl: remove unused functions 2022-11-13 02:54:34 +09:00
Hajime Hoshi
1ecac8d834 all: allow integer uniform variables for Kage shaders
Closes #2305
Updates #2448
2022-11-13 01:49:24 +09:00
Hajime Hoshi
0db2318a8d internal/graphicsdriver/opengl: update comments 2022-11-12 19:31:16 +09:00
Hajime Hoshi
cee948048d internal/graphicsdriver/opengl: remove unused functions 2022-11-12 19:28:14 +09:00
Nathan Levett
f220eb729c
internal/graphicsdriver/opengl: move OpenGL constants to seperate package (#2408)
Closes #2389
2022-10-24 23:22:14 +09:00
Hajime Hoshi
180e456a8e ebiten: rename members of Blend
Updates #2382
2022-10-17 00:51:55 +09:00
Hajime Hoshi
b6987b6312 internal/graphicsdriver/opengl: bug fix: needed to reset lastBlend 2022-10-16 20:44:09 +09:00
Hajime Hoshi
09a7d39874 internal/graphicsdriver: add Blend struct
This is a preparation to specify blend factors and blend operators.

Updates #2382
2022-10-16 01:08:26 +09:00
Hajime Hoshi
37c5f53890 internal/graphicsdriver/opengl: refactoring 2022-10-15 22:14:21 +09:00
Hajime Hoshi
272d0c6a3f internal/graphicsdriver: rename Operator -> BlendFactor
Updates #2382
2022-10-15 17:34:03 +09:00
Hajime Hoshi
ec68534c73 internal/graphicsdriver/opengl: introduce EBITENGINE_OPENGL replacing ebitenginewebgl1
This change inroduces a new environment variable `EBITENGINE_OPENGL`
to replace the build tag `ebitenginewebgl1`.
2022-08-28 01:45:58 +09:00
Hajime Hoshi
b2f874a244 image/rectangle: read pixels only for necessary parts
Closes #2274
2022-08-27 23:23:33 +09:00
Hajime Hoshi
70f5e84098 internal/graphicsdriver: rename ReplacePixels to WritePixels
Updates #2236
2022-08-08 03:05:04 +09:00
Hajime Hoshi
72d5002e72 remove go2cpp support
Closes #2126
2022-08-07 22:17:53 +09:00
Hajime Hoshi
4a19d645b7 internal/graphicsdriver/opengl: remove a comment 2022-06-11 15:36:10 +09:00
Hajime Hoshi
71a32d2036 internal/ui: pass the canvas element directly instead of an ID 2022-06-11 15:34:17 +09:00
Hajime Hoshi
95628ee5f7 internal/ui: add a unique ID to the canvas for browsers 2022-06-11 15:24:50 +09:00
Hajime Hoshi
3fafc05411 internal/graphicsdriver: remove Graphics.HasHighPrecisionFloat
Updates #879
2022-04-02 05:19:30 +09:00
Hajime Hoshi
b22309a0e5 internal/graphicsdriver: replace Pixels with ReadPixels
Now preparing a byte slice is the caller's responsibility.
2022-02-27 20:03:13 +09:00
Hajime Hoshi
df60c4c92d internal/driver: rename to internal/graphicsdriver 2022-02-06 20:41:32 +09:00
Hajime Hoshi
3b0ce21a56 Revert "internal/graphicsdriver: bug fix: render semi-transparent vectors correctly"
This reverts commit 202f642395.

Reason: TestImageEvenOdd failed

Updates #1933
2022-01-06 03:19:46 +09:00
Hajime Hoshi
202f642395 internal/graphicsdriver: bug fix: render semi-transparent vectors correctly
Closes #1933
2022-01-06 03:00:25 +09:00
Hajime Hoshi
00e2b15e2a shaderir: Bug fix: A wrong argument for fmt.Sprintf
This change also improves the result of espcae analysis.

Closes #1863
2021-11-02 00:05:07 +09:00
Hajime Hoshi
b74a4a0275 internal/graphicsdriver/opengl: Optimization: Avoid heap allocations 2021-10-31 02:10:44 +09:00
Hajime Hoshi
a082db04fd internal/jsutil: Optimization: Avoid using empty interface{} conversions 2021-10-30 18:53:21 +09:00
Hajime Hoshi
a826ecb29b internal/jsutil: Move a function to internal/graphicsdriver/opengl 2021-10-30 18:33:43 +09:00
Hajime Hoshi
3f5d1762bb internal/graphicsdriver/opengl: Return an error when initializing OpenGL fails
Updates #1838
2021-10-06 00:38:47 +09:00
Hajime Hoshi
6c8a7d1079 internal/graphicsdriver/opengl: Bug fix: A location cache map must be reset when a program is deleted
Closes #1753
2021-08-15 04:54:20 +09:00
Hajime Hoshi
8967384dac internal/graphicsdriver: Bug fix: getting a WebGL2 context might fail even though WebGL2RenderingContext exists
Closes #1738
2021-08-01 22:00:47 +09:00
Hajime Hoshi
50d2d7ed61 internal/graphicsdriver/opengl: Remove unused code using PBO
Updates #1678
2021-07-14 21:51:27 +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
b466a0cbd7 ebiten: Add EvenOdd to DrawTrianglesOptions and DrawShaderTrianglesOptions
Updates #844
Closes #1684
2021-07-05 03:35:55 +09:00
Hajime Hoshi
269ea7c489 internal/graphicsdriver/opengl: Refactoring: Reorder functions
glPixelStorei affects the result of glTexImage2D. This change makes
this fact more explicit.
2021-07-03 02:09:47 +09:00
Hajime Hoshi
8ff42f55a1 internal/graphicsdriver/opengl: Give up restorign on browsers
Using restorable images is expensive as this sometimes requires to
load pixels from GPU. On browsers, just reloading the application
should be fine when the context lost happens.

Closes #1603
2021-06-26 16:54:21 +09:00
Hajime Hoshi
2a8e8d0eb6 internal/graphicsdriver/opengl: Stop using PBO
PBO was introduced to improve the performance at ReplacePixels,
but we found that PBO can degrades the performance. Also, now
multiple glTexImage2Ds are called successively like a batch, so
the situation is now different from that time when PBO was
introduced.

Let's remove PBO usages and wait and see.

Closes #1678
2021-06-24 21:20:58 +09:00
Hajime Hoshi
7f60cd41eb internal/graphicsdriver/opengl: Refactoring: Remove unused arguments from texSubImage2D 2021-06-24 12:06:28 +09:00
Hajime Hoshi
a627c41217 Remove support of Go 1.13 and Go 1.14
Updates #1258
Updates #1415
Updates #1462
2021-06-07 21:44:22 +09:00
Hajime Hoshi
6fe6543b4b internal/graphicsdriver/opengl: Bug fix: getBufferSubData was available only with WebGL2 2021-04-06 00:11:51 +09:00
Hajime Hoshi
bd8367588e internal/graphicsdriver/opengl: Prepare function objects by bind
Passing a Go string to the JS world is expensive. This change reduces
this cost by preparing function objects by bind.

Closes #1438
2021-04-05 23:53:21 +09:00
Hajime Hoshi
f77c514598 graphicsdriver/opengl: Refactoring 2021-01-05 02:07:30 +09:00
Hajime Hoshi
b7abde7f00 graphicsdriver/opengl: Bug fix: getBufferSubData did not work correctly on JS 2021-01-03 19:44:29 +09:00