com.jogamp.opengl.GLCapabilities Java Examples
The following examples show how to use
com.jogamp.opengl.GLCapabilities.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GLForm.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public GLForm(Plot3DGL plt) { this.plt = plt; final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); glcp = new GLChartPanel(cap, plt); glcp.setSize(400, 400); this.getContentPane().add(glcp); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(); } }); glcp.animator_start(); }
Example #2
Source File: GltfViewerJogl.java From JglTF with MIT License | 6 votes |
/** * Creates a new GltfViewerJogl */ public GltfViewerJogl() { GLProfile profile = getGLProfile(); logger.config("GLProfile: " + profile); GLCapabilities capabilities = new GLCapabilities(profile); capabilities.setNumSamples(2); capabilities.setSampleBuffers(true); glComponent = new GLCanvas(capabilities); glComponent.addGLEventListener(glEventListener); // Without setting the minimum size, the canvas cannot // be resized when it is embedded in a JSplitPane glComponent.setMinimumSize(new Dimension(10, 10)); glContext = new GlContextJogl(); }
Example #3
Source File: JCuboid.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JCuboid cuboid = new JCuboid(); gc.addGLEventListener(cuboid); gc.setSize(100, 100); final JFrame frame = new JFrame(" JOGL Cuboid"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 300, true); animator.start(); }
Example #4
Source File: JRotation.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JRotation jr = new JRotation(); gc.addGLEventListener(jr); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Rotation"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 400, true); animator.start(); }
Example #5
Source File: J3DBasic.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); J3DBasic b = new J3DBasic(); gc.addGLEventListener(b); gc.setSize(600, 400); final JFrame frame = new JFrame("JOGL 3D"); frame.getContentPane().add(gc); frame.setSize(frame.getContentPane().getPreferredSize()); frame.setVisible(true); }
Example #6
Source File: CubeSample2.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public CubeSample2() { GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2)); glu = new GLU(); glWindow = GLWindow.create(caps); glWindow.setTitle("Cube demo (Newt)"); glWindow.setSize(300, 300); glWindow.addGLEventListener(this); glWindow.addWindowListener(new WindowAdapter() { @Override public void windowDestroyed(WindowEvent arg0) { System.exit(0); } }); glWindow.addMouseListener(this); glWindow.addKeyListener(this); //animator = new FPSAnimator(30); animator = new FPSAnimator(glWindow, 30, false); animator.add(glWindow); animator.start(); animator.pause(); glWindow.setVisible(true); }
Example #7
Source File: Triangle.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); Triangle tr = new Triangle(); gc.addGLEventListener(tr); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Triangle"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowevent) { frame.dispose(); System.exit(0); } }); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }
Example #8
Source File: J3DTriangle.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); J3DTriangle triangle = new J3DTriangle(); gc.addGLEventListener(triangle); gc.setSize(400, 400); final JFrame frame = new JFrame("3D Triangle"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 400, true); animator.start(); }
Example #9
Source File: Rhombus.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { //getting the capabilities object of GL2 profile final GLProfile profile = GLProfile.get(GLProfile.GL2); GLCapabilities capabilities = new GLCapabilities(profile); // The canvas final GLCanvas glcanvas = new GLCanvas(capabilities); Rhombus b = new Rhombus(); glcanvas.addGLEventListener(b); glcanvas.setSize(400, 400); //creating frame final JFrame frame = new JFrame(" Rhombus 3d"); //adding canvas to it frame.getContentPane().add(glcanvas); frame.setSize(frame.getContentPane().getPreferredSize()); frame.setVisible(true); }
Example #10
Source File: J3DCube.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLJPanel gc = new GLJPanel(cap); J3DCube cube = new J3DCube(); gc.addGLEventListener(cube); gc.setSize(400, 400); final JFrame frame = new JFrame(" 3D cube"); frame.add(gc); frame.setSize(600, 500); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 200, true); animator.start(); }
Example #11
Source File: JPaddle.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JPaddle paddle = new JPaddle(); gc.addGLEventListener(paddle); gc.setSize(400, 400); final JFrame frame = new JFrame("Motor Paddle"); frame.add(gc); frame.setSize(600, 500); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 200, true); animator.start(); }
Example #12
Source File: JLight.java From MeteoInfo with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JLight tr = new JLight(); gc.addGLEventListener(tr); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Lighting"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); final FPSAnimator animator = new FPSAnimator(gc, 400, true); animator.start(); }
Example #13
Source File: TestRegionRendererNEWT01.java From jogl-samples with MIT License | 5 votes |
@Test public void test10RegionRendererMSAA01() throws InterruptedException { final GLProfile glp = GLProfile.get(GLProfile.GL2ES2); final GLCapabilities caps = new GLCapabilities(glp); // caps.setOnscreen(false); caps.setAlphaBits(4); caps.setSampleBuffers(true); caps.setNumSamples(4); final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false); demo01Listener.attachInputListenerTo(window); window.addGLEventListener(demo01Listener); final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01"); window.addGLEventListener(listener); listener.setTech(-20, 00, -300, 0f, 2); window.display(); listener.setTech(-20, 00, -150, 0f, 3); window.display(); listener.setTech(-20, 00, -50, 0f, 4); window.display(); destroyWindow(window); }
Example #14
Source File: JCudaDriverSimpleJOGL.java From jcuda-samples with MIT License | 5 votes |
/** * Entry point for this sample. * * @param args not used */ public static void main(String args[]) { GLProfile profile = GLProfile.get(GLProfile.GL3); final GLCapabilities capabilities = new GLCapabilities(profile); SwingUtilities.invokeLater(new Runnable() { public void run() { new JCudaDriverSimpleJOGL(capabilities); } }); }
Example #15
Source File: UINewtDemo01.java From jogl-samples with MIT License | 5 votes |
public static void main(final String[] args) { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); caps.setAlphaBits(4); caps.setSampleBuffers(true); caps.setNumSamples(4); System.out.println("Requested: " + caps); final GLWindow window = GLWindow.create(caps); window.setPosition(10, 10); window.setSize(800, 400); window.setTitle("GPU UI Newt Demo 01"); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE); uiGLListener.attachInputListenerTo(window); window.addGLEventListener(uiGLListener); window.setVisible(true); final Animator animator = new Animator(); animator.setUpdateFPSFrames(60, System.err); animator.add(window); window.addKeyListener(new KeyAdapter() { public void keyPressed(final KeyEvent arg0) { if(arg0.getKeyCode() == KeyEvent.VK_F4) { window.destroy(); } } }); window.addWindowListener(new WindowAdapter() { public void windowDestroyed(final WindowEvent e) { animator.stop(); } }); animator.start(); }
Example #16
Source File: TestRegionRendererNEWT01.java From jogl-samples with MIT License | 5 votes |
public void test00RegionRendererNONE01() throws InterruptedException { final GLProfile glp = GLProfile.get(GLProfile.GL2ES2); final GLCapabilities caps = new GLCapabilities(glp); // caps.setOnscreen(false); caps.setAlphaBits(4); final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false); demo01Listener.attachInputListenerTo(window); window.addGLEventListener(demo01Listener); final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01"); window.addGLEventListener(listener); listener.setTech(-20, 0, -300, 0f, 2); window.display(); listener.setTech(-20, 0, -150, 0f, 3); window.display(); listener.setTech(-20, 0, -50, 0f, 4); window.display(); destroyWindow(window); }
Example #17
Source File: TestRegionRendererNEWT01.java From jogl-samples with MIT License | 5 votes |
public void test01RegionRendererNONE02() throws InterruptedException { if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet! System.err.println("disabled on non desktop (x86) arch for now .."); return; } final GLProfile glp = GLProfile.get(GLProfile.GL2ES2); final GLCapabilities caps = new GLCapabilities(glp); caps.setAlphaBits(4); final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false); demo01Listener.attachInputListenerTo(window); window.addGLEventListener(demo01Listener); final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02"); window.addGLEventListener(listener); listener.setTech(-20, 0, -300, 0f, 2); window.display(); listener.setTech(-20, 0, -150, 0f, 3); window.display(); listener.setTech(-20, 0, -50, 0f, 4); window.display(); destroyWindow(window); }
Example #18
Source File: NBodyVisualizer.java From gpu-nbody with MIT License | 5 votes |
public static void main(final String args[]) { final GLProfile profile = GLProfile.get(GLProfile.GL3); final GLCapabilities capabilities = new GLCapabilities(profile); SwingUtilities.invokeLater(new Runnable() { public void run() { new NBodyVisualizer(capabilities); } }); }
Example #19
Source File: TestRegionRendererNEWT01.java From jogl-samples with MIT License | 5 votes |
public void test11RegionRendererMSAA02() throws InterruptedException { if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet! System.err.println("disabled on non desktop (x86) arch for now .."); return; } final GLProfile glp = GLProfile.get(GLProfile.GL2ES2); final GLCapabilities caps = new GLCapabilities(glp); caps.setAlphaBits(4); caps.setSampleBuffers(true); caps.setNumSamples(4); final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false); demo01Listener.attachInputListenerTo(window); window.addGLEventListener(demo01Listener); final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02"); window.addGLEventListener(listener); listener.setTech(-20, 00, -300, 0f, 2); window.display(); listener.setTech(-20, 00, -150, 0f, 3); window.display(); listener.setTech(-20, 00, -50, 0f, 4); window.display(); destroyWindow(window); }
Example #20
Source File: TestRegionRendererNEWT01.java From jogl-samples with MIT License | 5 votes |
@Test public void test20RegionRendererR2T01() throws InterruptedException { if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). System.err.println("disabled on non desktop (x86) arch for now .."); return; } final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); //caps.setOnscreen(false); caps.setAlphaBits(4); final GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400); final RenderState rs = RenderState.createRenderState(SVertex.factory()); final GPURegionGLListener02 demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 4, false, false); demo02Listener.attachInputListenerTo(window); window.addGLEventListener(demo02Listener); final RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02"); window.addGLEventListener(listener); listener.setTech(-20, 00, -300, 0f, 2); window.display(); listener.setTech(-20, 00, -150, 0f, 3); window.display(); listener.setTech(-20, 00, -50, 0f, 4); window.display(); destroyWindow(window); }
Example #21
Source File: DelaunayTriangulationExample.java From delaunay-triangulator with MIT License | 5 votes |
public static void main(String[] args) { Frame frame = new Frame("Delaunay Triangulation Example"); frame.setResizable(false); GLCapabilities caps = new GLCapabilities(GLProfile.get("GL2")); caps.setSampleBuffers(true); caps.setNumSamples(8); GLCanvas canvas = new GLCanvas(caps); DelaunayTriangulationExample ex = new DelaunayTriangulationExample(); MouseListener lister = ex; canvas.addGLEventListener(ex); canvas.setPreferredSize(DIMENSION); canvas.addMouseListener(lister); frame.add(canvas); final FPSAnimator animator = new FPSAnimator(canvas, 25); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start(); } }); frame.setVisible(true); frame.pack(); animator.start(); }
Example #22
Source File: SWTOpenGLDisplaySurface.java From gama with GNU General Public License v3.0 | 5 votes |
public GLCanvas createCanvas(final Composite parent) { final GLProfile profile = GLProfile.getDefault(); final GLCapabilities cap = new GLCapabilities(profile); cap.setDepthBits(24); cap.setDoubleBuffered(true); cap.setHardwareAccelerated(true); cap.setSampleBuffers(true); cap.setAlphaBits(8); cap.setNumSamples(8); final GLCanvas canvas = new GLCanvas(parent, SWT.NONE, cap, null) { @SuppressWarnings ("restriction") @Override public Rectangle getClientArea() { // see Issue #2378 // if (isWindows() || isLinux()) { return autoScaleUp(super.getClientArea()); } return super.getClientArea(); } }; canvas.setAutoSwapBufferMode(true); final SWTGLAnimator animator = new SWTGLAnimator(canvas); animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null); renderer.setCanvas(canvas); final FillLayout gl = new FillLayout(); canvas.setLayout(gl); return canvas; }
Example #23
Source File: JOGLContextCreator.java From settlers-remake with MIT License | 5 votes |
@Override public void initSpecific() { GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); caps.setStencilBits(1); canvas = new GLJPanel(caps); ((GLJPanel)canvas).addGLEventListener(this); new GOSwingEventConverter(canvas, parent); }
Example #24
Source File: Tessellation.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public Tessellation() { super("tess");// name of file as title in window bar /* * display mode (single buffer and RGBA) */ final GLProfile profile = GLProfile.get(GLProfile.GL2); caps = new GLCapabilities(profile); caps.setDoubleBuffered(false); System.out.println(caps.toString()); canvas = new GLJPanel(caps); canvas.addGLEventListener(this); canvas.addKeyListener(this); getContentPane().add(canvas); }
Example #25
Source File: BasicLine1.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLJPanel gc = new GLJPanel(cap); BasicLine1 bl = new BasicLine1(); gc.addGLEventListener(bl); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Line"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }
Example #26
Source File: ColorStateTest.java From jtk with Apache License 2.0 | 5 votes |
private static void initGL() { _window = NewtFactory.createWindow( new GLCapabilities(GLProfile.getDefault())); assertNotNull(_window); _glWindow = GLWindow.create(_window); assertNotNull(_glWindow); _glWindow.setVisible(true); _glContext = _glWindow.getContext(); assertNotNull(_glContext); _glContext.makeCurrent(); }
Example #27
Source File: JQuad.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JQuad jq = new JQuad(); gc.addGLEventListener(jq); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Primitive Quadrilateral"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }
Example #28
Source File: JColor.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JColor jc = new JColor(); gc.addGLEventListener(jc); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Coloring"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }
Example #29
Source File: JScaling.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLCanvas gc = new GLCanvas(cap); JScaling js = new JScaling(); gc.addGLEventListener(js); gc.setSize(400, 400); final JFrame frame = new JFrame("After Scaling"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }
Example #30
Source File: BasicLine.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public static void main(String[] args) { final GLProfile gp = GLProfile.get(GLProfile.GL2); GLCapabilities cap = new GLCapabilities(gp); final GLJPanel gc = new GLJPanel(cap); BasicLine bl = new BasicLine(); gc.addGLEventListener(bl); gc.setSize(400, 400); final JFrame frame = new JFrame("JOGL Line"); frame.add(gc); frame.setSize(500, 400); frame.setVisible(true); }