Skip to content

Commit

Permalink
docs: update README to use Reposilite
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Jul 8, 2024
1 parent e767881 commit cc63cfe
Showing 1 changed file with 9 additions and 40 deletions.
49 changes: 9 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,25 @@ Render OpenGL content onto a Compose Canvas.

- JVM + Linux

## Usage

### Dependencies
## Dependencies

This library uses a custom skiko+skia build which uses EGL and GLES instead of GLX and Desktop GL on Linux:

- Skiko: https://github.com/silenium-dev/skiko
- Skia: https://github.com/silenium-dev/skia-pack

Both are based on the official builds by JetBrains.

You need to build and publish the Skiko library locally before using this library:
Ensure your `JAVA_HOME` is set to a JDK 17 installation.
```shell
git clone https://github.com/silenium-dev/skiko.git
cd skiko/skiko
./gradlew publishToMavenLocal
```

### Building

The library is not published to any repository yet, so you need to clone the repository and publish it locally:

```shell
git clone https://github.com/silenium-dev/compose-gl.git
cd compose-gl
./gradlew publishToMavenLocal
```
## Usage

Then you can add the dependency to your project:
You can add the dependency to your project as follows:

```kotlin
repositories {
mavenLocal()
maven("https://reposilite.silenium.dev/snapshots") {
name = "silenium-snapshots"
}
}
dependencies {
implementation("dev.silenium.compose:compose-gl:0.0.0-SNAPSHOT")

implementation("org.jetbrains.skiko:skiko-awt") {
version {
strictly("0.0.0-SNAPSHOT")
}
isChanging = true
}

implementation("org.jetbrains.skiko:skiko-awt-runtime-linux-x64") {
version {
strictly("0.0.0-SNAPSHOT")
}
isChanging = true
}
}
```

Expand All @@ -73,8 +42,8 @@ fun App() {
// Internally uses a Compose Canvas, so it can be used like any other Composable
GLSurfaceView(modifier = Modifier.size(100.dp)) {
// Translucent grey
glClearColor(0.5f, 0.5f, 0.5f, 0.5f)
glClear(GL_COLOR_BUFFER_BIT)
GLES30.glClearColor(0.5f, 0.5f, 0.5f, 0.5f)
GLES30.glClear(GL_COLOR_BUFFER_BIT)
// Render with 30 FPS, this should be the time from start of frame n to frame n+1, the internal logic subtracts render time and other delays
// Defaults to 60 FPS
// Will be replaced with a better solution in the future
Expand Down

0 comments on commit cc63cfe

Please sign in to comment.