本文整理匯總了Java中javax.media.opengl.GLCapabilities.setGreenBits方法的典型用法代碼示例。如果您正苦於以下問題:Java GLCapabilities.setGreenBits方法的具體用法?Java GLCapabilities.setGreenBits怎麽用?Java GLCapabilities.setGreenBits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.media.opengl.GLCapabilities
的用法示例。
在下文中一共展示了GLCapabilities.setGreenBits方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
示例2: 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;
}
示例3: 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);
}
});
}
示例4: 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);
}
});
}