lwjgl3

授权协议 BSD-3-Clause License
开发语言 C/C++
所属分类 程序开发、 图形/图像处理
软件类型 开源软件
地区 不详
投 递 者 益阳平
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Maven CentralAPI JavadocLicense

Backers on Open CollectiveSponsors on Open CollectiveSizeBuild Status

LWJGL - Lightweight Java Game Library 3

LWJGL (https://www.lwjgl.org) is a Java library that enables cross-platformaccess to popular native APIs useful in the development of graphics(OpenGL/Vulkan), audio (OpenAL) and parallel computing (OpenCL) applications.This access is direct and high-performance, yet also wrapped in a type-safeand user-friendly layer, appropriate for the Java ecosystem.

LWJGL is an enabling technology and provides low-level access. It is not aframework and does not provide higher-level utilities than what the nativelibraries expose. As such, novice programmers are encouraged to try one ofthe frameworks or game engines that make use of LWJGL, before workingdirectly with the library.

LWJGL is open source software and freely available at no charge.

Useful links:

Contact:

If you'd like to contribute, see doc/READMEfor a quick overview of the project structure, installation instructions andconfiguration options.

Getting Started

As of version 3.1.0, LWJGL is distributed as a set of modules. Only thecore module is required and all bindings are optional (but some bindingsdepend on other bindings). The easiest way to download LWJGL is to use thebuild configurator on the website.

The build configurator generates Maven & Gradle declarations that can beadded to existing projects. This is the easiest way to use LWJGL whiledeveloping.

LWJGL can also be downloaded as a simple set of JAR files. Each moduleconsists of the following files:

  • lwjgl-<module>.jar
  • lwjgl-<module>-sources.jar
  • lwjgl-<module>-javadoc.jar
  • lwjgl-<module>-natives-<platform>.jar (for some bindings)

To compile and run an LWJGL application, the base and natives JAR files ofthe core module and each binding used should be added to the classpath. LWJGLextracts the natives to a temporary folder and loads them automatically, sono further configuration is necessary. If more customization is required(e.g. when creating a platform-specific installer) the natives may beextracted manually and loaded via java.library.path. See the Configurationclass for more options.

LWJGL 3 requires Java 8 or later to build and run and currently supports thefollowing platforms/architectures:

  • Linux x64
  • Linux arm64 (ARMv8/AArch64)
  • Linux arm32 (ARMv7/armhf)
  • macOS x64
  • Windows x64
  • Windows x86

Example code:

For migrating LWJGL 2 code to LWJGL 3, see the Migration Guide.

Troubleshooting

Most common issues faced by LWJGL users are trivially addressed with thefollowing:

LWJGLX/debug is a Java Agent that willautomatically detect a lot of these issues. It can also generate a trace logthat's useful when reporting issues to LWJGL.

When asking for help or when you suspect a bug in LWJGL, preparing an MVCE(Minimal, Complete, and Verifiable example) that reproduces the issue willimprove the chances of a quick and useful response.

List of Supported Bindings

Khronos APIs

Library Description
EGL An interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.
OpenCL An open, royalty-free standard for cross-platform, parallel programming of diverse processors found in personal computers, servers, mobile devices and embedded platforms.
OpenGL The most widely adopted 2D and 3D graphics API in the industry, bringing thousands of applications to a wide variety of computer platforms.
OpenGL ES A royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles.
Vulkan A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

Display and Input

Library Description
GLFW Create multiple windows, handle user input (keyboard, mouse, gaming peripherals) and manage contexts. Also features multi-monitor support, clipboard access, file drag-n-drop, and much more.
JAWT The AWT native interface.
nfd A tiny, neat C library that portably invokes native file open and save dialogs.
tinyfd A native dialog library.

Audio

Library Description
OpenAL A cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications.
OpenAL Soft An LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.
Opus A totally open, royalty-free, highly versatile audio codec.

Graphics

Library Description
Assimp A portable Open Source library to import various well-known 3D model formats in a uniform manner.
bgfx Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library, licensed under permissive BSD-2 clause open source license.
DriftFX A library that allows you to render any OpenGL content directly into JavaFX nodes.
LibOVR The API of the Oculus SDK.
meshoptimizer A mesh optimization library that makes meshes smaller and faster to render.
NanoSVG A simple stupid SVG parser.
NanoVG A small antialiased vector graphics rendering library for OpenGL.
Nuklear A minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain.
par_shapes Generate parametric surfaces and other simple shapes.
par_streamlines Triangulate wide lines and curves.
OpenVR An API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.
Shaderc A collection of libraries for shader compilation.
SPIRV-Cross A library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
Tiny OpenEXR A small, single header-only library to load and save OpenEXR(.exr) images.
Tootle (AMD) A 3D triangle mesh optimization library that improves on existing mesh preprocessing techniques.
Vulkan Memory Allocator An easy to integrate Vulkan memory allocation library.
Yoga An open-source, cross-platform layout library that implements Flexbox.

stb - single-file public domain libraries for C/C++

Library Description
stb_easy_font Quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc.
stb_image Image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC
stb_image_resize Resize images larger/smaller with good quality.
stb_image_write Image writing to disk: PNG, TGA, BMP
stb_perlin Revised Perlin noise (3D input, 1D output).
stb_rect_pack Simple 2D rectangle packer with decent quality.
stb_truetype Parse, decode, and rasterize characters from truetype fonts.
stb_vorbis Decode ogg vorbis files from file/memory to float/16-bit signed output.

Other

Library Description
Bullet Physics Real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
CUDA A parallel computing platform and programming model developed by NVIDIA for general computing on GPUs.
jemalloc A general purpose malloc implementation that emphasizes fragmentation avoidance and scalable concurrency support.
libffi A portable, high level programming interface to various calling conventions.
libdivide A library that replaces expensive integer divides with comparatively cheap multiplication and bitshifts.
LLVM A collection of modular and reusable compiler and toolchain technologies.
LMDB An extraordinarily fast, memory-efficient database. With memory-mapped files, it has the read performance of a pure in-memory database while retaining the persistence of standard disk-based databases.
LZ4 A lossless data compression algorithm that is focused on compression and decompression speed.
Meow hash An extremely fast non-cryptographic hash.
ODBC A C programming language interface that makes it possible for applications to access data from a variety of database management systems (DBMSs).
Remotery A realtime CPU/GPU profiler hosted in a single C file with a viewer that runs in a web browser.
rpmalloc A public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C.
xxHash An Extremely fast Hash algorithm, running at RAM speed limits.
Zstandard (zstd) A fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios.

Use of a binding is subject to the terms of the corresponding license.

Supporting this project

LWJGL exists thanks to all the people who contribute and back/sponsor our collective.

Our gold sponsors:

  • 【Java基础】之3种随机数的生成方法   目录                   前言: 第一种:new Random(); 第二种:Math.random(); 第三种:currentTimeMillis(); 前言:         生成指定范围内的随机数是最常用的技术之一。程序员希望通过随机数的方式来处理众多的业务逻辑,测试过程中也希望通过随机数的方式生成包含大量数字的测试用例。    

  • 游戏循环 在本章节中,将用游戏循环开发一个游戏引擎。游戏循环是每个游戏的核心组件。游戏循环是一个负责周期性地处理用户输入、更新游戏状态以及渲染至屏幕的死循环。 下述代码片段展示了一个游戏循环的结构: while (keepOnRunning) { handleInput(); updateGameState(); render(); } 所以,上述代码是全部吗?我们完成了

  • 这是我的FPS风格相机的基础代码片段.如您所见,我正在沿着屏幕中心沿X和Y轴计算鼠标位置的增量. 您可以在我的System.out.println中看到我为增量计算的值,以及它应按此量旋转的事实.然后,我将这些值乘以我的灵敏度,然后将相机旋转这个量. import org.lwjgl.BufferUtils; import org.lwjgl.Sys; import org.lwjgl.glfw.

  • Java不直接支持指针,因此LWJGL使用缓冲区作为变通方法.这些只是包装一个可以通过对象上的方法读取和写入的内存地址.这允许您将缓冲区传递给将值写入其中的函数,以便您可以读取这些值. 这里的关键点是你实际上必须事先创建一个缓冲区来存储值. public static double getCursorPosX(long windowID) { DoubleBuffer posX = BufferU

 相关资料
  • 我正在学习一个关于在屏幕上渲染文本的教程,但我似乎找不到加载字体纹理的有效方法。我尝试了slick库,但它已经过时了:它使用lwjgl2的方法,lwjgl3中不再存在,因此它抛出了一个java。lang.NoSuchMethodError。在互联网上,我发现glfw(集成在lwjgl中)有一种称为glfwLoadTexture2D的方法,但它似乎只在glfw的C版本中可用。我还在openGL UT

  • 我最近在看一个关于用LWJGL在Java编写OpenGL游戏的教程。在其中,讲述者/作者首先将浮点数组从转换为,然后将其交给。最初我对此并没有多想,但我无意中直接给浮动数组,而不是将其转换为,结果代码最终仍然可以工作。我查阅了文档,它只写了“array version of:bufferdata”作为注释,这仍然让我无法确定。 这让我不禁要问,假设是通过使用给赋值的,因此包含相同的数据,那么在使用

  • 我目前正在使用LWJGL3并构建一个简单的Skybox。我想让skybox接收一个HDR文件,一个等长方形的地图。我可以得到一个skybox运行与PNG与PNG解码器,但不确定它将如何与HDR文件。据我所知,STB(在C++中)允许在程序中上传HDR文件,LWJGL3也支持STB。 我如何创建一个支持机顶盒和HDR文件的loadTexture函数? 编辑:我要把我的进展发布给任何人,这样任何人都可

  • lwjgl.org - Home of Lightweight Java Game Library The website for LWJGL is build with React. It is a single-page application with client-side routing. It installs a Service Worker in order to work off

相关阅读

相关文章

相关问答

相关文档