Skip to content

Commit

Permalink
Merge pull request #6 from Over-Run/Core-1
Browse files Browse the repository at this point in the history
[Core-1] Migrate to JDK 20
  • Loading branch information
squid233 authored Mar 22, 2023
2 parents 70fe215 + 6e0734b commit 4d165be
Show file tree
Hide file tree
Showing 171 changed files with 9,088 additions and 9,343 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ indent_size = 4
indent_style = space
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug report
description: Create a report to help us improve
title: "[GLib-#] "
labels: [ "bug", "P4" ]
title: "[Core-#] "
labels: [ "bug", "P3", "Status: Draft" ]
assignees:
- "squid233"
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature request
description: Suggest an idea for this project
title: "[GLib-#] "
labels: [ "enhancement","P5" ]
title: "[Core-#] "
labels: [ "enhancement", "P5", "Status: Draft" ]
assignees:
- "squid233"
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java: [
19
20
]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
Expand All @@ -33,7 +33,7 @@ jobs:
with:
arguments: build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '19' }}
if: ${{ runner.os == 'Linux' && matrix.java == '20' }}
uses: actions/upload-artifact@v3
with:
name: Artifacts
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Overrun Organization
Copyright (c) 2022-2023 Overrun Organization

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
64 changes: 40 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
# OverrunGL - Overrun Game Library

