1package com.jogamp.opengl.test.junit.jogl.acore;
3import jogamp.nativewindow.x11.X11Util;
5import org.junit.Assert;
7import org.junit.FixMethodOrder;
8import org.junit.runners.MethodSorters;
10import com.jogamp.newt.opengl.GLWindow;
12import com.jogamp.nativewindow.NativeWindowFactory;
13import com.jogamp.opengl.DefaultGLCapabilitiesChooser;
14import com.jogamp.opengl.GLAutoDrawable;
15import com.jogamp.opengl.GLCapabilities;
16import com.jogamp.opengl.GLCapabilitiesImmutable;
17import com.jogamp.opengl.GLDrawableFactory;
18import com.jogamp.opengl.GLOffscreenAutoDrawable;
19import com.jogamp.opengl.GLProfile;
24@FixMethodOrder(MethodSorters.NAME_ASCENDING)
31 for (
int j = 0; j < 10; j++ ) {
34 open0 = X11Util.getOpenDisplayConnectionNumber();
42 window.
setTitle(
"NEWT Resource X11 Leak - #" + j );
50 final int openD = X11Util.getOpenDisplayConnectionNumber() - open0;
52 X11Util.dumpOpenDisplayConnections();
53 X11Util.dumpPendingDisplayConnections();
54 Assert.assertEquals(
"New display connection didn't close", 0, openD);
59 catch (
final Exception e ) {
61 Assert.fail(e.getMessage());
70 for (
int j = 0; j < 10; j++ ) {
73 open0 = X11Util.getOpenDisplayConnectionNumber();
85 final int openD = X11Util.getOpenDisplayConnectionNumber() - open0;
87 X11Util.dumpOpenDisplayConnections();
88 X11Util.dumpPendingDisplayConnections();
89 Assert.assertEquals(
"New display connection didn't close", 0, openD);
94 catch (
final Exception e ) {
96 Assert.fail(e.getMessage());
104 for (
int j = 0; j < 10; j++ ) {
107 open0 = X11Util.getOpenDisplayConnectionNumber();
121 final int openD = X11Util.getOpenDisplayConnectionNumber() - open0;
123 X11Util.dumpOpenDisplayConnections();
124 X11Util.dumpPendingDisplayConnections();
125 Assert.assertEquals(
"New display connection didn't close", 0, openD);
130 catch (
final Exception e ) {
132 Assert.fail(e.getMessage());
136 public static void main(
final String args[]) {
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeW...
static final String TYPE_X11
X11 type, as retrieved with getNativeWindowType(boolean).
static String getNativeWindowType(final boolean useCustom)
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
void setPBuffer(final boolean enable)
Requesting offscreen pbuffer mode.
abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, GLCapabilitiesChooser chooser, int width, int height)
Creates a realized GLOffscreenAutoDrawable incl it's offscreen NativeSurface with the given capabilit...
static GLDrawableFactory getFactory(final GLProfile glProfile)
Returns the sole GLDrawableFactory instance.
Specifies the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static void initSingleton()
Static initialization of JOGL.
Tests the closing the device of GLWindow and off-screen GLAutoDrawable using FBO and PBuffer in JOGL.
void test01X11WindowMemoryLeak()
void test03X11WindowMemoryLeakFBOAutoDrawable()
void test02X11WindowMemoryLeakPBufferAutoDrawable()
static void main(final String args[])
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
Specifies an immutable set of OpenGL capabilities.
Platform-independent GLAutoDrawable specialization, exposing offscreen functionality.