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


Java GLWindow.setPosition方法代码示例

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


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

示例1: sendToRift

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 *
 *TODO: the F9 bit full screen etc
Press F9 or F11 to switch rendering to the Oculus Rift.
F9 - Switches to hardware full-screen mode. This will give best possible latency, but may blink
monitors as the operating system changes display settings. If no image shows up in the Rift, then press
F9 again to cycle to the next monitor.
F11 - Instantly switches the rendering window to the Rift portion of the desktop. This mode has higher
latency and no vsync, but is convenient for development.
 
*/
public void sendToRift()
{ 
	//TODO:...
	System.out.println("looking for " + or.getHmdDesc().displayDeviceName);
	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(leftView.getCanvas3D(0).getGLWindow());
	for (GraphicsDevice gd : ge.getScreenDevices())
	{
		System.out.println("I've got " + gd.getIDstring());
		System.out.println(" " + gd.toString());
	}

	//using desktop location instead
	GLWindow w = leftView.getCanvas3D(0).getGLWindow();
	w.setPosition(or.getHmdDesc().windowsPosX, or.getHmdDesc().windowsPosY);
}
 
开发者ID:philjord,项目名称:3DTools,代码行数:27,代码来源:HMDCamDolly.java

示例2: forceProjectorSize

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
public void forceProjectorSize(int w, int h, int px, int py) {
        frameSize.set(w, h);
//        this.shouldSetWindowSize = true;
//        registerPost();

        GLWindow window = (GLWindow) applet.getSurface().getNative();
        window.setUndecorated(true);
        window.setSize(w, h);
        window.setPosition(px, py);
    }
 
开发者ID:poqudrof,项目名称:PapARt,代码行数:11,代码来源:Papart.java

示例3: defaultFrameLocation

import com.jogamp.newt.opengl.GLWindow; //导入方法依赖的package包/类
/**
 * Set the frame to default location.
 */
public void defaultFrameLocation() {
    ScreenConfiguration screenConfiguration = getDefaultScreenConfiguration(this.applet);
    this.applet.frame.setLocation(screenConfiguration.getProjectionScreenOffsetX(),
            screenConfiguration.getProjectionScreenOffsetY());

    GLWindow window = (GLWindow) applet.getSurface().getNative();
    window.setPosition(screenConfiguration.getProjectionScreenOffsetX(),
            screenConfiguration.getProjectionScreenOffsetY());
}
 
开发者ID:poqudrof,项目名称:PapARt,代码行数:13,代码来源:Papart.java

示例4: 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

示例5: 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

示例6: 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.setPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。