aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/x11
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-06 04:47:08 +0100
committerSven Gothel <[email protected]>2011-11-06 04:47:08 +0100
commit7dff8e2e043bb5e7606b041f8d4b4ae7c1579085 (patch)
tree48d52d06b49912a7cd3643d73d34f31205f2bd49 /src/jogl/classes/jogamp/opengl/x11
parentccb7213cdcef177eabf7538b7c0d1c3e34915640 (diff)
JOGL/Offscreen-Drawable: Use setRealized(boolean) protocol for offscreen/pbuffer
This allows allowing updateHandle()/destroyHandle() to be called.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11')
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java16
2 files changed, 18 insertions, 10 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
index 8ea989267..8c276c097 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
@@ -48,24 +48,28 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
/* GLCapabilities caps,
GLCapabilitiesChooser chooser,
int width, int height */
- super(factory, target, true);
+ super(factory, target, false);
if (DEBUG) {
System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
}
- createPbuffer();
+ setRealized(true);
if (DEBUG) {
System.err.println("Created pbuffer " + this);
}
}
+ protected void destroyImpl() {
+ setRealized(false);
+ }
+
protected void setRealizedImpl() {
if(realized) {
createPbuffer();
} else {
- destroyImpl();
+ destroyPbuffer();
}
}
@@ -73,7 +77,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
return new X11PbufferGLXContext(this, shareWith);
}
- protected void destroyImpl() {
+ protected void destroyPbuffer() {
NativeSurface ns = getNativeSurface();
if (ns.getSurfaceHandle() != 0) {
GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
index f5d321561..486196856 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
@@ -48,15 +48,19 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
private long pixmap;
protected X11PixmapGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
- super(factory, target, true);
- create();
+ super(factory, target, false);
+ setRealized(true);
}
+ protected void destroyImpl() {
+ setRealized(false);
+ }
+
protected void setRealizedImpl() {
if(realized) {
- create();
+ createPixmap();
} else {
- destroyImpl();
+ destroyPixmap();
}
}
@@ -64,7 +68,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
return new X11PixmapGLXContext(this, shareWith);
}
- private void create() {
+ private void createPixmap() {
NativeSurface ns = getNativeSurface();
X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
XVisualInfo vis = config.getXVisualInfo();
@@ -93,7 +97,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
}
}
- protected void destroyImpl() {
+ protected void destroyPixmap() {
if (pixmap == 0) return;
NativeSurface ns = getNativeSurface();