Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenGL]: Update OpenGL module #63

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

You are welcome to contribute to OverrunGL.

## Code of Conduct

You must respect the [Code of Conduct](CODE_OF_CONDUCT.md).

## Issues

Issues are only for discussing bugs and proposing new features. For other discussions such as usages,
Expand Down Expand Up @@ -47,5 +43,5 @@ The formatted code:

## Discussions

You can visit [discussions](https://github.com/Over-Run/overrungl/discussions) and create your post, share your experience
You can view [discussions](https://github.com/Over-Run/overrungl/discussions) and create your post, share your experience
or just ask some questions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[//]: # (![Maven Central](https://img.shields.io/maven-central/v/io.github.over-run/overrungl))
![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)

[![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)
Expand Down Expand Up @@ -39,8 +39,15 @@ A documentation of the customizer is [here](doc/customizer/doc_on_customizer.md)
- Core module Maven coordinate: `io.github.over-run:overrungl`
- For others: `io.github.over-run:overrungl-<module-name>`

Currently, OverrunGL uses preview features preventing users from using newer JDKs,
so only `-SNAPSHOT` versions are provided at this time.
For example:

```kotlin
dependencies {
implementation(platform("io.github.over-run:overrungl-bom:<VERSION>"))
implementation("io.github.over-run:overrungl")
implementation("io.github.over-run:overrungl-glfw")
}
```

### Using -SNAPSHOT Versions

Expand Down
58 changes: 38 additions & 20 deletions buildSrc/src/main/kotlin/module.conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,44 @@ afterEvaluate {
pom {
setupPom(it.projectName, it.projectDescription, "jar")
}
}
overrunglModule.nativeBinding.orNull?.platforms?.forEach { platform ->
getByName<MavenPublication>("overrunglBOM") {
pom {
withXml {
asElement().getElementsByTagName("dependencyManagement").item(0).apply {
asElement().getElementsByTagName("dependencies").item(0).apply {
ownerDocument.createElement("dependency").also(::appendChild).apply {
appendChild(ownerDocument.createElement("groupId")
.also(::appendChild)
.apply { textContent = projGroupId })
appendChild(ownerDocument.createElement("artifactId")
.also(::appendChild)
.apply { textContent = overrunglModule.artifactName.get() })
appendChild(ownerDocument.createElement("version")
.also(::appendChild)
.apply { textContent = projVersion })
appendChild(ownerDocument.createElement("classifier")
.also(::appendChild)
.apply { textContent = platform.classifier })

overrunglModule.nativeBinding.orNull?.also { nativeBinding ->
nativeBinding.platforms.forEach { platform ->
val nativeFileName = nativeFileName(nativeBinding, platform)
val file = rootProject.projectDir.resolve("natives").resolve(nativeFileName)
artifact(tasks.register<Jar>("${nativeBinding.bindingName}${platform.classifier}Jar") {
archiveBaseName.set(overrunglModule.artifactName)
archiveClassifier.set(platform.classifier)
from(file) { into(File(nativeFileName).parent) }
})

getByName<MavenPublication>("overrunglBOM") {
pom {
withXml {
asElement().getElementsByTagName("dependencyManagement").item(0).apply {
asElement().getElementsByTagName("dependencies").item(0).apply {
ownerDocument.createElement("dependency").also(::appendChild)
.apply {
appendChild(
ownerDocument.createElement("groupId")
.also(::appendChild)
.apply { textContent = projGroupId })
appendChild(
ownerDocument.createElement("artifactId")
.also(::appendChild)
.apply {
textContent = overrunglModule.artifactName.get()
})
appendChild(
ownerDocument.createElement("version")
.also(::appendChild)
.apply { textContent = projVersion })
appendChild(
ownerDocument.createElement("classifier")
.also(::appendChild)
.apply { textContent = platform.classifier })
}
}
}
}
}
Expand Down
42 changes: 0 additions & 42 deletions buildSrc/src/main/kotlin/native.conventions.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.palantir.javapoet.TypeName
import overrungl.gen.*

val glfwPackage = "overrungl.glfw"
val glfwLookup = "GLFWInternal.lookup"
val glfwLookup = "GLFWInternal.lookup()"

val glfw_boolean = CustomTypeSpec(
carrier = TypeName.INT,
Expand Down Expand Up @@ -2960,9 +2960,9 @@ fun main() {
@param window The window whose flag to change.
@param value The new value.

@errors Possible errors include [GLFW_NOT_INITIALIZED][#GLFW_NOT_INITIALIZED].
@glfw.errors Possible errors include [GLFW_NOT_INITIALIZED][#GLFW_NOT_INITIALIZED].

@thread_safety This function may be called from any thread. Access is not
@glfw.thread_safety This function may be called from any thread. Access is not
synchronized.
""".trimIndent(),
addNow = false
Expand Down Expand Up @@ -3494,7 +3494,7 @@ fun main() {
be able to restore it. This is a design decision of the xdg-shell
protocol.

@thread_safety This function must only be called from the main thread.
@glfw.thread_safety This function must only be called from the main thread.

@see #glfwRestoreWindow(MemorySegment) glfwRestoreWindow
@see #glfwMaximizeWindow(MemorySegment) glfwMaximizeWindow
Expand Down
4 changes: 2 additions & 2 deletions generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2024 Overrun Organization
* Copyright (c) 2024-2025 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 Expand Up @@ -127,7 +127,7 @@ fun main() {
}
//endregion

StaticDowncall(nfdPackage, "NFD", "NFDInternal.LOOKUP") {
StaticDowncall(nfdPackage, "NFD", "NFDInternal.lookup()") {
int {
"NFD_ERROR"("0", javadoc = "Programmatic error")
"NFD_OKAY"("1", javadoc = "User pressed okay, or successful return")
Expand Down
21 changes: 17 additions & 4 deletions generators/opengl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* MIT License
*
* Copyright (c) 2025 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

plugins {
id("generator.conventions")
}
Expand All @@ -6,7 +22,4 @@ dependencies {
implementation(project(":generators"))
}

tasks.register<GenerateTask>("generate") {
mainClass.set("overrungl.opengl.OpenGLGeneratorKt")
workingDir = project(":opengl").projectDir.resolve("src/main/java/overrungl/opengl")
}
registerGenerateTask("overrungl.opengl.OpenGLGeneratorKt", ":opengl")
Loading
Loading