Compare commits
3 Commits
openrndr-t
...
openrndr-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89fce80aff | ||
|
|
0a478a98a6 | ||
|
|
b994ccfd28 |
@@ -1,11 +1,13 @@
|
|||||||
# openrndr-template
|
# OPENRNDR template project
|
||||||
A feature rich template for creating OPENRNDR programs based on Gradle/Kts
|
A feature rich template for creating OPENRNDR programs based on Gradle/Kts
|
||||||
|
|
||||||
You will find some [basic instructions](https://guide.openrndr.org/#/02_Getting_Started_with_OPENRNDR/C00_SetupYourFirstProgram) in the [OPENRNDR guide](https://guide.openrndr.org)
|
|
||||||
|
|
||||||
The template consists of a configuration for Gradle and an example OPENRNDR program. The Gradle configuration should serve as the
|
The template consists of a configuration for Gradle and an example OPENRNDR program. The Gradle configuration should serve as the
|
||||||
go-to starting point for writing OPENRNDR-based software.
|
go-to starting point for writing OPENRNDR-based software.
|
||||||
|
|
||||||
|
If you are looking at this from IntelliJ IDEA you can start by expanding the _project_ tab on the left. You will find a template program in `src/main/kotlin/TemplateProgram.kt`
|
||||||
|
|
||||||
|
You will find some [basic instructions](https://guide.openrndr.org/#/02_Getting_Started_with_OPENRNDR/C00_SetupYourFirstProgram) in the [OPENRNDR guide](https://guide.openrndr.org)
|
||||||
|
|
||||||
## Gradle tasks
|
## Gradle tasks
|
||||||
- `run` runs the TemplateProgram
|
- `run` runs the TemplateProgram
|
||||||
- `jar` creates an executable platform specific jar file with all dependencies
|
- `jar` creates an executable platform specific jar file with all dependencies
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ import org.gradle.internal.os.OperatingSystem
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
group = "org.openrndr.template"
|
group = "org.openrndr.template"
|
||||||
version = "0.3.8"
|
version = "0.3.9"
|
||||||
val applicationMainClass = "TemplateProgramKt"
|
val applicationMainClass = "TemplateProgramKt"
|
||||||
|
|
||||||
val openrndrUseSnapshot = false
|
val openrndrUseSnapshot = false
|
||||||
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.37"
|
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.38"
|
||||||
|
|
||||||
val panelUseSnapshot = false
|
val panelUseSnapshot = false
|
||||||
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.19"
|
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.20"
|
||||||
|
|
||||||
val orxUseSnapshot = false
|
val orxUseSnapshot = false
|
||||||
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.44"
|
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.46"
|
||||||
|
|
||||||
// supported features are: orx-camera, orx-compositor,orx-easing, orx-filter-extension,orx-file-watcher, orx-fx
|
// supported features are: orx-camera, orx-compositor,orx-easing, orx-filter-extension,orx-file-watcher, orx-fx
|
||||||
// orx-integral-image, orx-interval-tree, orx-jumpflood, orx-kdtree, orx-mesh-generators,orx-midi, orx-no-clear,
|
// orx-integral-image, orx-interval-tree, orx-jumpflood, orx-kinect-v1, orx-kdtree, orx-mesh-generators,orx-midi, orx-no-clear,
|
||||||
// orx-noise, orx-obj, orx-olive, orx-osc, orx-palette, orx-runway
|
// orx-noise, orx-obj, orx-olive, orx-osc, orx-palette, orx-runway
|
||||||
val orxFeatures = setOf("orx-noise", "orx-fx")
|
val orxFeatures = setOf("orx-noise", "orx-fx", "orx-olive")
|
||||||
|
|
||||||
// supported features are: video, panel
|
// supported features are: video, panel
|
||||||
val openrndrFeatures = setOf("video", "panel")
|
val openrndrFeatures = setOf("video", "panel")
|
||||||
@@ -65,54 +65,63 @@ fun DependencyHandler.openrndrNatives(module: String): Any {
|
|||||||
return "org.openrndr:openrndr-$module-natives-$openrndrOs:$openrndrVersion"
|
return "org.openrndr:openrndr-$module-natives-$openrndrOs:$openrndrVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun DependencyHandler.orxNatives(module: String): Any {
|
||||||
|
return "org.openrndr.extra:$module-natives-$openrndrOs:$orxVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
runtime(openrndr("gl3"))
|
runtimeOnly(openrndr("gl3"))
|
||||||
runtime(openrndrNatives("gl3"))
|
runtimeOnly(openrndrNatives("gl3"))
|
||||||
compile(openrndr("openal"))
|
implementation(openrndr("openal"))
|
||||||
runtime(openrndrNatives("openal"))
|
runtimeOnly(openrndrNatives("openal"))
|
||||||
compile(openrndr("core"))
|
implementation(openrndr("core"))
|
||||||
compile(openrndr("svg"))
|
implementation(openrndr("svg"))
|
||||||
compile(openrndr("animatable"))
|
implementation(openrndr("animatable"))
|
||||||
compile(openrndr("extensions"))
|
implementation(openrndr("extensions"))
|
||||||
compile(openrndr("filter"))
|
implementation(openrndr("filter"))
|
||||||
|
|
||||||
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.3")
|
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.3")
|
||||||
|
|
||||||
compile("io.github.microutils", "kotlin-logging","1.7.8")
|
implementation("io.github.microutils", "kotlin-logging","1.7.8")
|
||||||
|
|
||||||
when(applicationLogging) {
|
when(applicationLogging) {
|
||||||
Logging.NONE -> {
|
Logging.NONE -> {
|
||||||
runtime("org.slf4j","slf4j-nop","1.7.29")
|
runtimeOnly("org.slf4j","slf4j-nop","1.7.29")
|
||||||
}
|
}
|
||||||
Logging.SIMPLE -> {
|
Logging.SIMPLE -> {
|
||||||
runtime("org.slf4j","slf4j-simple","1.7.29")
|
runtimeOnly("org.slf4j","slf4j-simple","1.7.29")
|
||||||
}
|
}
|
||||||
Logging.FULL -> {
|
Logging.FULL -> {
|
||||||
runtime("org.apache.logging.log4j", "log4j-slf4j-impl", "2.13.0")
|
runtimeOnly("org.apache.logging.log4j", "log4j-slf4j-impl", "2.13.0")
|
||||||
runtime("com.fasterxml.jackson.core", "jackson-databind", "2.10.1")
|
runtimeOnly("com.fasterxml.jackson.core", "jackson-databind", "2.10.1")
|
||||||
runtime("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.10.1")
|
runtimeOnly("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.10.1")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("video" in openrndrFeatures) {
|
if ("video" in openrndrFeatures) {
|
||||||
compile(openrndr("ffmpeg"))
|
implementation(openrndr("ffmpeg"))
|
||||||
runtime(openrndrNatives("ffmpeg"))
|
runtimeOnly(openrndrNatives("ffmpeg"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("panel" in openrndrFeatures) {
|
if ("panel" in openrndrFeatures) {
|
||||||
compile("org.openrndr.panel:openrndr-panel:$panelVersion")
|
implementation("org.openrndr.panel:openrndr-panel:$panelVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
for (feature in orxFeatures) {
|
for (feature in orxFeatures) {
|
||||||
compile(orx(feature))
|
implementation(orx(feature))
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("orx-kinect-v1" in orxFeatures) {
|
||||||
|
runtimeOnly("orx-kinect-v1")
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("orx-olive" in orxFeatures) {
|
if ("orx-olive" in orxFeatures) {
|
||||||
compile("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
|
implementation("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
testCompile("junit", "junit", "4.12")
|
testImplementation("junit", "junit", "4.12")
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
22
src/main/kotlin/TemplateLiveProgram.kt
Normal file
22
src/main/kotlin/TemplateLiveProgram.kt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import org.openrndr.Program
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.extra.olive.Olive
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a template for a live program.
|
||||||
|
* The first you will run this program it will create a script file at src/main/kotlin/live.kts
|
||||||
|
* This script file can be modified while the program is running.
|
||||||
|
*
|
||||||
|
* Please refer to https://guide.openrndr.org/#/10_OPENRNDR_Extras/C03_Live_coding for more
|
||||||
|
* instructions on using the live coding environment.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
configure {
|
||||||
|
width = 800
|
||||||
|
height = 800
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
extend(Olive<Program>())
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user