当前位置: 首页>>代码示例>>Java>>正文


Java GLWindow.setVisible方法代码示例

本文整理汇总了Java中com.jogamp.newt.opengl.GLWindow.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java GLWindow.setVisible方法的具体用法?Java GLWindow.setVisible怎么用?Java GLWindow.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.newt.opengl.GLWindow的用法示例。


在下文中一共展示了GLWindow.setVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的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();
}
 
开发者ID:bensmith87,项目名称:jogl_gradle,代码行数:19,代码来源:Main.java

示例2: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的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();
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:38,代码来源:UINewtDemo01.java

示例3: createWindow

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
    Assert.assertNotNull(caps);

    final GLWindow window = GLWindow.create(caps);
    window.setSize(width, height);
    window.setPosition(10, 10);
    window.setTitle(title);
    Assert.assertNotNull(window);
    window.setVisible(true);

    return window;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:13,代码来源:TestTextRendererNEWT00.java

示例4: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:33,代码来源:EngineTest.java

示例5: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:33,代码来源:PhysicsTest1.java

示例6: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * 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("PhysicsTest2");

	// animator
	FPSAnimator animator = new FPSAnimator(glWindow, 60);

	// tdme level editor
	PhysicsTest2 physicsTest2 = new PhysicsTest2();
	
	// GL Window
	glWindow.addGLEventListener(physicsTest2);
	glWindow.setSize(800, 600);
	glWindow.setVisible(true);
	glWindow.addKeyListener(physicsTest2);
	glWindow.addMouseListener(physicsTest2);
	glWindow.addWindowListener(physicsTest2);
	
	// start animator
	animator.setUpdateFPSFrames(3, null);
	animator.start();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:34,代码来源:PhysicsTest2.java

示例7: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:36,代码来源:GUITest.java

示例8: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:34,代码来源:PhysicsTest3.java

示例9: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:38,代码来源:TDMEParticleSystem.java

示例10: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:40,代码来源:TDMELevelEditor.java

示例11: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * @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();
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:40,代码来源:TDMEViewer.java

示例12: NeonNewtWindow

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * Constructor for this class. Sets up the window and enables common
 * features like anti-aliasing and hardware acceleration.
 * 
 * @param forceGL2ES2
 *            Force GL2ES2 support (default on), currently Unused
 * @param inputHandler
 *            A predefined InputHandler that is added as event handler for
 *            input events.
 * @param glEventListener
 *            A predefined GLEventListener that is added as event handler
 *            for openGL events.
 * @param width
 *            The initial window width.
 * @param height
 *            The initial window height.
 * @param windowTitle
 *            The window title.
 */
public NeonNewtWindow(boolean forceGL2ES2, InputHandler inputHandler, final GLEventListener glEventListener,
        int width, int height, String windowTitle) {

    GLProfile.initSingleton();

    final GLProfile glp;
    glp = GLProfile.get(GLProfile.GL3);

    // Set up the GL context
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setBackgroundOpaque(true);
    caps.setHardwareAccelerated(true);
    caps.setDoubleBuffered(true);

    // Add Anti-Aliasing
    caps.setSampleBuffers(true);
    caps.setAlphaBits(4);
    caps.setNumSamples(4);

    GLWindow window = GLWindow.create(caps);

    window.addGLEventListener(glEventListener);
    window.addWindowListener(new QuitListener());
    window.setAutoSwapBufferMode(true);
    window.setSize(width, height);
    window.setTitle(windowTitle);
    window.addMouseListener(inputHandler);
    window.addKeyListener(inputHandler);

    Animator animator = new Animator();
    animator.add(window);
    animator.start();
    animator.setUpdateFPSFrames(60, null);

    window.setVisible(true);

}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:57,代码来源:NeonNewtWindow.java

示例13: createView

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
public static Viewer createView()
{
	GLCapabilities cap = new GLCapabilities(GLProfile.get(GLProfile.GL2GL3));
	GLWindow glwindow = GLWindow.create(cap);
	glwindow.setSize(1, 1);
	glwindow.setVisible(true);
	Viewer viewer = new Viewer(new Canvas3D(glwindow));
	viewer.getView().setMinimumFrameCycleTime(5);
	return viewer;

}
 
开发者ID:philjord,项目名称:3DTools,代码行数:12,代码来源:HeadlessUniverse.java

示例14: TestJogl

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
public TestJogl() {
    GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));

    caps.setDoubleBuffered(true);
    GLWindow glWindow = GLWindow.create(caps);

    glWindow.setTitle("jogl-triangle-color");

    glWindow.setSize(800, 800);

    glWindow.setFullscreen(false);
    glWindow.setUndecorated(false);
    glWindow.setPointerVisible(true);
    glWindow.setVisible(true);

    renderer = new Renderer(glWindow);

    glWindow.addGLEventListener(renderer);
}
 
开发者ID:perses-games,项目名称:jogl-triangle-color,代码行数:20,代码来源:TestJogl.java

示例15: main

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的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();
}
 
开发者ID:philjord,项目名称:3DTools,代码行数:78,代码来源:GPUUISceneNewtDemo.java


注:本文中的com.jogamp.newt.opengl.GLWindow.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。