當前位置: 首頁>>代碼示例>>Java>>正文


Java GLCapabilities.setDoubleBuffered方法代碼示例

本文整理匯總了Java中javax.media.opengl.GLCapabilities.setDoubleBuffered方法的典型用法代碼示例。如果您正苦於以下問題:Java GLCapabilities.setDoubleBuffered方法的具體用法?Java GLCapabilities.setDoubleBuffered怎麽用?Java GLCapabilities.setDoubleBuffered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.media.opengl.GLCapabilities的用法示例。


在下文中一共展示了GLCapabilities.setDoubleBuffered方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCaps

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
private GLCapabilities getCaps() {
	GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());

	// Anti-aliasing using Multisampling
	if (AA_MULTISAMPLING) {
		try {
			caps.setAlphaBits(ALPHA_BITS);
			caps.setDoubleBuffered(true);
			caps.setHardwareAccelerated(true);
			caps.setSampleBuffers(true);
			caps.setNumSamples(8);

			caps.setAccumAlphaBits(ALPHA_BITS);
			caps.setAccumBlueBits(ALPHA_BITS);
			caps.setAccumGreenBits(ALPHA_BITS);
			caps.setAccumRedBits(ALPHA_BITS);

		} catch (javax.media.opengl.GLException ex) {
			ex.printStackTrace();
		}
	}

	return caps;
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:25,代碼來源:NetworkRenderer.java

示例2: getOpenGLProblems

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
public static String getOpenGLProblems()
{
    GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
	
    caps.setAlphaBits(8);
    caps.setRedBits(8);
    caps.setGreenBits(8);  
    caps.setBlueBits(8);
    caps.setDepthBits(24);
    caps.setDoubleBuffered(true);
    GLCanvas canvas = new GLCanvas(caps);

    OpenGLTestCapabilities testClass = new OpenGLTestCapabilities();
    canvas.addGLEventListener(testClass);
    
    
    return testClass.messages.toString();

}
 
開發者ID:ltrr-arizona-edu,項目名稱:tellervo,代碼行數:20,代碼來源:OpenGLTestCapabilities.java

示例3: testOpenGL

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
private static boolean testOpenGL()
{
    GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
	
    caps.setAlphaBits(8);
    caps.setRedBits(8);
    caps.setGreenBits(8);
    caps.setBlueBits(8);
    caps.setDepthBits(24);
    caps.setDoubleBuffered(true);
    GLCanvas canvas = new GLCanvas(caps);

    OpenGLTestCapabilities testClass = new OpenGLTestCapabilities();
    canvas.addGLEventListener(testClass);

    testedPreviously = true;
    previouslyTestedAsOpenGLCapable = !testClass.fail;
    
    return !testClass.fail;

}
 
開發者ID:ltrr-arizona-edu,項目名稱:tellervo,代碼行數:22,代碼來源:OpenGLTestCapabilities.java

示例4: setup

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Create the GLCanvas and set properties for the graphics device
 * initialization, such as bits per channel. And advanced features for
 * improved rendering performance such as the stencil buffer.
 */
private void setup() {
	GLProfile glp = GLProfile.getDefault();
       // Specifies a set of OpenGL capabilities, based on your profile.
       GLCapabilities caps = new GLCapabilities(glp);
	caps.setDoubleBuffered(true);
	caps.setHardwareAccelerated(true);

	// create the canvas for drawing
	canvas = new GLCanvas(caps);

	// create the render thread
	anim = new Animator();

	// add the canvas to the main window
	add(canvas, BorderLayout.CENTER);

	// need this to receive callbacks for rendering (i.e. display() method)
	canvas.addGLEventListener(this);
}
 
開發者ID:momega,項目名稱:spacesimulator,代碼行數:25,代碼來源:JoglTransparencyDemo.java

示例5: getCapabilities

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * I require HW acceleration and double buffering.
 * @return Set of required capabilities
 */
