本文整理汇总了Java中com.jogamp.newt.opengl.GLWindow.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java GLWindow.setSize方法的具体用法?Java GLWindow.setSize怎么用?Java GLWindow.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.newt.opengl.GLWindow
的用法示例。
在下文中一共展示了GLWindow.setSize方法的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();
}
示例2: forceProjectorSize
import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
public void forceProjectorSize() {
frameSize.set(projector.getWidth(),
projector.getHeight());
// this.shouldSetWindowSize = true;
// registerPost();
GLWindow window = (GLWindow) applet.getSurface().getNative();
window.setUndecorated(true);
window.setSize(projector.getWidth(),
projector.getHeight());
}
示例3: 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();
}
示例4: 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;
}
示例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("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();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: 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);
}
示例14: 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;
}
示例15: 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);
}