Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Java OpenGL
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Infobox software | name = JOGL | logo = | logo caption = | screenshot = JOGL Refrection Demo Screenshot.png | screenshot size = 200px | caption = A [[demoware|demo]] screenshot illustrating real-time [[refraction]] using '''JOGL''' on [[macOS|Mac OS X]] | developer = [http://jogamp.org/ JogAmp Community] | latest release version = 2.5.0 | latest release date = {{Start date and age|2023|08|18}} | latest preview version = n/a | latest preview date = tbd | programming language = [[Java (programming language)|Java]], [[C (programming language)|C]] | operating system = [[Cross-platform]] | genre = [[3D computer graphics software]] (library/API) | license = [[BSD license]] | website = {{Official URL}} }} '''Java OpenGL''' ('''JOGL''') is a wrapper [[library (computer science)|library]] that allows [[OpenGL]] to be used in the [[Java (programming language)|Java programming language]].<ref>{{cite web |last1=Friesen |first1=Jeff |date=2008-09-18 |df=mdy |url=https://www.infoworld.com/article/2077906/open-source-java-projects-java-binding-for-opengl-jogl.html |title=Open source Java projects: Java Binding for OpenGL (JOGL) |department=Open Source Java Tutorials |work=[[JavaWorld]] |access-date=2020-07-23 |quote=''JOGL originated as a project named Jungle, which was created by 3D graphics experts Ken Russell (of Sun Microsystems) and Chris Kline (of Irrational Games).'' }}</ref><ref>{{cite web |last1=Davis |first1=Gene |date=2005-02-21 |df=mdy |url=https://www.infoworld.com/article/2071845/hello-jogl.html |title=Hello JOGL |work=[[JavaWorld]] |access-date=2020-07-23 }}</ref> It was originally developed by Kenneth Bradley Russell and Christopher John Kline, and was further developed by the Game Technology Group at [[Sun Microsystems]]. Since 2010, it has been an independent [[open-source software|open-source]] project under a [[BSD licenses|BSD license]]. It is the reference implementation for [[Java Bindings for OpenGL]] (JSR-231). JOGL allows access to most OpenGL features available to [[C (programming language)|C]] language programs through the use of the [[Java Native Interface]] (JNI). It offers access to both the standard GL* functions along with the GLU* functions; however the [[OpenGL Utility Toolkit]] (GLUT) library is not available for window-system related calls, as Java has its own windowing systems: [[Abstract Window Toolkit]] (AWT), [[Swing (Java)|Swing]], and some [[OpenGL#Development|extensions]]. ==Design== The base [[OpenGL]] [[C (programming language)|C]] API, as well as its associated [[OpenGL Utility Library|Windowing API]],<ref>{{cite web |url=http://jogamp.org/doc/siggraph2010/jogamp-siggraph2010.pdf |title=3D & Multimedia Across Platforms and Devices Using JOGL |publisher=[[SIGGRAPH]] |date=2010-07-27 |access-date=2011-02-06 }}</ref> are accessed in JOGL via [[Java Native Interface]] (JNI) calls. As such, the underlying system must support OpenGL for JOGL to work. JOGL differs from some other Java OpenGL wrapper libraries in that it merely exposes the procedural OpenGL API via methods on a few classes, rather than trying to map OpenGL functionality onto the [[object-oriented programming]] paradigm. Indeed, most of the JOGL code is autogenerated from the OpenGL C header files via a conversion tool named ''[[GlueGen]]'', which was programmed specifically to facilitate the creation of JOGL. ==Status and standardization== {{As of|2023}}, JOGL provides full access to the [[OpenGL]] 4.5 specification as well as almost all vendor extensions (and [[OpenCL]], [[OpenMAX]] and [[OpenAL]]).<ref>{{cite web |url=http://jogamp.org/jogl/www/ |title = JOGL - Java Binding for the OpenGL API}}</ref> The '''2.5.0''' version is the reference implementation for [[Java Bindings for OpenGL|JSR-231 (Java Bindings for OpenGL)]].<ref>{{cite web |url=http://jcp.org/aboutJava/communityprocess/final/jsr231/index.html |title=JSR-000231 Java Bindings for the OpenGL API |publisher=[[Java Community Process]] |access-date=2011-02-06 |quote=''In order to facilitate maximum community participation for the Java Binding for the OpenGL API, we use the JOGL project on java.net found at jogl.dev.java.net. The JOGL source code can be found there, licensed under a liberal source code license (mostly licensed as BSD except where we use other parties' licensed code). We take a snapshot of the code from this project every few months, run the Technology Compatibility Kit on the source code, and then officially make it the Reference Implementation for each formal Java Binding for the OpenGL API release.'' }}</ref> The '''1.1.1''' release gave limited access to [[OpenGL Utility Library|GLU]] [[Nonuniform rational B-spline|NURBS]], providing rendering of curved lines and surfaces via the traditional GLU APIs. The '''2.3.2''' release added support for OpenGL versions up to 4.5, and OpenGL ES versions up to 3.2. Wayland and Vulkan support is planned.<ref>{{cite web|url=https://jogamp.org/bugzilla/show_bug.cgi?id=794 |title=Bug 794 - Add Wayland Windowing/Surface Interoperability |date=2013-08-05}}</ref> ==Java2D-OpenGL interoperability== Since the [[Java SE 6]] version of the [[Java (programming language)|Java]] language, [[Java2D]] (the [[API]] for drawing two dimensional graphics in Java) and JOGL have become interoperable, allowing it to : * Overlay [[Swing (Java)|Swing]] components (lightweight menus, tooltips, and other [[Widget (computing)|widget]]s) on top of [[OpenGL]] rendering.<ref>{{cite web |url=http://jogamp.org/jogl/doc/userguide/#overview |title = JOGL Userguide}}</ref> * Draw 3D [[OpenGL]] graphics on top of [[Java2D]] rendering (see [https://web.archive.org/web/20080128174107/http://www.curious-creature.org/2005/12/21/a-swing-button-with-3d-source-codedemo/ here] for a button with an OpenGL icon). * Use 3D graphics anywhere where ordinarily a [[Swing (Java)|Swing]] [[Widget (computing)|widget]] would be used. (Inside a JTable, JTree, ...) * Draw [[Java2D]] graphics on top of 3D [[OpenGL]] rendering. ==Tutorials== * [http://jogamp.org/git/?p=jogl-demos.git;a=blob;f=src/demos/es2/RawGL2ES2demo.java;hb=HEAD OpenGL ES 2] sample * [https://github.com/java-opengl-labs/helloTriangle Hello Triangle], gl3 and gl4 Hello Triangle and Texture. The samples are offered in Java and [[Kotlin (programming language)|Kotlin]] * [https://github.com/elect86/jogl-samples Java OpenGL Sample Pack], porting of [http://www.g-truc.net/project-0026.html g-truc OpenGL Sample Pack]. The over 230 samples illustrate almost all OpenGL features ranging from ES 2.0 up to the last GL extensions, same of them usually also called [[AZDO]] (Almost Zero Driver Overhead). * [https://github.com/elect86/modern-jogl-examples modern jogl examples], Porting of ''[https://bitbucket.org/alfonse/gltut/wiki/Home Learning Modern 3D Graphics Programming, Jason L. McKesson] {{Webarchive|url=https://web.archive.org/web/20160923093407/https://bitbucket.org/alfonse/gltut/wiki/Home |date=2016-09-23 }}.'' Java and Kotlin side by side. * [https://jogamp.org/wiki/index.php/Rudimentary_standalone_example_using_the_fixed_pipeline_by_Julien_Gouesse Immediate mode] sample (simplest example, using the [[Fixed-function]] [[graphics pipeline]]) ==Code examples== <syntaxhighlight lang=java> @Override public void display(GLAutoDrawable drawable) { GL4 gl4 = drawable.getGL().getGL4(); gl4.glClearBufferfv(GL2ES3.GL_COLOR, 0, clearColor); gl4.glClearBufferfv(GL2ES3.GL_DEPTH, 0, clearDepth); { FloatUtil.makeLookAt(view, 0, eye, 0, at, 0, up, 0, tmp); FloatUtil.makePerspective(projection, 0, reset, 45f, aspect, near, far); FloatUtil.multMatrix(projection, view); // projection *= view transformPointer.asFloatBuffer().put(projection); } gl4.glUseProgram(programName); gl4.glBindVertexArray(vertexArrayName.get(0)); gl4.glBindBufferBase(GL2ES3.GL_UNIFORM_BUFFER /*target*/, 1 /*TRANSFORM0, index*/, bufferName.get(2) /*TRANSFORM, buffer*/); gl4.glBindTextureUnit(0 /*diffuse*/, textureName.get(0)); gl4.glBindSampler(0 /*diffuse*/, samplerName.get(0)); gl4.glDrawElements(GL.GL_TRIANGLES, elementCount, GL.GL_UNSIGNED_SHORT, 0); } </syntaxhighlight> ==See also== {{Portal|Free and open-source software|Computer programming}} * [[Java Bindings for OpenGL]], The Java Community Specification Request for which JOGL provides an implementation * [[Ardor3D]], a high performance, professionally oriented scene graph using several bindings for OpenGL and OpenGL-ES including JOGL * [[JMonkey Engine]], a high performance scene graph based graphics API using several bindings for OpenGL and OpenGL-ES including JOGL * [[Poxnora]], an online multiplayer game using JOGL * [[RuneScape]], a MMORPG using JOGL * [[Jake2]], a Java port of [[Quake II]] using several bindings for OpenGL including JOGL for its low-level graphic API * [[Scilab]], a numerical computing program using JOGL for 2D, 3D rendering * [[ClearVolume]], a JOGL powered real-time live 3D visualization library designed for high-end volumetric [[Light sheet fluorescence microscopy|light sheet microscopes]]. * [[Lightweight Java Game Library|LWJGL]], an alternative open-source OpenGL wrapper library * [[Java OpenAL]] ==References== {{Reflist|30em}} ==External links== * {{Official website}} * [http://jogamp.org/deployment/jogamp-current/javadoc/jogl/javadoc/ JOGL 2.3.x Specification] * [http://www.jcp.org/en/jsr/detail?id=231 JSR-231 Java Bindings for OpenGL] website * [http://ak.kiet.le.googlepages.com/theredbookinjava.html tool kiet] {{Webarchive|url=https://web.archive.org/web/20090209203335/http://ak.kiet.le.googlepages.com/theredbookinjava.html |date=2009-02-09 }}, The OpenGL Programming Guide examples using JOGL * [https://web.archive.org/web/20071126072642/http://nehe.gamedev.net/ NeHe's tutorials and sample code] * [http://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE Setting up a JogAmp JOGL project in your favorite IDE] * [http://demo.dzzd.net/Viewer3D/ Viewer3D], an applet to display interactive 3D content with JOGL * [http://sourceforge.net/projects/eclipse-opengl/ Eclipse OpenGL Pack] OpenGL plugin for the [[Eclipse (software)|Eclipse]] IDE {{Java desktop}} [[Category:3D graphics software]] [[Category:Java (programming language) libraries]] [[Category:OpenGL]] [[Category:Software using the BSD license]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:As of
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Java desktop
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Template other
(
edit
)
Template:Webarchive
(
edit
)