diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java index 7dae20f80..c1388db8a 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,20 +29,27 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ package jogamp.opengl.x11.glx; -import javax.media.nativewindow.*; -import javax.media.opengl.*; -import jogamp.nativewindow.x11.*; +import javax.media.nativewindow.AbstractGraphicsDevice; +import javax.media.nativewindow.AbstractGraphicsScreen; +import javax.media.nativewindow.NativeSurface; +import javax.media.nativewindow.MutableSurface; +import javax.media.opengl.GLContext; +import javax.media.opengl.GLDrawableFactory; +import javax.media.opengl.GLException; + +import jogamp.nativewindow.x11.X11Lib; +import jogamp.nativewindow.x11.XVisualInfo; public class X11PixmapGLXDrawable extends X11GLXDrawable { private long pixmap; @@ -51,10 +58,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable { super(factory, target, false); } - protected void destroyImpl() { - setRealized(false); - } - + @Override protected void setRealizedImpl() { if(realized) { createPixmap(); @@ -63,10 +67,11 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable { } } + @Override public GLContext createContext(GLContext shareWith) { - return new X11PixmapGLXContext(this, shareWith); + return new X11GLXContext(this, shareWith); } - + private void createPixmap() { NativeSurface ns = getNativeSurface(); X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration(); @@ -88,9 +93,9 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable { pixmap = 0; throw new GLException("glXCreateGLXPixmap failed"); } - ((SurfaceChangeable)ns).setSurfaceHandle(drawable); + ((MutableSurface)ns).setSurfaceHandle(drawable); if (DEBUG) { - System.err.println("Created pixmap " + toHexString(pixmap) + + System.err.println(getThreadName()+": Created pixmap " + toHexString(pixmap) + ", GLXPixmap " + toHexString(drawable) + ", display " + toHexString(dpy)); } @@ -104,7 +109,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable { long drawable = ns.getSurfaceHandle(); if (DEBUG) { - System.err.println("Destroying pixmap " + toHexString(pixmap) + + System.err.println(getThreadName()+": Destroying pixmap " + toHexString(pixmap) + ", GLXPixmap " + toHexString(drawable) + ", display " + toHexString(display)); } @@ -128,7 +133,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable { X11Lib.XFreePixmap(display, pixmap); drawable = 0; pixmap = 0; - ((SurfaceChangeable)ns).setSurfaceHandle(0); + ((MutableSurface)ns).setSurfaceHandle(0); display = 0; } } |