本文整理匯總了Java中javax.media.opengl.GLCapabilities.setAlphaBits方法的典型用法代碼示例。如果您正苦於以下問題:Java GLCapabilities.setAlphaBits方法的具體用法?Java GLCapabilities.setAlphaBits怎麽用?Java GLCapabilities.setAlphaBits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.media.opengl.GLCapabilities
的用法示例。
在下文中一共展示了GLCapabilities.setAlphaBits方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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);
}
});
}
示例5: NeonNewtWindow
import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
/**
* Constructor for this class. Sets up the window and enables common
* features like anti-aliasing and hardware acceleration.
*
* @param forceGL2ES2
* Force GL2ES2 support (default on), currently Unused
* @param inputHandler
* A predefined InputHandler that is added as event handler for
* input events.
* @param glEventListener
* A predefined GLEventListener that is added as event handler
* for openGL events.
* @param width
* The initial window width.
* @param height
* The initial window height.
* @param windowTitle
* The window title.
*/
public NeonNewtWindow(boolean forceGL2ES2, InputHandler inputHandler, final GLEventListener glEventListener,
int width, int height, String windowTitle) {
GLProfile.initSingleton();
final GLProfile glp;
glp = GLProfile.get(GLProfile.GL3);
// Set up the GL context
final GLCapabilities caps = new GLCapabilities(glp);
caps.setBackgroundOpaque(true);
caps.setHardwareAccelerated(true);
caps.setDoubleBuffered(true);
// Add Anti-Aliasing
caps.setSampleBuffers(true);
caps.setAlphaBits(4);
caps.setNumSamples(4);
GLWindow window = GLWindow.create(caps);
window.addGLEventListener(glEventListener);
window.addWindowListener(new QuitListener());
window.setAutoSwapBufferMode(true);
window.setSize(width, height);
window.setTitle(windowTitle);
window.addMouseListener(inputHandler);
window.addKeyListener(inputHandler);
Animator animator = new Animator();
animator.add(window);
animator.start();
animator.setUpdateFPSFrames(60, null);
window.setVisible(true);
}
示例6: LocalTest
import javax.media.opengl.GLCapabilities; //導入方法依賴的package包/類
public LocalTest( )
{
sim = new Simulation( true );
for( int i = 0; i < 10; i++ )
{
Planet planet = new Planet( sim, new Vector2D( (float)Math.random() * 20000, (float)Math.random() *20000 ), 100, 1, 1, 1, 200 );
planet.setOwner( 1 );
sim.addObject( planet );
planet.spawnTree();
planet.spawnTree();
for( int j = 0; j < 100; j++ )
planet.spawnCreature();
}
GLCapabilities caps = new GLCapabilities();
caps.setRedBits(8);
caps.setGreenBits(8);
caps.setBlueBits(8);
caps.setAlphaBits(8);
caps.setDepthBits(16);
caps.setStencilBits(8);
caps.setNumSamples( 8 );
caps.setDoubleBuffered(true);
GLCanvas canvas = new GLCanvas( caps );
canvas.addGLEventListener(this);
setSize(1024,1024);
setTitle("CAV-Projekt: JOGL - Beispielszene");
getContentPane().add(canvas,BorderLayout.CENTER);
final Animator animator = new Animator( canvas );
animator.setRunAsFastAsPossible( true );
animator.start();
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
animator.stop();
System.exit(0);
}
});
}