Search in sources :

Example 6 with GLWindow

use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.

the class TDMELevelEditor method main.

/**
 * @param args
 */
public static void main(String[] args) {
    String modelFileName = null;
    // 
    Console.println("TDMELevelEditor " + 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("TDMELevelEditor " + VERSION);
    // animator
    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    // tdme level editor
    TDMELevelEditor tdmeLevelEditor = new TDMELevelEditor(glWindow, animator, modelFileName);
    // GL Window
    glWindow.addWindowListener(tdmeLevelEditor);
    glWindow.addGLEventListener(tdmeLevelEditor);
    glWindow.setSize(1024, 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 7 with GLWindow

use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.

the class EngineTest method 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("EngineTest");
    // animator
    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    // tdme level editor
    EngineTest engineTest = new EngineTest(glWindow, animator);
    // GL Window
    glWindow.addGLEventListener(engineTest);
    glWindow.setSize(800, 600);
    glWindow.setVisible(true);
    glWindow.addKeyListener(engineTest);
    glWindow.addMouseListener(engineTest);
    glWindow.addWindowListener(engineTest);
    // 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 8 with GLWindow

use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.

the class PhysicsTest1 method 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("PhysicsTest1");
    // animator
    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    // tdme level editor
    PhysicsTest1 physicsTest1 = new PhysicsTest1();
    // GL Window
    glWindow.addGLEventListener(physicsTest1);
    glWindow.setSize(800, 600);
    glWindow.setVisible(true);
    glWindow.addKeyListener(physicsTest1);
    glWindow.addMouseListener(physicsTest1);
    glWindow.addWindowListener(physicsTest1);
    // 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 9 with GLWindow

use of com.jogamp.newt.opengl.GLWindow in project tdme by andreasdr.

the class GUITest method main.

/**
 * @param args
 */
public static void main(String[] args) {
    Logger.getLogger("").setLevel(Level.WARNING);
    // gl profile
    GLProfile glp = Engine.getProfile();
    // create GL caps
    GLCapabilities caps = new GLCapabilities(glp);
    caps.setBackgroundOpaque(true);
    caps.setDepthBits(16);
    caps.setDoubleBuffered(true);
    Console.println(glp);
    Console.println(caps);
    // create GL window
    GLWindow glWindow = GLWindow.create(caps);
    glWindow.setTitle("GUI Test");
    glWindow.setSize(800, 600);
    // animator
    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    animator.setUpdateFPSFrames(3, null);
    // create test
    GUITest guiTest = new GUITest(glWindow);
    glWindow.addGLEventListener(guiTest);
    glWindow.addWindowListener(guiTest);
    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 10 with GLWindow

use of com.jogamp.newt.opengl.GLWindow in project narchy by automenta.

the class JoglWindow method show.

public GLWindow show(String title, int w, int h, int x, int y) {
    if (window != null) {
        // TODO apply w,h,x,y to the existing window
        return window;
    }
    GLWindow W = this.window = window(this);
    W.setTitle(title);
    W.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE);
    W.preserveGLStateAtDestroy(false);
    W.setSize(w, h);
    if (x != Integer.MIN_VALUE) {
        W.setPosition(x, y);
    }
    W.setVisible(true);
    // if (!windows.isEmpty()) {
    // } else {
    // //a.start();
    // 
    // }
    windows.add(this);
    runFPS(UPDATE_FPS_IDEAL);
    return W;
}
Also used : GLWindow(com.jogamp.newt.opengl.GLWindow)

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