本文整理汇总了Java中com.jogamp.newt.opengl.GLWindow.setSurfaceScale方法的典型用法代码示例。如果您正苦于以下问题:Java GLWindow.setSurfaceScale方法的具体用法?Java GLWindow.setSurfaceScale怎么用?Java GLWindow.setSurfaceScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.newt.opengl.GLWindow
的用法示例。
在下文中一共展示了GLWindow.setSurfaceScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}