本文整理匯總了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;
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}