private static GLCapabilities getCapabilities() {
    GLCapabilities caps = new GLCapabilities();
    caps.setHardwareAccelerated(true);
    caps.setDoubleBuffered(true);
    return caps;
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:11,代碼來源:MapGLPanel.java

示例6: TestFrameComponent

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
public TestFrameComponent() {
	super("test");
	/*
     * display mode (single buffer and RGBA)
     */
	GLProfile prof=GLProfile.getDefault();
    caps = new GLCapabilities(prof);
    caps.setDoubleBuffered(false);
    System.out.println(caps.toString());
    canvas = new GLCanvas(caps);
    canvas.addGLEventListener(this);
    //
    getContentPane().add(canvas);
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:15,代碼來源:TestFrameComponent.java

示例7: FeaturePointsCanvas

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
public FeaturePointsCanvas(ProjectTopComponent tc) {
    super(tc);

    GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
    capabilities.setDoubleBuffered(true);
    //    capabilities.setAlphaBits(0);
    glJPanel = new GLJPanel(capabilities);
    glAnimatorControl = new Animator(glJPanel);
    glAnimatorControl.start();
    initComponents();

    jPanel2.add(glJPanel);
    this.validate();
}
 
開發者ID:Fidentis,項目名稱:Analyst,代碼行數:15,代碼來源:FeaturePointsCanvas.java

示例8: Quantum

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
public Quantum( )
{
	GLCapabilities caps = new GLCapabilities();
	caps.setRedBits(8);
   	caps.setGreenBits(8);
   	caps.setBlueBits(8);
   	caps.setAlphaBits(8);
   	caps.setDepthBits(16);
   	caps.setStencilBits(8);    	
   	caps.setDoubleBuffered(true);    	
       canvas = new GLCanvas( caps );      
       canvas.addGLEventListener(this);       
            
       SoundManager.setBufferVolume( config.getVolumeSfx() );        
       setBounds( config.getX(), config.getY(), config.getWidth(), config.getHeight() );        
       setTitle("QUANTUM");        
       try {
		this.setIconImage( ImageIO.read( FileManager.readFile( "icon.png" ) ) );
	} catch (Exception e1) {
		Log.println( "[Quantum] couldn't 'load icon.png'" );
	}

       getContentPane().add(canvas,BorderLayout.CENTER);
       
       animator = new Animator( canvas );
       animator.setRunAsFastAsPossible( true );
       animator.start();               
       

       addWindowListener(new WindowAdapter()
       {
           public void windowClosing(WindowEvent e)
           {            	
           	remove(canvas);
           	animator.stop();
           	closing( );
               System.exit(0);
           }
       });
}
 
開發者ID:weimingtom,項目名稱:quantum-game,代碼行數:41,代碼來源:Quantum.java

示例9: OpenGLCapabilities

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
protected OpenGLCapabilities(GLProfile profile, AbstractGraphicsDevice graphicsDevice) {
    GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
    GLCapabilities caps = new GLCapabilities(profile);
    caps.setDoubleBuffered(false);
    
    // createGLPbuffer throws a GLException if pbuffers are not supported.
    buffer = factory.createGLPbuffer(graphicsDevice, caps, null, 1, 1, null);
}
 
開發者ID:OSUCartography,項目名稱:TerrainViewer,代碼行數:9,代碼來源:OpenGLCapabilities.java

示例10: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Setup the avaiatrix pipeline here
 */
private void setupAviatrix()
{
    // Assemble a simple single-threaded pipeline.
    GLCapabilities caps = new GLCapabilities();
    caps.setStencilBits(8);
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);

    GraphicsCullStage culler = new NullCullStage();
    culler.setOffscreenCheckEnabled(false);

    GraphicsSortStage sorter = new NullSortStage();
    surface = new DebugAWTSurface(caps);
    DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

    pipeline.setCuller(culler);
    pipeline.setSorter(sorter);
    pipeline.setGraphicsOutputDevice(surface);

    displayManager = new SingleDisplayCollection();
    displayManager.addPipeline(pipeline);

    // Render manager
    sceneManager = new SingleThreadRenderManager();
    sceneManager.addDisplay(displayManager);
    sceneManager.setMinimumFrameInterval(100);

    // Before putting the pipeline into run mode, put the canvas on
    // screen first.
    Component comp = (Component)surface.getSurfaceObject();
    add(comp, BorderLayout.CENTER);
}
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:36,代碼來源:StencilDemo.java

示例11: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Setup the avaiatrix pipeline here
 */
private void setupAviatrix()
{
    // Assemble a simple single-threaded pipeline.
    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);

    GraphicsCullStage culler = new NullCullStage();
    culler.setOffscreenCheckEnabled(false);

    GraphicsSortStage sorter = new NullSortStage();
    surface = new DebugAWTSurface(caps);
    DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

    pipeline.setCuller(culler);
    pipeline.setSorter(sorter);
    pipeline.setGraphicsOutputDevice(surface);

    displayManager = new SingleDisplayCollection();
    displayManager.addPipeline(pipeline);

    // Render manager
    sceneManager = new SingleThreadRenderManager();
    sceneManager.addDisplay(displayManager);
    sceneManager.setMinimumFrameInterval(100);

    // Before putting the pipeline into run mode, put the canvas on
    // screen first.
    Component comp = (Component)surface.getSurfaceObject();
    add(comp, BorderLayout.CENTER);
}
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:35,代碼來源:MultiClipPlaneDemo.java

示例12: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Setup the avaiatrix pipeline here
 */
