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


Java GL2.setSwapInterval方法代码示例

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


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

示例1: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(GLAutoDrawable drawable) {

	System.out.println("init");

	GL2 gl = getGL().getGL2();

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	gl.glClearColor(0, 0, 0, 0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	gl.glRasterPos3f(0, 0, 0);
	gl.glColor3f(1, 1, 1);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:18,代码来源:RaceDisplay.java

示例2: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Called by the drawable immediately after the OpenGL context is
    initialized. Can be used to perform one-time OpenGL
    initialization such as setup of lights and display lists. Note
    that this method may be called more than once if the underlying
    OpenGL context for the GLAutoDrawable is destroyed and
    recreated, for example if a GLCanvas is removed from the widget
    hierarchy and later added again.
 */
@Override
public void init(GLAutoDrawable drawable){
	GL2 gl = drawable.getGL().getGL2();

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	gl.glClearColor(0,0,0,0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	gl.glRasterPos3f(0,0,0);
	gl.glColor3f(1,1,1);
	glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,"Initialized display");

	reval();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:EyeTarget.java

示例3: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init( GLAutoDrawable drawable ) {
	// drawable.setGL(new DebugGL(drawable.getGL()));
	drawable.setAutoSwapBufferMode(true);
	final GL2 gl = drawable.getGL().getGL2();

	//	        log.info("OpenGL implementation is: " + gl.getClass().getName() + "\nGL_VENDOR: "
	//	                + gl.glGetString(GL.GL_VENDOR) + "\nGL_RENDERER: " + gl.glGetString(GL.GL_RENDERER) + "\nGL_VERSION: "
	//	                + gl.glGetString(GL.GL_VERSION) // + "\nGL_EXTENSIONS: " + gl.glGetString(GL.GL_EXTENSIONS)
	//	        );
	final float glVersion = Float.parseFloat(gl.glGetString(GL.GL_VERSION).substring(0, 3));
	if (glVersion < 1.3f) {
		//	            log.warning("\n\n*******************\nOpenGL version "
		//	                    + glVersion
		//	                    + " < 1.3, some features may not work and program may crash\nTry switching from 16 to 32 bit color if you have decent graphics card\n\n");
	}
	// System.out.println("GLU_EXTENSIONS: "+glu.gluGetString(GLU.GLU_EXTENSIONS));

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	gl.glClearColor(0, 0, 0, 0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	gl.glRasterPos3f(0, 0, 0);
	gl.glColor3f(1, 1, 1);
	//	        glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, "Initialized display");
	// Start animator (which should be a field).
	animator = new FPSAnimator(glcanvas, 60);
	animator.start();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:33,代码来源:Triangulation3DViewer.java

示例4: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(final GLAutoDrawable drawable) {
    // drawable.setGL(new DebugGL(drawable.getGL()));
    drawable.setAutoSwapBufferMode(true);
    final GL2 gl = drawable.getGL().getGL2();

    log.info("OpenGL implementation is: " + gl.getClass().getName() + "\nGL_VENDOR: "
            + gl.glGetString(GL.GL_VENDOR) + "\nGL_RENDERER: " + gl.glGetString(GL.GL_RENDERER) + "\nGL_VERSION: "
            + gl.glGetString(GL.GL_VERSION) // + "\nGL_EXTENSIONS: " + gl.glGetString(GL.GL_EXTENSIONS)
    );
    final float glVersion = Float.parseFloat(gl.glGetString(GL.GL_VERSION).substring(0, 3));
    if (glVersion < 1.3f) {
        log.warning("\n\n*******************\nOpenGL version "
                + glVersion
                + " < 1.3, some features may not work and program may crash\nTry switching from 16 to 32 bit color if you have decent graphics card\n\n");
    }
    // System.out.println("GLU_EXTENSIONS: "+glu.gluGetString(GLU.GLU_EXTENSIONS));

    gl.setSwapInterval(1);
    gl.glShadeModel(GLLightingFunc.GL_FLAT);

    gl.glClearColor(0, 0, 0, 0f);
    gl.glClear(GL.GL_COLOR_BUFFER_BIT);
    gl.glLoadIdentity();

    gl.glRasterPos3f(0, 0, 0);
    gl.glColor3f(1, 1, 1);
    glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, "Initialized display");
    checkGLError(gl, glu, "after init");

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:32,代码来源:ChipCanvas.java

示例5: init

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Called on initialization
 */
@Override
public void init(GLAutoDrawable drawable) {

	//        log.info("init");

	GL2 gl = getGL().getGL2();

	gl.setSwapInterval(1);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	// clears to black
	gl.glClearColor(0, 0, 0, 0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	// color set to white, raster to LL  corner
	gl.glRasterPos3f(0, 0, 0);
	gl.glColor3f(1, 1, 1);


	textRenderer = new TextRenderer(new Font("SansSerif", Font.PLAIN, getFontSize()), true, true);

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:ImageDisplay.java


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