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


Java GLCapabilities.setDoubleBuffered方法代码示例

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


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

示例1: createOpenGLCanvas

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
private void createOpenGLCanvas() {
	if (trackDisplay != null)
	{
		trackPanel.remove(trackDisplay);
	}
	else {
		// design capabilities of opengl canvas
		GLCapabilities caps = new GLCapabilities(null);
		caps.setDoubleBuffered(true);
		caps.setHardwareAccelerated(true);
		caps.setAlphaBits(8);
		caps.setRedBits(8);
		caps.setGreenBits(8);
		caps.setBlueBits(8);

		trackDisplay = new RaceDisplay(caps);
		trackPanel.add(trackDisplay);
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:20,代码来源:RacetrackFrame.java

示例2: GLRenderer

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
GLRenderer(WindowConfig wc, int width, int height, GLKamera cam, boolean pFullscreen, boolean pNoDecoration) {
	wconf = wc;
	aCam = cam;
	win = Window.createWindowFactory(wconf.isAWT());

	GLProfile glp = GLProfile.getDefault();
	GLCapabilities caps = new GLCapabilities(glp);

	caps.setHardwareAccelerated(true);
	caps.setDoubleBuffered(wconf.doubleBuffering);
	caps.setDepthBits(24);

	win.createWindow(caps, width, height);
	win.setFullscreen(pFullscreen);
	win.setDecoration(pNoDecoration);

	win.getAutoDrawable().addGLEventListener(this);
	animator = win.getAnimator();
	animator.start();
	animator.setUpdateFPSFrames(wconf.doubleBuffering ? 60:2000, null);
	win.startDisplay();
	currentLighting = !wconf.globalLighting;
	renderItemMap = new ConcurrentHashMap<GLTextureImpl, CopyOnWriteArrayList<DisplayItem>>(10);
	objectNameMap = new ConcurrentHashMap<Integer, GLObjekt>(100);
}
 
开发者ID:trent2,项目名称:bGLOOP,代码行数:26,代码来源:GLRenderer.java

示例3: createDrawable

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public GLAutoDrawable createDrawable(final Composite parent) {
	final GLProfile profile = GLProfile.getDefault();
	final GLCapabilities cap = new GLCapabilities(profile);
	cap.setDepthBits(24);
	// cap.setBackgroundOpaque(true);
	cap.setDoubleBuffered(true);
	cap.setHardwareAccelerated(true);
	cap.setSampleBuffers(true);
	cap.setAlphaBits(8);
	cap.setNumSamples(8);
	canvas = new GLCanvas(parent, SWT.NONE, cap, null);
	canvas.setAutoSwapBufferMode(true);
	final SWTGLAnimator animator = new SWTGLAnimator(canvas);
	// animator.setIgnoreExceptions(!GamaPreferences.Runtime.ERRORS_IN_DISPLAYS.getValue());
	animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
	canvas.addGLEventListener(this);
	final FillLayout gl = new FillLayout();
	canvas.setLayout(gl);
	return canvas;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:Abstract3DRenderer.java

示例4: createGLCapabilities

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
/**
 * Converts a Capability object to an GLCapability object
 * @return GLCapability object
 * @param a The Capability object
 */
public static GLCapabilities createGLCapabilities(Capabilities a) {
	GLCapabilities capabilities = new GLCapabilities(null);
	capabilities.setRedBits(a.r);
	capabilities.setBlueBits(a.b);
	capabilities.setGreenBits(a.g);
	capabilities.setAlphaBits(a.a);
	capabilities.setDoubleBuffered(a.doubleBuffered);
	return capabilities;
}
 
开发者ID:ZetzmannM,项目名称:CGL,代码行数:15,代码来源:Canvas.java

示例5: createOpenGLCanvas

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
/** Factory method for creating an ImageDisplay with following capabilities:
 * <pre>
   caps.setDoubleBuffered(true);
   caps.setHardwareAccelerated(true);
   caps.setAlphaBits(8);
   caps.setRedBits(8);
   caps.setGreenBits(8);
   caps.setBlueBits(8);
   </pre>
 *
 * @return a new ImageDisplay
 */
public static ImageDisplay createOpenGLCanvas() {
	// design capabilities of opengl canvas
	GLCapabilities caps = new GLCapabilities(null);
	caps.setDoubleBuffered(true);
	caps.setHardwareAccelerated(true);
	caps.setAlphaBits(8);
	caps.setRedBits(8);
	caps.setGreenBits(8);
	caps.setBlueBits(8);

	ImageDisplay trackDisplay = new ImageDisplay(caps);
	return trackDisplay;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:ImageDisplay.java

示例6: createOpenGLCanvas

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public static ImageDisplayWriter createOpenGLCanvas() {
	// design capabilities of opengl canvas
	GLCapabilities caps = new GLCapabilities(null);
	caps.setDoubleBuffered(true);
	caps.setHardwareAccelerated(true);
	caps.setAlphaBits(8);
	caps.setRedBits(8);
	caps.setGreenBits(8);
	caps.setBlueBits(8);

	ImageDisplayWriter trackDisplay = new ImageDisplayWriter(caps);
	return trackDisplay;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:14,代码来源:ImageDisplayWriter.java

示例7: createOpenGLCanvas

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
/**
 * Factory method for creating an ImageDisplay with following capabilities:
 * <pre>
 * caps.setDoubleBuffered(true);
 * caps.setHardwareAccelerated(true);
 * caps.setAlphaBits(8);
 * caps.setRedBits(8);
 * caps.setGreenBits(8);
 * caps.setBlueBits(8);
 * </pre>
 *
 * @return a new ImageDisplay
 */
public static ImageDisplay createOpenGLCanvas() {

    // design capabilities of opengl canvas
    GLCapabilities caps = new GLCapabilities(null);
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);
    caps.setAlphaBits(8);
    caps.setRedBits(8);
    caps.setGreenBits(8);
    caps.setBlueBits(8);
    ImageDisplay trackDisplay = new ImageDisplay(caps);
    return trackDisplay;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:ImageDisplay.java

示例8: getDefaultConfig

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
@Override
public VisualizerConfig getDefaultConfig() throws UnsupportedFeatureException {
    GLProfile      profile = GLProfile.get(GL_PROFILE);
    GLCapabilities caps    = new GLCapabilities(profile);

    caps.setDoubleBuffered(true);
    caps.setDepthBits(16);

    // check if required features are available
    ArrayList<String> missing = checkGLFeatureSet(profile);
    if (!missing.isEmpty()) throw new UnsupportedFeatureException(missing);

    return new VisualizerConfig(profile, caps, DEFAULT_FPS);
}
 
开发者ID:sgs-us,项目名称:microtrafficsim,代码行数:15,代码来源:TileBasedVisualizer.java

示例9: drawShape

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
@Override
public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
    if( null == fboGLAD ) {
        final ImageSequence imgSeq = (ImageSequence)texSeq;

        final GLContext ctx = gl.getContext();
        final GLDrawable drawable = ctx.getGLDrawable();
        final GLCapabilitiesImmutable reqCaps = drawable.getRequestedGLCapabilities();
        final GLCapabilities caps = (GLCapabilities) reqCaps.cloneMutable();
        caps.setFBO(true);
        caps.setDoubleBuffered(false);
        if( !useAlpha ) {
            caps.setAlphaBits(0);
        }
        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());

        fboGLAD = (GLOffscreenAutoDrawable.FBO) factory.createOffscreenAutoDrawable(
                        drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(),
                        caps, null, fboWidth, fboHeight);
        fboWidth = 0;
        fboHeight = 0;
        fboGLAD.setSharedContext(ctx);
        fboGLAD.setTextureUnit(imgSeq.getTextureUnit());
        fboGLAD.addGLEventListener(glel);
        fboGLAD.display(); // 1st init!

        final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
        final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(),
                                fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
                                false /* mustFlipVertically */);
        imgSeq.addFrame(gl, tex);
        markStateDirty();
    } else if( 0 != fboWidth*fboHeight ) {
        fboGLAD.setSurfaceSize(fboWidth, fboHeight);
        fboWidth = 0;
        fboHeight = 0;
        markStateDirty();
    } else if( animateGLEL ) {
        fboGLAD.display();
    }

    super.drawShape(gl, renderer, sampleCount);

    if( animateGLEL ) {
        markStateDirty(); // keep on going
    }
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:48,代码来源:GLEventListenerButton.java

示例10: main

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的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

示例11: initpbuffer

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
private void initpbuffer()
{
  GL2 gl;
  System.out.println("initpbuffer");
  osdwidth=newosdwidth;
  osdheight=newosdheight;
  GLCapabilities caps = new GLCapabilities(null);
  caps.setHardwareAccelerated(true);
  caps.setDoubleBuffered(false);
  caps.setAlphaBits(8);
  caps.setRedBits(8);
  caps.setGreenBits(8);
  caps.setBlueBits(8);
  caps.setDepthBits(0);
  caps.setFBO(false);
  System.out.println("initpbuffer2");
  if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null, caps.getGLProfile()))
  {
    throw new GLException("pbuffers unsupported");
  }
  if(pbuffer!=null) pbuffer.destroy();
  System.out.println("initpbuffer3");
  pbuffer = GLDrawableFactory.getFactory(caps.getGLProfile()).createOffscreenAutoDrawable(null,
      caps,
      null,
      osdwidth,
      osdheight
      );
  pbuffer.setContext(pbuffer.createContext(c.getContext()), true);
  //pbuffer.setContext(c.getContext(), false);
  System.out.println("initpbuffer4: pbuffers is null? " + (pbuffer==null));
  if(pbuffer.getContext().makeCurrent()==GLContext.CONTEXT_NOT_CURRENT)
  {
    System.out.println("Couldn't make pbuffer current?");
    return;
  }
  System.out.println("initpbuffer5");
  gl = pbuffer.getGL().getGL2();

  gl.glClearColor( 0.0f, 0.0f, 0.0f, 0.0f);

  gl.glClear( gl.GL_COLOR_BUFFER_BIT);

  gl.glViewport(0, 0, osdwidth, osdheight);
  gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrtho(0,osdwidth,0,osdheight,-1.0,1.0);
  gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
  gl.glLoadIdentity();

  // TODO: look into reusing same texture like OSX version...
  if(osdt!=null) gl.glDeleteTextures(1, osdt, 0);
  osdt = new int[1];
  byte img[] = new byte[osdwidth*osdheight*4];
  gl.glGenTextures(1, osdt, 0);
  gl.glEnable(gl.GL_TEXTURE_RECTANGLE);
  gl.glBindTexture(gl.GL_TEXTURE_RECTANGLE,osdt[0]);
  gl.glTexParameteri(gl.GL_TEXTURE_RECTANGLE, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR);
  gl.glTexParameteri(gl.GL_TEXTURE_RECTANGLE, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR);
  gl.glTexImage2D(gl.GL_TEXTURE_RECTANGLE, 0, 4, osdwidth, osdheight, 0,
      gl.GL_BGRA, bigendian ? gl.GL_UNSIGNED_INT_8_8_8_8_REV : gl.GL_UNSIGNED_BYTE, java.nio.ByteBuffer.wrap(img));

  gl.glEnable(gl.GL_TEXTURE_RECTANGLE);
  gl.glBindTexture(gl.GL_TEXTURE_RECTANGLE, osdt[0]);
  gl.glCopyTexSubImage2D(gl.GL_TEXTURE_RECTANGLE, 0, 0, 0, 0, 0, osdwidth, osdheight);
  gl.glDisable(gl.GL_TEXTURE_RECTANGLE);
  System.out.println("initpbuffer6");
  pbuffer.getContext().release();
  System.out.println("initpbuffer7");
}
 
开发者ID:google,项目名称:sagetv,代码行数:71,代码来源:OpenGLGFXCMD.java


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