Update demos to use MouseTracker (#303)

This commit is contained in:
Abe Pazos
2023-04-19 09:55:24 +02:00
committed by GitHub
parent 4d6b78b73c
commit a8c2f7217c
5 changed files with 17 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import org.openrndr.MouseTracker
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*
@@ -37,6 +38,7 @@ fun main() = application {
//x_fill.rgb = vec3(1.0 / (x_fill.r + x_fill.g));
"""
}
val mouseTracker = MouseTracker(mouse)
extend {
// Draw moving white shapes on a black background
@@ -68,7 +70,7 @@ fun main() = application {
directionalField.apply(rt.colorBuffer(0), result)
drawer.isolated {
if (mouse.pressedButtons.isEmpty()) {
if (mouseTracker.pressedButtons.isEmpty()) {
shadeStyle = shader
image(result)
} else {