41package com.jogamp.opengl.test.junit.jogl.caps;
43import com.jogamp.opengl.GLAutoDrawable;
44import com.jogamp.opengl.GLCapabilities;
45import com.jogamp.opengl.GLCapabilitiesChooser;
46import com.jogamp.opengl.GLEventListener;
47import com.jogamp.opengl.GLProfile;
50import org.junit.FixMethodOrder;
51import org.junit.runners.MethodSorters;
53import com.jogamp.newt.opengl.GLWindow;
54import com.jogamp.opengl.test.junit.jogl.demos.es1.MultisampleDemoES1;
55import com.jogamp.opengl.test.junit.util.MiscUtils;
56import com.jogamp.opengl.test.junit.util.UITestCase;
57import com.jogamp.opengl.util.GLReadBufferUtil;
58import com.jogamp.opengl.util.texture.TextureIO;
60@FixMethodOrder(MethodSorters.NAME_ASCENDING)
62 static long durationPerTest = 60;
65 public static void main(
final String[] args) {
66 for(
int i=0; i<args.length; i++) {
67 if(args[i].equals(
"-time")) {
71 System.out.println(
"durationPerTest: "+durationPerTest);
73 org.junit.runner.JUnitCore.
main(tstname);
78 testMultiSampleAAImpl(
false,
false, 0);
83 testMultiSampleAAImpl(
false,
false, 2);
88 testMultiSampleAAImpl(
false,
false, 4);
93 testMultiSampleAAImpl(
false,
false, 8);
98 testMultiSampleAAImpl(
false,
true, 0);
103 testMultiSampleAAImpl(
false,
true, 8);
108 testMultiSampleAAImpl(
true,
false, 0);
113 testMultiSampleAAImpl(
true,
false, 8);
116 private void testMultiSampleAAImpl(
final boolean useFBO,
final boolean usePBuffer,
final int reqSamples)
throws InterruptedException {
131 window = GLWindow.
create(caps);
135 int displayCount = 0;
139 snapshot(displayCount++,
null, drawable.
getGL(), screenshot, TextureIO.PNG,
null);
141 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) { }
147 Thread.sleep(durationPerTest);
void setAlphaBits(final int alphaBits)
Sets the number of bits requested for the color buffer's alpha component.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
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.
CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser)
Set the CapabilitiesChooser to help determine the native visual type.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
final void requestFocus()
Request focus for this native window.
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.
void setFBO(final boolean enable)
Requesting offscreen FBO mode.
void setNumSamples(final int numSamples)
If sample buffers are enabled, indicates the number of buffers to be allocated.
void setSampleBuffers(final boolean enable)
Defaults to false.
Specifies the the OpenGL profile.
static GLProfile getMaxFixedFunc(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
Returns the highest profile, implementing the fixed function pipeline.
void testOnscreenMultiSampleAA0()
void testOnscreenMultiSampleAA4()
void testOnscreenMultiSampleAA2()
void testOffscreenPBufferMultiSampleAA0()
void testOffsreenPBufferMultiSampleAA8()
static void main(final String[] args)
void testOffsreenFBOMultiSampleAA8()
void testOnscreenMultiSampleAA8()
void testOffscreenFBOMultiSampleAA0()
static int atoi(final String str, final int def)
Utility to read out the current FB to TextureData, optionally writing the data back to a texture obje...
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Provides a mechanism by which applications can customize the window type selection for a given GLCapa...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.