private void createPbuffer() { final MutableSurface ms = (MutableSurface) getNativeSurface(); final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ms.getGraphicsConfiguration(); final AbstractGraphicsScreen aScreen = config.getScreen(); final AbstractGraphicsDevice aDevice = aScreen.getDevice(); iattributes.put(niattribs++, ms.getSurfaceWidth()); iattributes.put(niattribs++, GLX.GLX_PBUFFER_HEIGHT); iattributes.put(niattribs++, ms.getSurfaceHeight()); ms.setSurfaceHandle(pbuffer);
protected void destroyPbuffer() { final MutableSurface ms = (MutableSurface) getNativeSurface(); final long pBuffer = ms.getSurfaceHandle(); if (0 != pBuffer) { synchronized (createdContexts) { for(int i=0; i<createdContexts.size(); ) { final WeakReference<MacOSXCGLContext> ref = createdContexts.get(i); final MacOSXCGLContext ctx = ref.get(); if (ctx != null) { ctx.detachPBuffer(); i++; } else { createdContexts.remove(i); } } } impl.destroy(pBuffer); ms.setSurfaceHandle(0); } }
protected void destroyPbuffer() { final NativeSurface ns = getNativeSurface(); if (ns.getSurfaceHandle() != 0) { GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle()); } ((MutableSurface)ns).setSurfaceHandle(0); if (DEBUG) { System.err.println(getThreadName()+": Destroyed pbuffer " + this); } }
private void createPbuffer() { final MutableSurface ms = (MutableSurface) getNativeSurface(); final DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) ms.getGraphicsConfiguration(); final MacOSXCGLDrawableFactory.SharedResource sr = ((MacOSXCGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice()); ms.setSurfaceHandle(pBuffer);
protected void destroyBitmap() { final NativeSurface ns = getNativeSurface(); if (ns.getSurfaceHandle() != 0) { // Must destroy bitmap and device context GDI.SelectObject(ns.getSurfaceHandle(), origbitmap); GDI.DeleteObject(hbitmap); GDI.DeleteDC(ns.getSurfaceHandle()); origbitmap = 0; hbitmap = 0; ((MutableSurface)ns).setSurfaceHandle(0); } } }
drawable = 0; pixmap = 0; ((MutableSurface)ns).setSurfaceHandle(0); display = 0;
protected void destroyPbuffer() { final NativeSurface ns = getNativeSurface(); if(0!=buffer) { final WGLExt wglExt = cachedWGLExt; if (ns.getSurfaceHandle() != 0) { // Must release DC and pbuffer // NOTE that since the context is not current, glGetError() can // not be called here, so we skip the use of any composable // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl) if (wglExt.wglReleasePbufferDCARB(buffer, ns.getSurfaceHandle()) == 0) { throw new GLException("Error releasing pbuffer device context: error code " + GDI.GetLastError()); } ((MutableSurface)ns).setSurfaceHandle(0); } if (!wglExt.wglDestroyPbufferARB(buffer)) { throw new GLException("Error destroying pbuffer: error code " + GDI.GetLastError()); } buffer = 0; } }
((MutableSurface)ns).setSurfaceHandle(tmpHdc); cachedWGLExt = wglExt;
private void createPixmap() { final NativeSurface ns = getNativeSurface(); final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration(); final XVisualInfo vis = config.getXVisualInfo(); final int bitsPerPixel = vis.getDepth(); final AbstractGraphicsScreen aScreen = config.getScreen(); final AbstractGraphicsDevice aDevice = aScreen.getDevice(); final long dpy = aDevice.getHandle(); final int screen = aScreen.getIndex(); pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen), surface.getSurfaceWidth(), surface.getSurfaceHeight(), bitsPerPixel); if (pixmap == 0) { throw new GLException("XCreatePixmap failed"); } final long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap); if (drawable == 0) { X11Lib.XFreePixmap(dpy, pixmap); pixmap = 0; throw new GLException("glXCreateGLXPixmap failed"); } ((MutableSurface)ns).setSurfaceHandle(drawable); if (DEBUG) { System.err.println(getThreadName()+": Created pixmap " + toHexString(pixmap) + ", GLXPixmap " + toHexString(drawable) + ", display " + toHexString(dpy)); } }
throw new GLException("Error creating device context for offscreen OpenGL context, werr "+werr); ((MutableSurface)ns).setSurfaceHandle(hdc); if(DEBUG) { System.err.println(getThreadName()+": WindowsBitmapWGLDrawable (2): "+ns);