Add orx-view-box, adjust for api changes in OPENRNDR

This commit is contained in:
Edwin Jakobs
2022-11-30 11:32:12 +01:00
parent 711222db33
commit 4c22687763
16 changed files with 349 additions and 33 deletions

View File

@@ -138,16 +138,3 @@ private val watchThread by lazy {
}
}
}
fun main() {
val a = watchFile(Program(), File("README.md")) {
it.readText()
}
a.stop()
a.triggerChange()
while (true) {
println(a())
Thread.sleep(2000)
}
}

View File

@@ -77,7 +77,6 @@ class Olive<P : Program>(val resources: Resources? = null, private var scriptMod
val originalExtensions = program.extensions.map { it }
val trackedListeners = listOf<Event<*>>(program.mouse.buttonDown,
program.mouse.buttonUp,
program.mouse.clicked,
program.mouse.dragged,
program.mouse.moved,
program.mouse.scrolled,

View File

@@ -2,13 +2,14 @@ package org.openrndr.extra.olive
import org.openrndr.ApplicationBuilder
import org.openrndr.Program
import org.openrndr.ProgramImplementation
import java.io.File
import java.nio.file.Files
import java.nio.file.Paths
import kotlin.reflect.KProperty
import kotlin.streams.toList
open class OliveProgram(private val sourceLocation: String, private val scriptHost: OliveScriptHost, resources: Resources?) : Program() {
open class OliveProgram(private val sourceLocation: String, private val scriptHost: OliveScriptHost, resources: Resources?) : ProgramImplementation() {
val olive = extend(Olive<OliveProgram>(scriptMode = ScriptMode.OLIVE_PROGRAM, resources = resources)) {
script = sourceLocation
scriptHost = this@OliveProgram.scriptHost

View File

@@ -73,7 +73,7 @@ class ControlManager : Extension {
var body: Element? = null
val layouter = Layouter()
val fontManager = FontManager()
lateinit var window: Program.Window
lateinit var window: Window
private val renderTargetCache = HashMap<Element, RenderTarget>()
lateinit var program: Program
@@ -524,7 +524,7 @@ class ControlManager : Extension {
}
profile("draw image") {
drawer.ortho()
drawer.ortho(RenderTarget.active)
drawer.view = Matrix44.IDENTITY
drawer.defaults()
program.drawer.image(renderTarget.colorBuffer(0), 0.0, 0.0)