Code Monkey home page Code Monkey logo

over-run / overrungl Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 3.0 6.9 MB

Overrun Game Library is a high-performance library implemented with Java 22, enables cross-platform access to a set of C/C++ library bindings, and provides some useful utilities.

Home Page: https://over-run.github.io/overrungl/

License: MIT License

Java 82.79% Kotlin 17.21%
glfw-bindings java project-panama overrungl gl-binding game-library java-game-library bindings glfw opengl

overrungl's Introduction

OverrunGL - Overrun Game Library

License

Maven Central Sonatype Nexus (Snapshots)

Java CI with Gradle OpenSSF Best Practices

Introduction

Overrun Game Library is a high-performance library implemented with Java 22, which enables cross-platform access to a set of C/C++ library bindings, and provides some useful utilities.

OverrunGL vs. LWJGL

LWJGL 3 is also a Java library that enables native access.

LWJGL 3 uses JNI to access native functions, but OverrunGL uses FFM API, which has better performance.

Getting Started

You can check our wiki or the samples.

Import as a Dependency

We provided a modules customizer here.

Currently, we are developing with the first version, and it uses preview features, which prevent users from using newer JDKs, so you have to use -SNAPSHOT version.

You can import with io.github.over-run:overrungl-bom:{the version} and other submodules.

Using -SNAPSHOT Versions

We publish -SNAPSHOT versions frequently.

For -SNAPSHOT versions, you can use the list of available versions and include this maven repository:

maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }

Enable native access

You must enable the access of OverrunGL by adding a VM argument or a manifest attribute.

--enable-preview-access=overrungl.core,...

List of Supported Bindings

Khronos APIs

Library Description
OpenGL The most widely adopted 2D and 3D graphics API in the industry, bringing thousands of applications to a wide variety of computer 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.
Native File Dialog Extended A small C library that portably invokes native file open, folder select and file save dialogs.

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
JOML A Java math library for OpenGL rendering calculations

Contact

Release Notes

See doc/notes.

Additional

Javadoc can be found here.

The documentation of OpenGL can be found from references and docs.gl.

OverrunGL uses Marshal.

Credits

JetBrains Logo (Main) logo.

overrungl's People

Contributors

squid233 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

overrungl's Issues

Migrate to JDK 21

JEP 442 described some minor changes since JEP 434.

Although these changes are still not integrated, we made a plan:

  • Replace SegmentScope with Arena
  • Add special FunctionDescriptors for deferencing memory address (return value, upcall argument, etc.)

Migrate to JDK 20

Currently we are working on JDK 19 and JEP 424. Since JEP 434, there are many major changes.

The required changes are:

  1. Rename all MemorySession
  2. Rename MemoryAddress and Addressable to MemorySegment, and move the descriptor to ADDRESS_UNBOUNDED
  3. Move SymbolLookup::lookup to find
  4. More migration need to be found

[OpenGL] Support to multiple context

Currently the OpenGL binding only supports to single context. We need to move the version flags and method handles into a object.

class GLCapabilities {
    boolean Ver10, ...;
    MethodHandle glGetString, ...;
}

And use GLLoader to load the capabilities.

class GLLoader {
    // The original overload
    static @Nullable GLCapabilities load(boolean forwardCompatible, GLLoadFunc load) {
        return new GLCapabilities(forwardCompatible, load);
    }
}

[JOML] Replace SegmentScope with SegmentAllocator for allocate methods

Is your feature request related to a problem? Please describe.

Currently, we are using SegmentScope for allocate methods in Vectorn/Matrixn. However, we can create an allocator from SegmentScope, but we can't create a SegmentScope from an allocator.

Describe the solution you'd like

We need to modify the parameter of allocate.

static MemorySegment allocate(
-   SegmentScope scope,
+   SegmentAllocator allocator,
    Vector2f vec
) {
    return put(
        vec,
-       MemorySegment.allocateNative(VEC2F, scope)
+       allocator.allocate(VEC2F)
    );
}

Describe alternatives you've considered

Unfortunately, we can't create a SegmentScope from a SegmentAllocator. If you are using Arena, please consider the code this below:

Vectorn.allocate(arena.scope(), vec);

Additional context

This patch will be directly commited to the main branch.

Version: 0.1.0

0.1.0

In this version, we introduced the basic features.

Release note is available here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.