本文整理匯總了Java中javax.media.opengl.GLCapabilities.setHardwareAccelerated方法的典型用法代碼示例。如果您正苦於以下問題:Java GLCapabilities.setHardwareAccelerated方法的具體用法?Java GLCapabilities.setHardwareAccelerated怎麽用?Java GLCapabilities.setHardwareAccelerated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.media.opengl.GLCapabilities
的用法示例。
在下文中一共展示了GLCapabilities.setHardwareAccelerated方法的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: 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);
}
示例3: 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;
}
示例4: 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 SimpleTransparencySortStage();
surface = new DebugAWTSurface(caps);
surface.setColorClearNeeded(false); // we're using a background
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(10);
// Before putting the pipeline into run mode, put the canvas on
// screen first.
Component comp = (Component)surface.getSurfaceObject();
add(comp, BorderLayout.CENTER);
}
示例5: 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 SimpleTransparencySortStage();
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(10);
// Before putting the pipeline into run mode, put the canvas on
// screen first.
Component comp = (Component)surface.getSurfaceObject();
add(comp, BorderLayout.CENTER);
}
示例6: 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);
}
示例7: 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 GenericCullStage();
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);
}
示例8: 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);
}
示例9: 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 DebugSWTSurface(parent, SWT.NONE, caps);
surface.setClearColor(0.2f, 0.2f, 0.2f, 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);
}
示例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.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
*
* @param parent The parent widget of the display
*/
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(2);
culler.setOffscreenCheckEnabled(true);
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);
}
示例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 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(0);
// 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();
surface = new DebugAWTSurface(caps);
surface.setClearColor(0.2f, 0.2f, 0.2f, 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);
}
示例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 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(20);
// 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
*
* @param parent The parent widget of the display
*/
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);
}