-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README with badges and detailed project description Added multiple badges for status, version, license, and Discord, improving project visibility. Expanded the project description to highlight functionality, platform compatibility, and backend details. Included a link to the demo folder for better usability guidance. * Update README with usage guide and project description Added a detailed "How to use" section for integrating the library into multiplatform projects. Clarified the project description to emphasize its role as a Kotlin binding for the wgpu library. * Update version references in README and build script Adjusted the displayed version in the README badge to v22.0.1 for consistency. Updated the default version in build.gradle.kts to v22.0.2-SNAPSHOT.
- Loading branch information
1 parent
19b7d38
commit 545d0d3
Showing
2 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,111 @@ | ||
# wgpu4k-native | ||
# wgpu4k native : a Kotlin binding of wgpu library | ||
|
||
This is a subproject of [wgpu4k](https://github.com/wgpu4k/wgpu4k) that fetches native libraries and generates Kotlin multiplatform libraries from them. | ||
[![Tests](https://github.com/wgpu4k/wgpu4k-native/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/wgpu4k/wgpu4k-native/actions/workflows/test.yml) | ||
![Static Badge](https://img.shields.io/badge/Status-Stable-green?style=plastic) | ||
![Static Badge](https://img.shields.io/badge/Latest%20version-v22.0.1-green?style=plastic) | ||
[![Static Badge](https://img.shields.io/badge/Licence-MIT-blue?style=plastic)](https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMIT_License) | ||
[![Static Badge](https://img.shields.io/badge/Discord-wgpu4k-purple?style=plastic)](https://discord.gg/qy9KQAP9Kc) | ||
|
||
## About | ||
This project is a WebGPU binding compatible with Desktop and Mobile. | ||
|
||
If you are looking for an experience that also covers the web, you can use the [wgpu4k](https://github.com/wgpu4k/wgpu4k) project. | ||
|
||
This library uses the Firefox backend written in Rust, [available here](https://github.com/gfx-rs/wgpu-native). | ||
|
||
## How to use | ||
|
||
From a basic multiplatform project, create a common native source set and add the library: | ||
|
||
``` kotlin | ||
private val hierarchyTemplate = KotlinHierarchyTemplate { | ||
/* natural hierarchy is only applied to default 'main'/'test' compilations (by default) */ | ||
withSourceSetTree(KotlinSourceSetTree.main, KotlinSourceSetTree.test) | ||
|
||
common { | ||
/* All compilations shall be added to the common group by default */ | ||
withCompilations { true } | ||
|
||
group("commonNative") { | ||
group("native") { | ||
withNative() | ||
|
||
group("apple") { | ||
withApple() | ||
|
||
group("ios") { | ||
withIos() | ||
} | ||
|
||
group("tvos") { | ||
withTvos() | ||
} | ||
|
||
group("watchos") { | ||
withWatchos() | ||
} | ||
|
||
group("macos") { | ||
withMacos() | ||
} | ||
} | ||
|
||
group("linux") { | ||
withLinux() | ||
} | ||
|
||
group("mingw") { | ||
withMingw() | ||
} | ||
|
||
} | ||
|
||
withJvm() | ||
withAndroidTarget() | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
... | ||
jvm { | ||
compilerOptions { | ||
jvmTarget = JvmTarget.JVM_22 | ||
} | ||
} | ||
|
||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
macosArm64() | ||
macosX64() | ||
linuxArm64() | ||
linuxX64() | ||
mingwX64() | ||
|
||
androidTarget { | ||
compilerOptions { | ||
jvmTarget = JvmTarget.JVM_22 | ||
} | ||
|
||
publishLibraryVariants("release", "debug") | ||
} | ||
|
||
applyHierarchyTemplate(hierarchyTemplate) | ||
|
||
sourceSets { | ||
|
||
... | ||
val commonNativeMain by getting { | ||
dependencies { api("io.ygdrasil:wgpu4k-native:<library version>) } | ||
} | ||
... | ||
} | ||
... | ||
} | ||
``` | ||
Check the [demo folder](https://github.com/wgpu4k/wgpu4k-native/tree/main/demo) to see how to use the library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters