29package com.jogamp.opengl.test.junit.jogl.glu;
32import java.nio.ByteBuffer;
34import com.jogamp.opengl.GL;
35import com.jogamp.opengl.GLAutoDrawable;
36import com.jogamp.opengl.GLCapabilities;
37import com.jogamp.opengl.GLEventListener;
38import com.jogamp.opengl.GLProfile;
39import com.jogamp.opengl.awt.GLCanvas;
40import com.jogamp.opengl.glu.gl2es1.GLUgl2es1;
42import org.junit.Assume;
44import org.junit.FixMethodOrder;
45import org.junit.runners.MethodSorters;
47import com.jogamp.opengl.test.junit.util.UITestCase;
57@FixMethodOrder(MethodSorters.NAME_ASCENDING)
66 final int widthin = 559;
67 final int heightin = 425;
69 final int widthout = 1024;
70 final int heightout = 512;
72 final int textureInLength = widthin * heightin * 4;
73 final int textureOutLength = widthout * heightout * 4;
75 final byte[] datain =
new byte[textureInLength];
76 final byte[] dataout =
new byte[textureOutLength];
78 final ByteBuffer bufferIn = ByteBuffer.wrap(datain);
79 final ByteBuffer bufferOut = ByteBuffer.wrap(dataout);
88 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
97 public void test01() throws InterruptedException {
103 final Frame frame =
new Frame(
"Test");
105 frame.setSize(256, 256);
109 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
111 frame.setVisible(
true);
113 }
catch (
final Throwable t) {
115 Assume.assumeNoException(t);
123 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
125 frame.setVisible(
false);
126 frame.remove(canvas);
129 }
catch (
final Throwable t) {
131 Assume.assumeNoException(t);
135 public static void main(
final String args[]) {
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static GLProfile getGL2ES1(final AbstractGraphicsDevice device)
Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.
A heavyweight AWT component which provides OpenGL rendering support.
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
final int gluScaleImage(int format, int widthin, int heightin, int typein, java.nio.Buffer datain, int widthout, int heightout, int typeout, java.nio.Buffer dataout)
Optional, throws GLException if not available in profile.
Tests for bug 463, where gluScaleImage uses up all system memory.
static void main(final String args[])
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
Called by the drawable during the first repaint after the component has been resized.
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
static final int GL_RGBA
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_RGBA" with expression...
static final int GL_UNSIGNED_BYTE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_UNSIGNED_BYTE" with e...