本文整理汇总了Java中javax.media.opengl.GLProfile.get方法的典型用法代码示例。如果您正苦于以下问题:Java GLProfile.get方法的具体用法?Java GLProfile.get怎么用?Java GLProfile.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.opengl.GLProfile
的用法示例。
在下文中一共展示了GLProfile.get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initUI
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
private void initUI() {
this.width = 600;
this.height = 400;
GLCapabilities config = new GLCapabilities(GLProfile.get(GLProfile.GL2));
config.setSampleBuffers(true);
config.setNumSamples(4);
GLCanvas canvas = new GLCanvas(config);
canvas.addGLEventListener(this);
usi.init(canvas);
JFrame frame = new JFrame("JOGL-JOCL Interoperability Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(canvas);
frame.setSize(width, height);
frame.setVisible(true);
}
示例2: MainWindow
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public MainWindow(CSpaceViewer viewer) {
GLProfile glp = GLProfile.get(GLProfile.GL2);
GLCapabilities glc = new GLCapabilities(glp);
glc.setSampleBuffers(true);
glc.setNumSamples(8);
glc.setDepthBits(32);
canvas = new GLCanvas(glc);
animator = new FPSAnimator(canvas, 60);
toolBar = new MainToolBar(viewer);
setTitle("Configuration Space Visualization");
setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1280, 720);
setLocationRelativeTo(null);
getContentPane().add(toolBar, BorderLayout.SOUTH);
getContentPane().add(canvas, BorderLayout.CENTER);
canvas.addGLEventListener(emptyScene);
animator.start();
}
示例3: FeaturePointsCanvas
import javax.media.opengl.GLProfile; //导入方法依赖的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();
}
示例4: main
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
GLProfile.get(GLProfile.GL2);
System.out.println("ok");
// Setup Synthetizer with pitch/amplitude display
// play("data/analyses/", "piano", 35);
play("data/analyses/", "doremi", 15);
}
示例5: NeonNewtWindow
import javax.media.opengl.GLProfile; //导入方法依赖的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: init
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public void init(GLAutoDrawable drawable) {
GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities caps = new GLCapabilities(profile);
caps.setHardwareAccelerated(true);
caps.setDoubleBuffered(true);
GL2 gl = drawable.getGL().getGL2();
System.err.println("INIT GL IS: " + gl.getClass().getName());
gl.glClearColor(0.250f, 0.250f, 0.250f, 0.0f);
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_CULL_FACE);
gl.glCullFace(GL.GL_BACK);
gl.glPolygonMode(GL.GL_FRONT, GL2.GL_FILL);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL.GL_BLEND);
// gl.glDisable(gl.GL_COLOR_MATERIAL);
camera = new Camera(0, 2, 5, 0, 2.5f, 0, 0, 1, 0);
renderMap = new RenderMap();
renderMap.init(gl, camera, fm);
renderWater = new RenderWater();
renderWater.init(gl, fm);
renderCars = new RenderVehicles();
renderCars.init(gl, fm);
// setup the selection buffer
selectBuf = new int[512];
selectBuffer = Buffers.newDirectIntBuffer(512);
}
示例7: main
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
GLProfile.get(GLProfile.GL2);
// play("data/analyses/", "piano", 35);
play("data/analyses/", "doremi", 15);
}
示例8: main
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
GLProfile.get(GLProfile.GL2);
// play("data/analyses/", "piano", 35);
play("data/analyses/", "voice1", 15);
}
示例9: initGL
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
/**
* Initialise the JOGL Window
*/
private void initGL()
{
// Get the OpenGL profile and its capabilities.
// Tries to get OpenGL 3
final GLProfile glp = GLProfile.get( GLProfile.GL2 );
final GLCapabilities caps = new GLCapabilities( glp );
// Get the display
final Display dpy = NewtFactory.createDisplay( null );
// Get the screen on the display (defaults to the first screen)
final Screen screen = NewtFactory.createScreen( dpy, this.screenIdx );
// Create a window
this.glWindow = GLWindow.create( screen, caps );
// Set the size and position of the window
this.glWindow.setSize( this.width, this.height );
if( null != this.wpos ) this.glWindow.setPosition( this.wpos.getX(), this.wpos.getY() );
// Set the properties of the window
this.glWindow.setUndecorated( this.undecorated );
this.glWindow.setAlwaysOnTop( this.alwaysOnTop );
this.glWindow.setFullscreen( this.fullscreen );
this.glWindow.setPointerVisible( this.mouseVisible );
this.glWindow.confinePointer( this.mouseConfined );
// Add a listener to kill the app once the window is closed
this.glWindow.addWindowListener( new WindowAdapter()
{
@Override
public void windowDestroyNotify(final WindowEvent e)
{
System.exit(1);
};
} );
// Show the window
this.glWindow.setVisible( true );
}
示例10: main
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String [] args) {
GLProfile.initSingleton( );
GLProfile glprofile = GLProfile.get( GLProfile.GL2 );
Display display = new Display();
Shell shell = new Shell( display );
shell.setLayout( new FillLayout() );
Composite composite = new Composite( shell, SWT.NONE );
composite.setLayout( new FillLayout() );
GLData gldata = new GLData();
gldata.doubleBuffer = true;
// need SWT.NO_BACKGROUND to prevent SWT from clearing the window
// at the wrong times (we use glClear for this instead)
final GLCanvas glcanvas = new GLCanvas( composite, SWT.NO_BACKGROUND, gldata );
glcanvas.setCurrent();
final GLContext glcontext = GLDrawableFactory.getFactory( glprofile ).createExternalGLContext();
// fix the viewport when the user resizes the window
glcanvas.addListener( SWT.Resize, new Listener() {
public void handleEvent(Event event) {
setup( glcanvas, glcontext );
}
});
// draw the triangle when the OS tells us that any part of the window needs drawing
glcanvas.addPaintListener( new PaintListener() {
public void paintControl( PaintEvent paintevent ) {
render( glcanvas, glcontext );
}
});
shell.setText( "OneTriangle" );
shell.setSize( 640, 480 );
shell.open();
while( !shell.isDisposed() ) {
if( !display.readAndDispatch() )
display.sleep();
}
glcanvas.dispose();
display.dispose();
}
示例11: TestJogl
import javax.media.opengl.GLProfile; //导入方法依赖的package包/类
public TestJogl() {
GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
caps.setDoubleBuffered(true);
GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle("jogl-triangle-color");
glWindow.setSize(800, 800);
glWindow.setFullscreen(false);
glWindow.setUndecorated(false);
glWindow.setPointerVisible(true);
glWindow.setVisible(true);
renderer = new Renderer(glWindow);
glWindow.addGLEventListener(renderer);
}