use of com.jogamp.newt.opengl.GLWindow in project narchy by automenta.
the class WindowToggleButton method value.
@Override
public void value(ToggleButton t, boolean enabled) {
if (enabled) {
JoglSpace space;
synchronized (spacer) {
space = this.space;
if (space == null) {
space = this.space = SpaceGraph.window(spacer.get(), width, height);
space.addWindowListener(this);
}
}
int sx = Finger.pointer.getX();
int sy = Finger.pointer.getY();
int nx = sx - width / 2;
int ny = sy - height / 2;
space.window.setPosition(nx, ny);
// space.show(this.toString(), width,height, nx, ny);
// space.window.setTitle(label.value());
} else {
synchronized (spacer) {
if (space != null) {
GLWindow win = this.space.window;
this.space = null;
if (win.getWindowHandle() != 0)
win.destroy();
}
}
}
}
use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.
the class PhysicsTest3 method main.
/**
* Main
* @param args
*/
public static void main(String[] args) {
Logger.getLogger("").setLevel(Level.WARNING);
// create GL canvas
GLProfile glp = Engine.getProfile();
GLCapabilities caps = new GLCapabilities(glp);
// create GL window
GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle("PhysicsTest3");
// animator
FPSAnimator animator = new FPSAnimator(glWindow, 60);
// tdme level editor
PhysicsTest3 physicsTest3 = new PhysicsTest3();
// GL Window
glWindow.addGLEventListener(physicsTest3);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
glWindow.addKeyListener(physicsTest3);
glWindow.addMouseListener(physicsTest3);
glWindow.addWindowListener(physicsTest3);
// start animator
animator.setUpdateFPSFrames(3, null);
animator.start();
}
use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.
the class TDMEParticleSystem method main.
/**
* @param args
*/
public static void main(String[] args) {
//
Console.println("TDMEParticleSystem " + VERSION);
Console.println("Programmed 2017 by Andreas Drewke, drewke.net.");
Console.println();
// no nifty logging
Logger.getLogger("").setLevel(Level.SEVERE);
// create GL caps
GLProfile glp = Engine.getProfile();
GLCapabilities caps = new GLCapabilities(glp);
Console.println(glp);
Console.println(caps);
// create GL window
GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle("TDMEParticleSystem " + VERSION);
// animator
FPSAnimator animator = new FPSAnimator(glWindow, 60);
// tdme particle system
TDMEParticleSystem tdmeLevelEditor = new TDMEParticleSystem(glWindow, animator);
// GL Window
glWindow.addWindowListener(tdmeLevelEditor);
glWindow.addGLEventListener(tdmeLevelEditor);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
// start animator
animator.start();
}
use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.
the class TDMEViewer method main.
/**
* @param args
*/
public static void main(String[] args) {
String modelFileName = null;
//
Console.println("TDMEViewer " + VERSION);
Console.println("Programmed 2014,...,2017 by Andreas Drewke, drewke.net.");
Console.println();
// no nifty logging
Logger.getLogger("").setLevel(Level.SEVERE);
// create GL caps
GLProfile glp = Engine.getProfile();
GLCapabilities caps = new GLCapabilities(glp);
Console.println(glp);
Console.println(caps);
// create GL window
GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle("TDMEViewer " + VERSION);
// animator
FPSAnimator animator = new FPSAnimator(glWindow, 60);
// tdme level editor
TDMEViewer tdmeLevelEditor = new TDMEViewer(glWindow, animator, modelFileName);
// GL Window
glWindow.addWindowListener(tdmeLevelEditor);
glWindow.addGLEventListener(tdmeLevelEditor);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
// start animator
animator.start();
}
Aggregations