Search in sources :

Example 11 with GLWindow

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();
            }
        }
    }
}
Also used : JoglSpace(spacegraph.video.JoglSpace) GLWindow(com.jogamp.newt.opengl.GLWindow)

Example 12 with GLWindow

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();
}
Also used : FPSAnimator(com.jogamp.opengl.util.FPSAnimator) GLCapabilities(com.jogamp.opengl.GLCapabilities) GLWindow(com.jogamp.newt.opengl.GLWindow) GLProfile(com.jogamp.opengl.GLProfile)

Example 13 with GLWindow

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();
}
Also used : FPSAnimator(com.jogamp.opengl.util.FPSAnimator) GLCapabilities(com.jogamp.opengl.GLCapabilities) GLWindow(com.jogamp.newt.opengl.GLWindow) GLProfile(com.jogamp.opengl.GLProfile)

Example 14 with GLWindow

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();
}
Also used : FPSAnimator(com.jogamp.opengl.util.FPSAnimator) GLCapabilities(com.jogamp.opengl.GLCapabilities) GLWindow(com.jogamp.newt.opengl.GLWindow) GLProfile(com.jogamp.opengl.GLProfile)

Aggregations

GLWindow (com.jogamp.newt.opengl.GLWindow)14 GLCapabilities (com.jogamp.opengl.GLCapabilities)8 GLProfile (com.jogamp.opengl.GLProfile)8 FPSAnimator (com.jogamp.opengl.util.FPSAnimator)8 Point (com.jogamp.nativewindow.util.Point)1 WindowAdapter (com.jogamp.newt.event.WindowAdapter)1 Animator (com.jogamp.opengl.util.Animator)1 JoglSpace (spacegraph.video.JoglSpace)1