本文整理汇总了Java中com.jogamp.newt.event.WindowAdapter类的典型用法代码示例。如果您正苦于以下问题:Java WindowAdapter类的具体用法?Java WindowAdapter怎么用?Java WindowAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WindowAdapter类属于com.jogamp.newt.event包,在下文中一共展示了WindowAdapter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
public static void main(String[] args) {
GLProfile glp = GLProfile.get("GL3");
GLCapabilities caps = new GLCapabilities(glp);
GLWindow glWindow = GLWindow.create(caps);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
glWindow.addWindowListener(new WindowAdapter() {
public void windowDestroyNotify(WindowEvent e) {
System.exit(0);
}
});
FPSAnimator animator = new FPSAnimator(glWindow, 60);
animator.start();
}
示例2: setup
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (enhanced)");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例3: createWindow
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
@Override
public Object createWindow(GLCapabilities caps, int width, int height) {
final Animator animator;
setAutoDrawable(glWin = GLWindow.create(caps));
setAnimator(animator = new Animator(glWin));
glWin.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyNotify(WindowEvent e) {
animator.stop();
glWin.setVisible(false);
// prevent jogl babbling about unimportant stuff
System.err.close();
System.exit(0);
}
});
glWin.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
glWin.setSize(width, height);
glWin.setTitle("bGLOOP");
return glWin;
}
示例4: setup
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (enhanced)");
window.setSize(1024, 768);
window.addGLEventListener(this);
window.addKeyListener(this);
window.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
window.setVisible(true);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例5: setup
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Globe");
window.setSize(1024, 768);
window.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例6: setup
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Texture");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator();
animator.add(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例7: setup
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
private void setup() {
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
window = GLWindow.create(glCapabilities);
window.setTitle("Hello Triangle (simple)");
window.setSize(1024, 768);
window.setVisible(true);
window.addGLEventListener(this);
window.addKeyListener(this);
animator = new Animator(window);
animator.start();
window.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyed(WindowEvent e) {
animator.stop();
System.exit(1);
}
});
}
示例8: main
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
public static void main(final String[] args) {
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
System.out.println("Requested: " + caps);
final GLWindow window = GLWindow.create(caps);
window.setPosition(10, 10);
window.setSize(800, 400);
window.setTitle("GPU UI Newt Demo 01");
final RenderState rs = RenderState.createRenderState(SVertex.factory());
final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
uiGLListener.attachInputListenerTo(window);
window.addGLEventListener(uiGLListener);
window.setVisible(true);
final Animator animator = new Animator();
animator.setUpdateFPSFrames(60, System.err);
animator.add(window);
window.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_F4) {
window.destroy();
}
}
});
window.addWindowListener(new WindowAdapter() {
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
animator.start();
}
示例9: addWindowListener
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
@Override
public void addWindowListener(final WindowAdapter pWindowAdapter) {
mGlWindow.addWindowListener(pWindowAdapter);
}
示例10: initGL
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
/**
* Initialise the JOGL Window
*/
private void initGL()
{
// Get the OpenGL profile and its capabilities.
// Tries to get OpenGL 3
final GLProfile glp = GLProfile.get( GLProfile.GL2 );
final GLCapabilities caps = new GLCapabilities( glp );
// Get the display
final Display dpy = NewtFactory.createDisplay( null );
// Get the screen on the display (defaults to the first screen)
final Screen screen = NewtFactory.createScreen( dpy, this.screenIdx );
// Create a window
this.glWindow = GLWindow.create( screen, caps );
// Set the size and position of the window
this.glWindow.setSize( this.width, this.height );
if( null != this.wpos ) this.glWindow.setPosition( this.wpos.getX(), this.wpos.getY() );
// Set the properties of the window
this.glWindow.setUndecorated( this.undecorated );
this.glWindow.setAlwaysOnTop( this.alwaysOnTop );
this.glWindow.setFullscreen( this.fullscreen );
this.glWindow.setPointerVisible( this.mouseVisible );
this.glWindow.confinePointer( this.mouseConfined );
// Add a listener to kill the app once the window is closed
this.glWindow.addWindowListener( new WindowAdapter()
{
@Override
public void windowDestroyNotify(final WindowEvent e)
{
System.exit(1);
};
} );
// Show the window
this.glWindow.setVisible( true );
}
示例11: main
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
public static void main(final String[] args) {
int width = 800, height = 400;
int x = 10, y = 10;
boolean forceES2 = false;
boolean forceES3 = false;
boolean forceGL3 = false;
boolean forceGLDef = false;
System.err.println("forceES2 "+forceES2);
System.err.println("forceES3 "+forceES3);
System.err.println("forceGL3 "+forceGL3);
System.err.println("forceGLDef "+forceGLDef);
System.err.println("Desired win size "+width+"x"+height);
System.err.println("Desired win pos "+x+"/"+y);
System.err.println("Scene MSAA Samples "+SceneMSAASamples);
System.err.println("Graph MSAA Mode "+GraphMSAAMode);
System.err.println("Graph VBAA Mode "+GraphVBAAMode);
System.err.println("Graph Auto Mode "+GraphAutoMode+" no-AA dpi threshold");
final GLProfile glp;
if(forceGLDef) {
glp = GLProfile.getDefault();
} else if(forceGL3) {
glp = GLProfile.get(GLProfile.GL3);
} else if(forceES3) {
glp = GLProfile.get(GLProfile.GLES3);
} else if(forceES2) {
glp = GLProfile.get(GLProfile.GLES2);
} else {
glp = GLProfile.getGL2ES2();
}
System.err.println("GLProfile: "+glp);
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( SceneMSAASamples > 0 ) {
caps.setSampleBuffers(true);
caps.setNumSamples(SceneMSAASamples);
}
System.out.println("Requested: " + caps);
final int rmode;
if( GraphVBAAMode ) {
rmode = Region.VBAA_RENDERING_BIT;
} else if( GraphMSAAMode ) {
rmode = Region.MSAA_RENDERING_BIT;
} else {
rmode = 0;
}
final GLWindow window = GLWindow.create(caps);
window.setPosition(x, y);
window.setSize(width, height);
window.setTitle("GraphUI Newt Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
window.setSurfaceScale(reqSurfacePixelScale);
final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]);
final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);
window.addGLEventListener(sceneGLListener);
sceneGLListener.attachInputListenerTo(window);
final Animator animator = new Animator();
animator.setUpdateFPSFrames(60, System.err);
animator.add(window);
window.addWindowListener(new WindowAdapter() {
public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
window.setVisible(true);
animator.start();
}
示例12: addWindowListener
import com.jogamp.newt.event.WindowAdapter; //导入依赖的package包/类
public void addWindowListener(WindowAdapter pWindowAdapter);