![License](https://img.shields.io/github/license/Over-Run/overrungl)
[![GitHub contributors](https://img.shields.io/github/contributors/Over-Run/overrungl)](https://github.com/Over-Run/overrungl/graphs/contributors)

![Maven Central](https://img.shields.io/maven-central/v/io.github.over-run/overrungl)
![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.over-run/overrungl?server=https%3A%2F%2Fs01.oss.sonatype.org%2F)

![GitHub repo size](https://img.shields.io/github/repo-size/Over-Run/overrungl)
[![Java CI with Gradle](https://github.com/Over-Run/overrungl/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Over-Run/overrungl/actions/workflows/gradle.yml)

# OverrunGL - Overrun Game Library
## Introduction

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

### OverrunGL vs. LWJGL

[LWJGL3](https://github.com/LWJGL/lwjgl3) is also a Java library that enables native access.

LWJGL3 uses JNI to access native functions, but OverrunGL uses [FFM API](https://openjdk.org/jeps/434), which has better
performance.

## Getting Started

You can check our [wiki](https://github.com/Over-Run/overrungl/wiki) or
the [samples](modules/samples/src/test/java/org/overrun/glib/demo).

## Using as a Dependency

~~The libraries are available on Maven Central.~~ Currently, we are developing with the first version, and it is very unstable, so you have to use the -SNAPSHOT version.
~~The libraries are available on Maven Central.~~ Currently, we are developing with the first version, and it is very
unstable, so you have to use the -SNAPSHOT version.

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

Expand All @@ -23,45 +39,49 @@ We will provide a module customizer soon.

We publish `-SNAPSHOT` versions frequently.

For `-SNAPSHOT` versions, you can use the [list of available versions](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/over-run/overrungl/maven-metadata.xml) and include this maven repository:
For `-SNAPSHOT` versions, you can use
the [list of available versions](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/over-run/overrungl/maven-metadata.xml)
and include this maven repository:

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

## Supported Bindings

Basic graphics:

| Module | Functionality |
|--------|---------------------------------------|
| GLFW | Full (Core and native) |
| OpenGL | Partial (Core and partial extensions) |
| STB | Partial (Image, perlin noise) |

## Contact

- [Forum](https://github.com/Over-Run/overrungl/discussions)
- [Discussions](https://github.com/Over-Run/overrungl/discussions)
- [Discord: ![Discord](https://img.shields.io/discord/1048545705553313862)](https://discord.gg/UKRJapDKgX)

## Goals

Our goal is to support these libraries with full document:
## Release Notes

- [x] [GLFW](https://www.glfw.org/) 3.3.8 (Currently 100%)
- [ ] [OpenGL](https://www.khronos.org/opengl/) 4.6 (Currently 39%)
- [ ] [STB](https://github.com/nothings/stb) (Currently 22%)
- [ ] [Vulkan](https://www.vulkan.org/) (Currently 0%)
- [ ] [OpenAL](https://www.openal.org/) (Currently 0%)
See [doc/notes](doc/notes/README.md).

Checked item means it has full functional but might be not documented.
## Additional

| Total Progress |
|:--------------------------------------------------------------:|
| ![total progress](https://progress-bar.dev/32/?title=progress) |
OpenGL docs can be found [here](https://docs.gl/).

## Publishing (for internal member)
### Publishing (for internal member)

To publish this library, you need a GPG key and the write permission of Maven Central.

### Packing Natives
#### Packing Natives

The build script can put the native libraries into jars.

The tree structure of libraries is:

```text
Natives
natives
├─ glfw
│ ├─ linux
│ │ ├─ arm64
Expand Down Expand Up @@ -99,7 +119,3 @@ Natives
└─ x86
└─ stb.dll
```

## Additional

OpenGL docs can be found [here](https://docs.gl/).
66 changes: 36 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ group = projGroupId
version = projVersion

project(":core").ext.subName = ''
for (String p : ['glfw', 'joml', 'opengl', 'stb',
'samples']) {
project(":$p").ext.subName = "-$p"
for (Artifact module : Artifact.VALUES) {
project(module.subprojectName).ext.subName = "-${module.subprojectName.substring(1)}"
}
project(":samples").ext.subName = "samples"

enum NativePlatform {
WIN_32("windows", "x86", "windows-x86", "", ".dll", "Win32"),
Expand All @@ -22,6 +22,8 @@ enum NativePlatform {
MACOS("os x", "x64", "macos", "lib", ".dylib", "Macos"),
MACOS_ARM64("os x", "arm64", "macos-arm64", "lib", ".dylib", "MacosArm64"),

static final NativePlatform[] ALL = values()

private final String osFamilyName
private final String osArch
private final String classifier
Expand Down Expand Up @@ -69,9 +71,7 @@ enum NativeBinding {
NativePlatform.WIN_32, NativePlatform.WIN_64,
NativePlatform.LINUX_64, NativePlatform.LINUX_ARM64,
NativePlatform.MACOS, NativePlatform.MACOS_ARM64),
STB("stb", "stb", NativePlatform.WIN_32, NativePlatform.WIN_64, NativePlatform.WIN_ARM64,
NativePlatform.LINUX_64, NativePlatform.LINUX_ARM32, NativePlatform.LINUX_ARM64,
NativePlatform.MACOS, NativePlatform.MACOS_ARM64),
STB("stb", "stb", NativePlatform.ALL),

private final String name
private final String basename
Expand Down Expand Up @@ -117,6 +117,7 @@ enum Artifact {
// "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.",
// ":vulkan", "Vulkan", null),

static final Artifact[] VALUES = values()
private final String artifactName
private final String projectName
private final String projectDescription
Expand Down Expand Up @@ -169,10 +170,7 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'signing'

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_19

group = projGroupId
archivesBaseName = "$projArtifactId$subName"
version = projVersion

repositories {
Expand All @@ -184,22 +182,43 @@ subprojects {
}

dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly 'org.jetbrains:annotations:24.0.1'
if (project.name != "core") {
implementation project(':core')
}
}

def targetJavaVersion = 20
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs += '--enable-preview'
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}
}

java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
archivesBaseName = "$projArtifactId$subName"
withJavadocJar()
withSourcesJar()
}

tasks.withType(Javadoc).configureEach {
if (options instanceof CoreJavadocOptions) {
options.addBooleanOption('-enable-preview', true)
options.addStringOption('source', sourceCompatibility.toString())
}
failOnError = false
options.encoding 'UTF-8'
options.charSet 'UTF-8'
options.author true
options.locale 'en_US'
options.links "https://docs.oracle.com/en/java/javase/${sourceCompatibility}/docs/api/"
options.windowTitle "OverrunGL $projVersion Javadoc"
}

jar {
Expand All @@ -216,12 +235,14 @@ subprojects {
)
}

task sourcesJar(type: Jar, dependsOn: classes) {
sourcesJar {
dependsOn classes
archiveClassifier.set 'sources'
from sourceSets.main.allSource, 'LICENSE'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
javadocJar {
dependsOn javadoc
archiveClassifier.set 'javadoc'
from javadoc, 'LICENSE'
}
Expand All @@ -230,21 +251,6 @@ subprojects {
archives javadocJar, sourcesJar
}

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
failOnError = false
options.encoding 'UTF-8'
options.charSet 'UTF-8'
options.author true
options.locale 'en_US'
options.links "https://docs.oracle.com/en/java/javase/${sourceCompatibility}/docs/api/"
options.windowTitle "OverrunGL $projVersion Javadoc"
}

signing {
if (!version.endsWith('-SNAPSHOT') && Boolean.parseBoolean(System.getProperty("gpg.signing", "true")))
sign publishing.publications
Expand Down Expand Up @@ -305,7 +311,7 @@ void appendBOM(org.w3c.dom.Node dependencies, NativePlatform platform, Artifact
}

publishing.publications {
for (Artifact module : Artifact.values()) {
for (Artifact module : Artifact.VALUES) {
create("maven${module.mavenName}", MavenPublication) {
groupId = projGroupId
artifactId = module.artifactName
Expand Down Expand Up @@ -360,7 +366,7 @@ publishing.publications {
withXml {
def dependencyManagement = asElement().getElementsByTagName("dependencyManagement").item(0)
def dependencies = asElement().getElementsByTagName("dependencies").item(0)
for (Artifact module : Artifact.values()) {
for (Artifact module : Artifact.VALUES) {
if (module.nativeBinding != null) {
for (NativePlatform platform : module.nativeBinding.platforms) {
appendBOM(dependencies, platform, module)
Expand Down Expand Up @@ -395,7 +401,7 @@ publishing.repositories {

dependencies {
constraints {
for (Artifact module : Artifact.values()) {
for (Artifact module : Artifact.VALUES) {
api "io.github.over-run:${module.artifactName}:$version"
}
}
Expand Down
11 changes: 0 additions & 11 deletions changelog.txt

This file was deleted.

21 changes: 21 additions & 0 deletions doc/notes/0.x/0.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### 0.1.0

_Not Released Yet_

This version includes the following features:

- GLFW 3.3.8
- OpenGL 1.0 ~ 4.6 functions and constants
- OpenGL Loader
- STB Image, perlin noise, easy font
- C memory function
- Growable buffer
- Native memory access for JOML

These features are purposed to target:

- OpenGL extensions

These features are candidates:

- STB true-type
3 changes: 3 additions & 0 deletions doc/notes/0.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.x Versions

- YYYY-MM-DD [0.1.0](0.1.0.md) (work in progress)
19 changes: 19 additions & 0 deletions doc/notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Version History

- [0.x](0.x/README.md)

### Features

These features are purposed to target:

- (0.1.0) OpenGL 307 extensions

These features are candidates:

- (0.1.0) STB true-type

### Drafts

These features are drafts. The contents are subject to change until release.

- ?
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-milestone-4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-rc-1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Loading

0 comments on commit 4d165be

Please sign in to comment.