com.jogamp.opengl.GLProfile Java Examples
The following examples show how to use
com.jogamp.opengl.GLProfile.
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: 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 #2
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 #3
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 #4
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 #5
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 #6
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 #7
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 #8
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 #9
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 #10
Source File: GltfViewerJogl.java From JglTF with MIT License | 6 votes |
/** * Create a string with debug information about the given GL instance * * @param glBase The GL instance * @return The string */ private String createGlContextDebugString(GL glBase) { StringBuilder sb = new StringBuilder(); sb.append("GLProfile: " + getGLProfile()).append("\n"); sb.append("Availability:").append("\n"); for (String profile : GLProfile.GL_PROFILE_LIST_ALL) { sb.append(" " + profile + " : " + GLProfile.isAvailable(profile)).append("\n"); } sb.append("Context information:\n" + glBase.getContext().toString()).append("\n"); return sb.toString(); }
Example #11
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 #12
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 #13
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 #14
Source File: JOGLEngine.java From WarpPI with Apache License 2.0 | 6 votes |
@Override public boolean isSupported() { if (StaticVars.startupArguments.isEngineForced() && StaticVars.startupArguments.isGPUEngineForced() == false) return false; boolean available = false; boolean errored = false; try { available = GLProfile.isAvailable(GLProfile.GL2ES2); } catch (final Exception ex) { errored = true; System.err.println("OpenGL Error: " + ex.getMessage()); } if (!available && !errored) System.err.println(GLProfile.glAvailabilityToString()); return available; }
Example #15
Source File: DwGLInfo.java From PixelFlow with MIT License | 5 votes |
static public void getProfiles(){ System.out.println("--------------------------------------------------------------------------------"); System.out.println("GLProfile.GL_PROFILE_LIST_ALL"); String[] profilelist = GLProfile.GL_PROFILE_LIST_ALL; for(int i = 0; i < profilelist.length; i++){ System.out.printf(" [%2d] %6s available: %4s\n",i, profilelist[i], GLProfile.isAvailable(profilelist[i])); } System.out.println("--------------------------------------------------------------------------------"); }
Example #16
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 #17
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 #18
Source File: OpenGLInitializer.java From gama with GNU General Public License v3.0 | 5 votes |
@Override public void run() { // // Necessary to load the native libraries correctly (see // // // http://forum.jogamp.org/Return-of-the-quot-java-lang-UnsatisfiedLinkError-Can-t-load-library-System-Library-Frameworks-glueg-td4034549.html) JarUtil.setResolver(new JarUtil.Resolver() { @Override public URL resolve(final URL url) { try { final URL urlUnescaped = FileLocator.resolve(url); final URL urlEscaped = new URI(urlUnescaped.getProtocol(), urlUnescaped.getPath(), null).toURL(); return urlEscaped; } catch (final IOException ioexception) { return url; } catch (final URISyntaxException urisyntaxexception) { return url; } } }); // Necessary to initialize very early because initializing it // while opening a Java2D view before leads to a deadlock GLProfile.initSingleton(); while (!GLProfile.isInitialized()) { try { Thread.sleep(100); } catch (final InterruptedException e) { e.printStackTrace(); } } isInitialized = true; }
Example #19
Source File: ClearVolumeIcon.java From clearvolume with GNU Lesser General Public License v3.0 | 5 votes |
static public void setIcon() { // attempt at solving Jug's Dreadlock bug: final GLProfile lProfile = GLProfile.getMaxProgrammable(true); // System.out.println( lProfile ); // load icons: ClearGLWindow.setWindowIcons( "clearvolume/icon/ClearVolumeIcon16.png", "clearvolume/icon/ClearVolumeIcon32.png", "clearvolume/icon/ClearVolumeIcon64.png", "clearvolume/icon/ClearVolumeIcon128.png", "clearvolume/icon/ClearVolumeIcon256.png", "clearvolume/icon/ClearVolumeIcon512.png"); }
Example #20
Source File: Test.java From jogl-samples with MIT License | 5 votes |
private GLProfile getGlProfile() { switch (profile) { case ES: switch (major) { case 1: return GLProfile.get(GLProfile.GL2ES1); case 2: return GLProfile.get(GLProfile.GL2ES2); case 3: return GLProfile.get(GLProfile.GL4ES3); default: return GLProfile.getDefault(); } case CORE: switch (major) { case 1: return GLProfile.get(GLProfile.GL2); case 2: return GLProfile.get(GLProfile.GL2); case 3: if (profile == Profile.COMPATIBILITY) { return GLProfile.get(GLProfile.GL3bc); } else { return GLProfile.get(GLProfile.GL3); } case 4: if (profile == Profile.COMPATIBILITY) { return GLProfile.get(GLProfile.GL4bc); } else { return GLProfile.get(GLProfile.GL4); } } } return GLProfile.getDefault(); }
Example #21
Source File: Test.java From jogl-samples with MIT License | 5 votes |
private boolean checkGLVersion() { GLProfile glp = GLProfile.getMaxProgrammableCore(true); // int majorVersionContext = GLContext.getMaxMajor(GLContext.CONTEXT_CURRENT); // int minorVersionContext = GLContext.getMaxMinor(GLContext.CONTEXT_CURRENT, majorVersionContext); // System.out.println("OpenGL Version Needed " + major + "." + minor // + " ( " + majorVersionContext + "," + minorVersionContext + " found)"); System.out.println("OpenGL Version Needed " + major + "." + minor + " ( " + glp.getName() + " found)"); // return version(majorVersionContext[0], minorVersionContext[0]) // >= version(major, minor); return GLContext.isValidGLVersion(GLContext.CONTEXT_CURRENT, major, minor); }
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: 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 #24
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 #25
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 #26
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 #27
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 #28
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 #29
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 #30
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); }