28package com.jogamp.opengl.test.junit.newt;
30import com.jogamp.nativewindow.WindowClosingProtocol;
31import com.jogamp.opengl.GLAutoDrawable;
32import com.jogamp.opengl.GLCapabilities;
33import com.jogamp.opengl.GLEventListener;
34import com.jogamp.opengl.GLProfile;
36import com.jogamp.newt.event.WindowEvent;
37import com.jogamp.newt.event.WindowAdapter;
38import com.jogamp.newt.opengl.GLWindow;
39import com.jogamp.opengl.test.junit.util.MiscUtils;
40import com.jogamp.opengl.util.Animator;
53 public static void main(
final String[] args) {
56 for(
int i=0; i<args.length; i++) {
57 if(args[i].equals(
"-close")) {
61 System.err.println(
"Close Mode: "+closeMode);
69 animator.
add(glWindow);
72 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
73 System.out.println(
"GLEventListener.reshape");
78 System.out.println(
"GLEventListener.init");
83 System.out.println(
"GLEventListener.dispose");
99 public void windowDestroyNotify(
final WindowEvent e) {
100 System.out.println(
"GLWindow.destroyNotify");
105 System.out.println(
"GLWindow.destroyed");
112 switch( closeMode ) {
132 static void sleep1s() {
135 }
catch (
final InterruptedException e) {
void setBackgroundOpaque(final boolean opaque)
Sets whether the surface shall be opaque or translucent.
NEWT Window events are provided for notification purposes ONLY.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op)
final void setPointerVisible(final boolean mouseVisible)
Makes the pointer visible or invisible.
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 boolean setFullscreen(final boolean fullscreen)
Enable or disable fullscreen mode for this window.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
final void setUndecorated(final boolean value)
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 setDoubleBuffered(final boolean enable)
Enables or disables double buffering.
void setDepthBits(final int depthBits)
Sets the number of bits requested for the depth buffer.
Specifies the the OpenGL profile.
static GLProfile getMaxProgrammable(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
Returns the highest profile, implementing the programmable shader pipeline.
Manual test case validating closing behavior.
static void main(final String[] args)
static int atoi(final String str, final int def)
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
Window closing mode if triggered by toolkit close operation.
DISPOSE_ON_CLOSE
Dispose resources on native window close operation.
Protocol for handling window closing events.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.