aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-13 02:47:14 +0200
committerSven Gothel <[email protected]>2023-08-13 02:47:14 +0200
commit76698d1923ccd9c7f22fe8500c6c4531c2d0c3ae (patch)
treef528d9387738c938505602cf76b98e466b834ad6 /src/graphui/classes
parent2aa80761ace63492c859632317a47cdcc8cfae5f (diff)
Texture ctor w/ external textureID: Pass `ownsTextureID` where true hands over ownership and allows destroy() to delete it, otherwise not. Fixes GraphUI's GLButton.
GraphUI's GLButton uses the offscreen's FBO texture and hence can't pass over ownership of the texture. Hence the Texture instance is created w/o handing over ownership! GLMediaPlayerImpl does hand over ownership of the generated and passed texture to the Texture ctor.
Diffstat (limited to 'src/graphui/classes')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
index 57af3587c..a8d7c4295 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
@@ -138,9 +138,11 @@ public class GLButton extends TexSeqButton {
fboGLAD.display(); // 1st init!
final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
- final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(),
- fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
- false /* mustFlipVertically */);
+ final Texture tex = new Texture(texA01.getName(), false /* ownsTextureID */,
+ imgSeq.getTextureTarget(),
+ fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
+ fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
+ false /* mustFlipVertically */);
imgSeq.addFrame(gl, tex);
markStateDirty();
} else if( 0 != fboWidth*fboHeight ) {
@@ -157,9 +159,11 @@ public class GLButton extends TexSeqButton {
imgSeq.destroy(gl);
final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
- final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(),
- fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
- false /* mustFlipVertically */);
+ final Texture tex = new Texture(texA01.getName(), false /* ownsTextureID */,
+ imgSeq.getTextureTarget(),
+ fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
+ fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
+ false /* mustFlipVertically */);
imgSeq.addFrame(gl, tex);
fboWidth = 0;
fboHeight = 0;