aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
index 09dbbeee6..b1ae3550a 100644
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
@@ -46,7 +46,6 @@ import com.sun.opengl.impl.*;
import com.sun.nativewindow.impl.NullWindow;
public class EGLPbufferDrawable extends EGLDrawable {
- private int width, height;
private int texFormat;
protected static final boolean useTexture = false; // No yet ..
@@ -63,8 +62,6 @@ public class EGLPbufferDrawable extends EGLDrawable {
// get choosen ones ..
caps = (GLCapabilities) getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
- this.width=width;
- this.height=height;
if(useTexture) {
this.texFormat = caps.getAlphaBits() > 0 ? EGL.EGL_TEXTURE_RGBA : EGL.EGL_TEXTURE_RGB ;
} else {
@@ -110,13 +107,15 @@ public class EGLPbufferDrawable extends EGLDrawable {
}
protected long createSurface(long eglDpy, _EGLConfig eglNativeCfg, long surfaceHandle) {
- int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(width, height, texFormat);
+ NullWindow nw = (NullWindow) getNativeWindow();
+ int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(nw.getWidth(), nw.getHeight(), texFormat);
long surf = EGL.eglCreatePbufferSurface(eglDpy, eglNativeCfg, attrs, 0);
if (EGL.EGL_NO_SURFACE==surf) {
- throw new GLException("Creation of window surface (eglCreatePbufferSurface) failed, dim "+width+"x"+height+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ throw new GLException("Creation of window surface (eglCreatePbufferSurface) failed, dim "+nw.getWidth()+"x"+nw.getHeight()+", error 0x"+Integer.toHexString(EGL.eglGetError()));
} else if(DEBUG) {
System.err.println("setSurface result: eglSurface 0x"+Long.toHexString(surf));
}
+ nw.setSurfaceHandle(surf);
return surf;
}