Compare commits

..

5 Commits

Author SHA1 Message Date
edwin
e2108f86e5 Bump to OPENRNDR 0.3.36, ORX 0.3.40, Panel 0.3.18 2019-11-25 19:41:26 +01:00
Edwin Jakobs
1ab4b6e538 Add default simple logging
* Bump library versions
 * Bump template version
 * Small clean-up of TemplateProgram.kt
2019-11-10 14:26:16 +01:00
edwin
c0205c03b8 Bumped orx to 0.3.36 2019-11-04 17:02:22 +01:00
edwin
d31446821f Version bump 2019-10-07 17:24:58 +02:00
edwin
71f315f5ca Version bump 2019-10-07 17:10:49 +02:00
2 changed files with 38 additions and 30 deletions

View File

@@ -8,13 +8,12 @@ plugins {
kotlin("jvm") version("1.3.50")
}
group = "org.openrndr.template"
version = "0.3.3"
version = "0.3.6"
val applicationMainClass = "TemplateProgramKt"
val applicationFullLogging = false
val openrndrUseSnapshot = false
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.35"
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.36"
val openrndrOs = when (OperatingSystem.current()) {
OperatingSystem.WINDOWS -> "windows"
OperatingSystem.MAC_OS -> "macos"
@@ -26,17 +25,26 @@ val openrndrOs = when (OperatingSystem.current()) {
val openrndrFeatures = setOf("video", "panel")
val panelUseSnapshot = false
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.17-m3"
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.18"
val orxUseSnapshot = false
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.32"
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.40"
// 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
// supported features are: orx-camera, orx-compositor,orx-easing, orx-filter-extension,orx-file-watcher,
// orx-integral-image, orx-interval-tree, orx-jumpflood, orx-kdtree, orx-mesh-generators,orx-midi, orx-no-clear,
// orx-noise, orx-obj, orx-olive, orx-osc, orx-palette
val orxFeatures = setOf("orx-noise")
enum class Logging {
NONE,
SIMPLE,
FULL
}
val applicationLogging = Logging.SIMPLE
repositories {
mavenCentral()
if (openrndrUseSnapshot || orxUseSnapshot || panelUseSnapshot) {
@@ -57,10 +65,6 @@ fun DependencyHandler.openrndrNatives(module: String): Any {
return "org.openrndr:openrndr-$module-natives-$openrndrOs:$openrndrVersion"
}
fun DependencyHandler.orxNatives(module: String): Any {
return "org.openrndr.extra:$module-natives-$openrndrOs:$orxVersion"
}
dependencies {
runtime(openrndr("gl3"))
runtime(openrndrNatives("gl3"))
@@ -70,17 +74,23 @@ dependencies {
compile(openrndr("extensions"))
compile(openrndr("filter"))
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.0-RC")
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.0")
compile("io.github.microutils", "kotlin-logging","1.7.2")
compile("io.github.microutils", "kotlin-logging","1.7.6")
if (!applicationFullLogging) {
runtime("org.slf4j","slf4j-nop","1.7.25")
} else {
runtime("org.apache.logging.log4j", "log4j-slf4j-impl", "2.12.0")
when(applicationLogging) {
Logging.NONE -> {
runtime("org.slf4j","slf4j-nop","1.7.29")
}
Logging.SIMPLE -> {
runtime("org.slf4j","slf4j-simple","1.7.29")
}
Logging.FULL -> {
runtime("org.apache.logging.log4j", "log4j-slf4j-impl", "2.12.1")
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) {
compile(openrndr("ffmpeg"))
@@ -99,10 +109,6 @@ dependencies {
compile("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
if ("orx-kinect-v1" in orxFeatures) {
runtime(orxNatives("orx-kinect-v1"))
}
implementation(kotlin("stdlib-jdk8"))
testCompile("junit", "junit", "4.12")
}

View File

@@ -1,8 +1,10 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.FontImageMap
import org.openrndr.draw.loadFont
import org.openrndr.draw.loadImage
import org.openrndr.draw.tint
import kotlin.math.cos
import kotlin.math.sin
fun main() = application {
configure {
@@ -12,19 +14,19 @@ fun main() = application {
program {
val image = loadImage("file:data/images/pm5544.png")
val font = FontImageMap.fromUrl("file:data/fonts/IBMPlexMono-Regular.ttf", 64.0)
val image = loadImage("data/images/pm5544.png")
val font = loadFont("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(Math.cos(seconds)*width/2.0+width/2.0, Math.sin(0.5*seconds)*height/2.0 + height/2.0, 140.0)
drawer.circle(cos(seconds) * width / 2.0 + width / 2.0, sin(0.5 * seconds) * height / 2.0 + height / 2.0, 140.0)
drawer.fontMap = font
drawer.fill = ColorRGBa.WHITE
drawer.text("OPENRNDR", width/2.0, height /2.0)
drawer.text("OPENRNDR", width / 2.0, height / 2.0)
}
}
}