请输入您要查询的百科知识:

 

词条 Java OpenGL
释义

  1. Design

  2. Status and standardization

  3. Java2D-OpenGL interoperability

  4. Tutorials

  5. Code examples

  6. See also

  7. References

  8. External links

{{Infobox software
| name = JOGL
| logo =
| logo caption =
| screenshot = JOGL Refrection Demo Screenshot.png
| screenshot size = 200px
| caption = A demo screenshot illustrating real-time refraction using JOGL on Mac OS X
| developer = JogAmp Community
| latest release version = 2.3.2
| latest release date = {{Start date and age|2015|10|10}}
| latest preview version = 2.3.2
| latest preview date = {{Start date and age|2015|10|10}}
| programming language = Java, C
| operating system = Cross-platform
| genre = 3D computer graphics software (library/API)
| license = BSD license
| website = {{URL|http://jogamp.org}}
}}

Java OpenGL (JOGL) is a wrapper library that allows OpenGL to be used in the Java programming language.[1][2] It was originally developed by Kenneth Bradley Russell and Christopher John Kline, and was further developed by the Sun Microsystems Game Technology Group. Since 2010, it has been an independent open-source project under a BSD license. It is the reference implementation for Java Bindings for OpenGL (JSR-231).

JOGL allows access to most OpenGL features available to 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, and some extensions.

Design

The base OpenGL C API, as well as its associated Windowing API,[3] 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|2015}}, JOGL provides full access to the OpenGL 4.5 specification as well as almost all vendor extensions (and OpenCL, OpenMAX and OpenAL).[4] The 1.1.0 version is the reference implementation for JSR-231 (Java Bindings for OpenGL).[5] The 1.1.1 release gave limited access to GLU 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.[6]

Java2D-OpenGL interoperability

Since the Java SE 6 version of the Java language, Java2D (the API for drawing two dimensional graphics in Java) and JOGL have become interoperable, allowing it to :

  • Overlay Swing components (lightweight menus, tooltips, and other widgets) on top of OpenGL rendering.[7]
  • Draw 3D OpenGL graphics on top of Java2D rendering (see here for a button with an OpenGL icon).
  • Use 3D graphics anywhere where ordinarily a Swing widget would be used. (Inside a JTable, JTree, ...)
  • Draw Java2D graphics on top of 3D OpenGL rendering.

Tutorials

  • 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
  • [https://github.com/elect86/jogl-samples Java OpenGL Sample Pack], porting of 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]. 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 pipeline)

Code examples

    @Override    public void display(GLAutoDrawable drawable) {
        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);
            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);    }

See also

{{Portal|Free and open-source software|Java (programming language)}}
  • 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
  • Elflight Engine, a high performance 3D game engine optimised for the web
  • 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
  • Jreality, a mathematical visualization package
  • ClearVolume, a JOGL powered real-time live 3D visualization library designed for high-end volumetric light sheet microscopes.
  • LWJGL, an alternative open-source OpenGL wrapper library
  • Java OpenAL
  • Java OpenCL

References

1. ^{{cite web| url=http://www.javaworld.com/javaworld/jw-09-2008/jw-09-opensourcejava-jogl.html| title=Open source Java projects: Java Binding for OpenGL (JOGL)| publisher=JavaWorld| date=2008-09-18| 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).| accessdate=2011-02-06}}
2. ^{{cite web| url=http://www.javaworld.com/javaworld/jw-02-2005/jw-0221-jogl.html| title=Hello JOGL| publisher=JavaWorld| date=2005-02-21| accessdate=2011-02-06}}
3. ^{{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| accessdate=2011-02-06}}
4. ^http://jogamp.org/jogl/www/
5. ^{{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| 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 https://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.| accessdate=2011-02-06}}
6. ^{{cite web|url=https://jogamp.org/bugzilla/show_bug.cgi?id=794 |title=Bug 794 - Add Wayland Windowing/Surface Interoperability |date=2013-08-05}}
7. ^http://jogamp.org/jogl/doc/userguide/#overview

External links

  • {{Official website|http://jogamp.org}}
  • JOGL 2.3.x Specification
  • JSR-231 Java Bindings for OpenGL website
  • tool kiet, The OpenGL Programming Guide examples using JOGL
  • NeHe's tutorials and sample code
  • Setting up a JogAmp JOGL project in your favorite IDE
  • Viewer3D, an applet to display interactive 3D content with JOGL
  • Eclipse OpenGL Pack OpenGL plugin for the Eclipse IDE

4 : 3D graphics software|Java (programming language) libraries|Java APIs|OpenGL

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 22:45:54