Search in sources :

Example 6 with GLProfile

use of com.jogamp.opengl.GLProfile in project tdme by andreasdr.

the class TDMELevelEditor method main.

/**
	 * @param args
	 */
public static void main(String[] args) {
    String modelFileName = null;
    //
    System.out.println("TDMELevelEditor " + VERSION);
    System.out.println("Programmed 2014,...,2017 by Andreas Drewke, drewke.net.");
    System.out.println();
    // no nifty logging
    Logger.getLogger("").setLevel(Level.SEVERE);
    // create GL caps
    GLProfile glp = Engine.getProfile();
    GLCapabilities caps = new GLCapabilities(glp);
    System.out.println(glp);
    System.out.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 GLProfile

use of com.jogamp.opengl.GLProfile in project jmonkeyengine by jMonkeyEngine.

the class JoglOffscreenBuffer method initInThread.

protected void initInThread() {
    // not necessary as JOGL can create an offscreen buffer even without full FBO support
    //        if (!GLContext.getCurrent().hasFullFBOSupport()){
    //            logger.severe("Offscreen surfaces are not supported.");
    //            return;
    //        }
    final GLProfile profile;
    if (settings.getRenderer().equals(AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE)) {
        profile = GLProfile.getMaxProgrammable(true);
    } else {
        profile = GLProfile.getMaxFixedFunc(true);
    }
    caps = new GLCapabilities(profile);
    int samples = getNumSamplesToUse();
    caps.setHardwareAccelerated(true);
    caps.setDoubleBuffered(true);
    caps.setStencilBits(settings.getStencilBits());
    caps.setDepthBits(settings.getDepthBits());
    caps.setOnscreen(false);
    caps.setSampleBuffers(true);
    caps.setNumSamples(samples);
    offscreenDrawable = GLDrawableFactory.getFactory(profile).createOffscreenAutoDrawable(null, caps, null, width, height);
    offscreenDrawable.display();
    renderable.set(true);
    logger.fine("Offscreen buffer created.");
    super.internalCreate();
    listener.initialize();
}
Also used : GLCapabilities(com.jogamp.opengl.GLCapabilities) GLProfile(com.jogamp.opengl.GLProfile)

Example 8 with GLProfile

use of com.jogamp.opengl.GLProfile in project tdme by andreasdr.

the class TDMEParticleSystem method main.

/**
	 * @param args
	 */
public static void main(String[] args) {
    //
    System.out.println("TDMEParticleSystem " + VERSION);
    System.out.println("Programmed 2017 by Andreas Drewke, drewke.net.");
    System.out.println();
    // no nifty logging
    Logger.getLogger("").setLevel(Level.SEVERE);
    // create GL caps
    GLProfile glp = Engine.getProfile();
    GLCapabilities caps = new GLCapabilities(glp);
    System.out.println(glp);
    System.out.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 9 with GLProfile

use of com.jogamp.opengl.GLProfile in project tdme by andreasdr.

the class TDMEViewer method main.

/**
	 * @param args
	 */
public static void main(String[] args) {
    String modelFileName = null;
    //
    System.out.println("TDMEViewer " + VERSION);
    System.out.println("Programmed 2014,...,2017 by Andreas Drewke, drewke.net.");
    System.out.println();
    // no nifty logging
    Logger.getLogger("").setLevel(Level.SEVERE);
    // create GL caps
    GLProfile glp = Engine.getProfile();
    GLCapabilities caps = new GLCapabilities(glp);
    System.out.println(glp);
    System.out.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)

Example 10 with GLProfile

use of com.jogamp.opengl.GLProfile in project tdme by andreasdr.

the class Engine method getProfile.

/**
	 * @return supported GL profile
	 */
public static GLProfile getProfile() {
    GLProfile glp = null;
    if (GLProfile.isAvailable(GLProfile.GL3)) {
        System.out.println("TDME::Proposing GL3");
        glp = GLProfile.get(GLProfile.GL3);
    } else if (GLProfile.isAvailable(GLProfile.GL2)) {
        System.out.println("TDME::Proposing GL2");
        glp = GLProfile.get(GLProfile.GL2);
    } else if (GLProfile.isAvailable(GLProfile.GLES2)) {
        System.out.println("TDME::Proposing GLES2");
        glp = GLProfile.get(GLProfile.GLES2);
    } else {
        System.out.println("TDME::No suiting OpenGL profile available!");
        return null;
    }
    System.out.println("TDME::Proposing " + glp + ", GL2 = " + glp.isGL2() + ", GLES2 = " + glp.isGLES2() + ", GL3 = " + glp.isGL3());
    return glp;
}
Also used : GLProfile(com.jogamp.opengl.GLProfile)

Aggregations

GLProfile (com.jogamp.opengl.GLProfile)11 GLCapabilities (com.jogamp.opengl.GLCapabilities)10 GLWindow (com.jogamp.newt.opengl.GLWindow)8 FPSAnimator (com.jogamp.opengl.util.FPSAnimator)8 Point (java.awt.Point)1