Compare commits

..

3 Commits

Author SHA1 Message Date
Edwin Jakobs
52649f84db Bumped orx to 0.3.34 2019-09-06 16:30:41 +02:00
edwin
2e52f074f2 Added natives for orx-kinect-v1 2019-08-28 12:58:20 +02:00
edwin
7d6ac87a34 Bumped OPENRNDR to 0.3.35, orx to 0.3.32, kotlin to 1.3.50 2019-08-27 19:38:24 +02:00
5 changed files with 57 additions and 101 deletions

View File

@@ -1,13 +1,11 @@
# OPENRNDR template project
# openrndr-template
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
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
- `run` runs the TemplateProgram
- `jar` creates an executable platform specific jar file with all dependencies

View File

@@ -1,49 +1,41 @@
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotlinVersion = "1.3.50"
plugins {
java
kotlin("jvm") version("1.3.50")
}
group = "org.openrndr.template"
version = "0.3.9"
version = "0.3.4"
val applicationMainClass = "TemplateProgramKt"
val applicationFullLogging = false
val openrndrUseSnapshot = false
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.38"
val panelUseSnapshot = false
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.20"
val orxUseSnapshot = false
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
// 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
val orxFeatures = setOf("orx-noise", "orx-fx", "orx-olive")
// supported features are: video, panel
val openrndrFeatures = setOf("video", "panel")
// --------------------------------------------------------------------------------------------------------------------
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.35"
val openrndrOs = when (OperatingSystem.current()) {
OperatingSystem.WINDOWS -> "windows"
OperatingSystem.MAC_OS -> "macos"
OperatingSystem.LINUX -> "linux-x64"
else -> throw IllegalArgumentException("os not supported")
}
enum class Logging {
NONE,
SIMPLE,
FULL
}
val applicationLogging = Logging.SIMPLE
// supported features are: video, panel
val openrndrFeatures = setOf("video", "panel")
val kotlinVersion = "1.3.61"
val panelUseSnapshot = false
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.17-m3"
plugins {
java
kotlin("jvm") version("1.3.61")
}
val orxUseSnapshot = false
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.34"
// supported features are: orx-camera, orx-compositor,orx-easing, orx-filter-extension,orx-file-watcher, orx-kinect-v1
// orx-integral-image, orx-interval-tree, orx-jumpflood,orx-kdtree, orx-mesh-generators,orx-midi, orx-no-clear,
// orx-noise, orx-obj, orx-olive
val orxFeatures = setOf("orx-noise")
repositories {
mavenCentral()
@@ -69,63 +61,52 @@ fun DependencyHandler.orxNatives(module: String): Any {
return "org.openrndr.extra:$module-natives-$openrndrOs:$orxVersion"
}
dependencies {
runtimeOnly(openrndr("gl3"))
runtimeOnly(openrndrNatives("gl3"))
implementation(openrndr("openal"))
runtimeOnly(openrndrNatives("openal"))
implementation(openrndr("core"))
implementation(openrndr("svg"))
implementation(openrndr("animatable"))
implementation(openrndr("extensions"))
implementation(openrndr("filter"))
runtime(openrndr("gl3"))
runtime(openrndrNatives("gl3"))
compile(openrndr("core"))
compile(openrndr("svg"))
compile(openrndr("animatable"))
compile(openrndr("extensions"))
compile(openrndr("filter"))
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.3")
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.0-RC")
implementation("io.github.microutils", "kotlin-logging","1.7.8")
compile("io.github.microutils", "kotlin-logging","1.7.2")
when(applicationLogging) {
Logging.NONE -> {
runtimeOnly("org.slf4j","slf4j-nop","1.7.29")
}
Logging.SIMPLE -> {
runtimeOnly("org.slf4j","slf4j-simple","1.7.29")
}
Logging.FULL -> {
runtimeOnly("org.apache.logging.log4j", "log4j-slf4j-impl", "2.13.0")
runtimeOnly("com.fasterxml.jackson.core", "jackson-databind", "2.10.1")
runtimeOnly("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.10.1")
}
if (!applicationFullLogging) {
runtime("org.slf4j","slf4j-nop","1.7.25")
} else {
runtime("org.apache.logging.log4j", "log4j-slf4j-impl", "2.12.0")
runtime("com.fasterxml.jackson.core", "jackson-databind", "2.8.7")
runtime("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.8.7")
}
if ("video" in openrndrFeatures) {
implementation(openrndr("ffmpeg"))
runtimeOnly(openrndrNatives("ffmpeg"))
compile(openrndr("ffmpeg"))
runtime(openrndrNatives("ffmpeg"))
}
if ("panel" in openrndrFeatures) {
implementation("org.openrndr.panel:openrndr-panel:$panelVersion")
compile("org.openrndr.panel:openrndr-panel:$panelVersion")
}
for (feature in orxFeatures) {
implementation(orx(feature))
}
if ("orx-kinect-v1" in orxFeatures) {
runtimeOnly("orx-kinect-v1")
compile(orx(feature))
}
if ("orx-olive" in orxFeatures) {
implementation("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
compile("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
if ("orx-kinect-v1" in orxFeatures) {
runtime(orxNatives("orx-kinect-v1"))
}
implementation(kotlin("stdlib-jdk8"))
testImplementation("junit", "junit", "4.12")
testCompile("junit", "junit", "4.12")
}
// --------------------------------------------------------------------------------------------------------------------
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}

View File

@@ -1,5 +1,5 @@
#Thu Aug 01 12:32:31 CEST 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

View File

@@ -1,22 +0,0 @@
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>())
}
}

View File

@@ -1,10 +1,8 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.loadFont
import org.openrndr.draw.FontImageMap
import org.openrndr.draw.loadImage
import org.openrndr.draw.tint
import kotlin.math.cos
import kotlin.math.sin
fun main() = application {
configure {
@@ -13,15 +11,16 @@ fun main() = application {
}
program {
val image = loadImage("data/images/pm5544.png")
val font = loadFont("data/fonts/IBMPlexMono-Regular.ttf", 64.0)
val image = loadImage("file:data/images/pm5544.png")
val font = FontImageMap.fromUrl("file:data/fonts/IBMPlexMono-Regular.ttf", 64.0)
extend {
drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
drawer.image(image)
drawer.fill = ColorRGBa.PINK
drawer.circle(cos(seconds) * width / 2.0 + width / 2.0, sin(0.5 * seconds) * height / 2.0 + height / 2.0, 140.0)
drawer.circle(Math.cos(seconds)*width/2.0+width/2.0, Math.sin(0.5*seconds)*height/2.0 + height/2.0, 140.0)
drawer.fontMap = font
drawer.fill = ColorRGBa.WHITE