private void setupAviatrix()
{
    // Assemble a simple single-threaded pipeline.
    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);

    GraphicsCullStage culler = new SimpleFrustumCullStage();
    culler.setOffscreenCheckEnabled(false);

    GraphicsSortStage sorter = new StateAndTransparencyDepthSortStage();
    surface = new SimpleAWTSurface(caps);
    surface.setClearColor(0.2f, 0.2f, 0.2f, 1);
    DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

    pipeline.setCuller(culler);
    pipeline.setSorter(sorter);
    pipeline.setGraphicsOutputDevice(surface);

    // Render manager
    sceneManager = new SingleThreadRenderManager();
    sceneManager.addPipeline(pipeline);
    sceneManager.setGraphicsOutputDevice(surface);
    sceneManager.setMinimumFrameInterval(30);

    // Before putting the pipeline into run mode, put the canvas on
    // screen first.
    Component comp = (Component)surface.getSurfaceObject();
    add(comp, BorderLayout.CENTER);
}
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:34,代碼來源:AV3DLoaderDemo.java

示例13: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
     * Setup the avaiatrix pipeline here
     */
    private void setupAviatrix()
    {
        // Assemble a simple single-threaded pipeline.
        GLCapabilities caps = new GLCapabilities();
        caps.setDoubleBuffered(true);
        caps.setHardwareAccelerated(true);

        GraphicsCullStage culler = new NullCullStage();
        culler.setOffscreenCheckEnabled(false);

        GraphicsSortStage sorter = new NullSortStage();
//        GraphicsSortStage sorter = new StateSortStage();
        surface = new DebugAWTSurface(caps);
        DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

        pipeline.setCuller(culler);
        pipeline.setSorter(sorter);
        pipeline.setGraphicsOutputDevice(surface);

        displayManager = new SingleDisplayCollection();
        displayManager.addPipeline(pipeline);

        // Render manager
        sceneManager = new SingleThreadRenderManager();
        sceneManager.addDisplay(displayManager);
        sceneManager.setMinimumFrameInterval(100);

        // Before putting the pipeline into run mode, put the canvas on
        // screen first.
        Component comp = (Component)surface.getSurfaceObject();
        add(comp, BorderLayout.CENTER);
    }
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:36,代碼來源:SimpleMultiTextureDemo.java

示例14: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Setup the avaiatrix pipeline here
 */
private void setupAviatrix()
{
    // Assemble a simple single-threaded pipeline.
    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);

    GraphicsCullStage culler = new NullCullStage();
    culler.setOffscreenCheckEnabled(false);

    GraphicsSortStage sorter = new NullSortStage();
    surface = new SimpleAWTSurface(caps);
    surface.setClearColor(FOG_COLOUR[0], FOG_COLOUR[1], FOG_COLOUR[2], 1);
    DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

    pipeline.setCuller(culler);
    pipeline.setSorter(sorter);
    pipeline.setGraphicsOutputDevice(surface);

    displayManager = new SingleDisplayCollection();
    displayManager.addPipeline(pipeline);

    // Render manager
    sceneManager = new SingleThreadRenderManager();
    sceneManager.addDisplay(displayManager);
    sceneManager.setMinimumFrameInterval(100);



    // Before putting the pipeline into run mode, put the canvas on
    // screen first.
    Component comp = (Component)surface.getSurfaceObject();
    add(comp, BorderLayout.CENTER);
}
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:38,代碼來源:LocalFogDemo.java

示例15: setupAviatrix

import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
 * Setup the avaiatrix pipeline here
 */
private void setupAviatrix(Shell parent)
{
    // Assemble a simple single-threaded pipeline.
    GLCapabilities caps = new GLCapabilities();
    caps.setDoubleBuffered(true);
    caps.setHardwareAccelerated(true);

    GraphicsCullStage culler = new NullCullStage();
    culler.setOffscreenCheckEnabled(false);

    GraphicsSortStage sorter = new NullSortStage();
    surface = new SimpleSWTSurface(parent, SWT.NONE, caps);
    DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline();

    pipeline.setCuller(culler);
    pipeline.setSorter(sorter);
    pipeline.setGraphicsOutputDevice(surface);

    displayManager = new SingleDisplayCollection();
    displayManager.addPipeline(pipeline);

    // Render manager
    sceneManager = new SingleThreadRenderManager();
    sceneManager.addDisplay(displayManager);
    sceneManager.setMinimumFrameInterval(100);
}
 
開發者ID:Norkart,項目名稱:NK-VirtualGlobe,代碼行數:30,代碼來源:AnimationDemo.java


注:本文中的javax.media.opengl.GLCapabilities.setDoubleBuffered方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。