Switch back to fun main()

This commit is contained in:
Edwin Jakobs
2021-08-30 17:18:54 +02:00
parent c5a95f8d17
commit 9a2f10f81d
187 changed files with 313 additions and 316 deletions

View File

@@ -2,7 +2,7 @@
import org.openrndr.application
import org.openrndr.draw.loadImage
suspend fun main() {
fun main() {
application {
program {
val image16 = loadImage("demo-data/images/16-bit.png")

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.math.Vector2
import org.openrndr.shape.contour
suspend fun main() = application {
fun main() = application {
program {
class A: Animatable() {
var x = 0.0

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.math.Vector2
import org.openrndr.shape.contour
suspend fun main() = application {
fun main() = application {
program {
val a = object {
var x = 0.0

View File

@@ -1,7 +1,7 @@
import org.openrndr.application
import org.openrndr.internal.colorBufferLoader
suspend fun main() {
fun main() {
application {
program {
extend {

View File

@@ -10,7 +10,7 @@ import org.openrndr.math.Vector2
import org.openrndr.math.Vector3
suspend fun main() = application {
fun main() = application {
configure {
multisample = WindowMultisample.SampleCount(8)

View File

@@ -2,15 +2,15 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.math.CatmulRomChain2
import org.openrndr.math.CatmullRomChain2
import org.openrndr.math.Polar
import org.openrndr.shape.ShapeContour
import org.openrndr.shape.toContour
suspend fun main() = application {
fun main() = application {
program {
val points = List(6) { Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center }
val cmr = CatmulRomChain2(points, 1.0, loop = true)
val cmr = CatmullRomChain2(points, 1.0, loop = true)
val contour = ShapeContour.fromPoints(cmr.positions(200), true)
extend {

View File

@@ -4,7 +4,7 @@ import org.openrndr.color.ColorRGBa
/*
This demo just verifies that drawing a single circle still works with revamped circle drawing code
*/
suspend fun main() = application {
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.GRAY)

View File

@@ -11,7 +11,7 @@ Batches are (currently) static but stored in GPU memory but can be
animated using a vertex shader. Batches are fast to draw.
*/
suspend fun main() = application {
fun main() = application {
program {
val batch = drawer.circleBatch {
for (i in 0 until 2000) {

View File

@@ -8,7 +8,7 @@ import kotlin.math.abs
This program demonstrates dynamic circle batches
*/
suspend fun main() = application {
fun main() = application {
program {
extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application {
fun main() = application {
program {
val cb0 = loadImage("demo-data/images/image-001.png")
val cb1 = cb0.createEquivalent()

View File

@@ -6,7 +6,7 @@ import org.openrndr.shape.drawComposition
import org.openrndr.svg.toSVG
import org.openrndr.svg.writeSVG
suspend fun main() {
fun main() {
application {
program {
extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.shape.ClipMode
import org.openrndr.shape.drawComposition
suspend fun main() {
fun main() {
application {
program {
val cd = drawComposition {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.shape.ClipMode
import org.openrndr.shape.drawComposition
suspend fun main() {
fun main() {
application {
program {
val cd = drawComposition {

View File

@@ -7,7 +7,7 @@ import org.openrndr.shape.Circle
*
* This was made to assist in resolving https://github.com/openrndr/openrndr/issues/164
*/
suspend fun main() = application {
fun main() = application {
program {
val c = Circle(200.0, 200.0, 10.0).contour
extend {

View File

@@ -18,7 +18,7 @@ fun arc(start: Vector2, end: Vector2, radius: Double): ShapeContour {
}
}
suspend fun main() = application {
fun main() = application {
configure {
width = 800
height = 800

View File

@@ -4,7 +4,7 @@ import org.openrndr.draw.isolated
import org.openrndr.shape.Circle
import org.openrndr.shape.Rectangle
suspend fun main() {
fun main() {
application {
configure {
width = 720

View File

@@ -5,7 +5,7 @@ import org.openrndr.shape.Circle
import org.openrndr.shape.Rectangle
import org.openrndr.shape.intersections
suspend fun main() {
fun main() {
application {
program {
extend {

View File

@@ -8,7 +8,7 @@ import kotlin.math.PI
import kotlin.math.cos
import kotlin.math.sin
suspend fun main() = application {
fun main() = application {
program {
val points = 200
extend {

View File

@@ -6,7 +6,7 @@ import org.openrndr.draw.shadeStyle
import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application {
fun main() = application {
program {
val cubemap = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application {
fun main() = application {
program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh()

View File

@@ -3,7 +3,7 @@ import org.openrndr.draw.*
import org.openrndr.extras.camera.Orbital
import org.openrndr.extras.meshgenerators.boxMesh
suspend fun main() = application {
fun main() = application {
program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh()

View File

@@ -1,7 +1,7 @@
import org.openrndr.application
import org.openrndr.draw.loadImage
suspend fun main() {
fun main() {
application {
program {
val image = loadImage("demo-data/images/image-001.dds")

View File

@@ -7,7 +7,7 @@ import org.openrndr.extras.meshgenerators.boxMesh
import org.openrndr.resourceText
import org.openrndr.resourceUrl
suspend fun main() {
fun main() {
application {
program {
val vb = boxMesh()

View File

@@ -6,7 +6,7 @@ import org.openrndr.internal.Driver
import org.openrndr.math.Vector3
suspend fun main() = application {
fun main() = application {
program {
val shader = Shader.createFromCode(vsCode =

View File

@@ -6,7 +6,7 @@ import org.openrndr.internal.Driver
import org.openrndr.math.Vector3
suspend fun main() = application {
fun main() = application {
program {
val cb = colorBuffer(128, 128)
extend {

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*
suspend fun main() = application {
fun main() = application {
program {
val cb = colorBuffer(128, 128)
val at = arrayTexture(128, 128, 32)

View File

@@ -13,7 +13,7 @@ import org.openrndr.shape.Triangle
* a 3x3 grid of triangles and lines.
*/
suspend fun main() {
fun main() {
application {
configure {
width = 720

View File

@@ -4,7 +4,7 @@ import org.openrndr.draw.shadeStyle
import org.openrndr.extensions.Screenshots
import org.openrndr.math.Polar
import org.openrndr.shape.contour
suspend fun main() = application {
fun main() = application {
program {
val style = shadeStyle {
//fragmentTransform = "x_stroke.a *= step(0.5, fract(c_contourPosition / p_dashLen));"

View File

@@ -1,7 +1,7 @@
import org.openrndr.CursorType
import org.openrndr.application
suspend fun main() {
fun main() {
application {
program {
keyboard.character.listen {

View File

@@ -4,7 +4,7 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.pointBatch
suspend fun main() = application {
fun main() = application {
program {
val storedBatch = drawer.pointBatch {
for (y in 10 until height step 20) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extras.meshgenerators.boxMesh
import org.openrndr.ffmpeg.VideoPlayerFFMPEG
import org.openrndr.math.Vector3
suspend fun main() {
fun main() {
application {
program {
val cube = boxMesh()

View File

@@ -5,7 +5,7 @@ import org.openrndr.math.Vector3
import org.openrndr.resourceText
import org.openrndr.resourceUrl
suspend fun main() {
fun main() {
application {
program {
val vb = vertexBuffer(vertexFormat {

View File

@@ -8,7 +8,7 @@ import org.openrndr.resourceText
import org.openrndr.resourceUrl
import org.openrndr.shape.Ellipse
suspend fun main() {
fun main() {
application {
program {
val ellipse = Ellipse(width/2.0, height/2.0, 100.0, 300.0).contour

View File

@@ -8,7 +8,7 @@ import org.openrndr.resourceText
import org.openrndr.resourceUrl
import org.openrndr.shape.Ellipse
suspend fun main() {
fun main() {
application {
program {

View File

@@ -14,7 +14,7 @@ import org.openrndr.shape.path3D
import org.openrndr.extra.shaderphrases.preprocessedFromUrls
import kotlin.math.cos
suspend fun main() {
fun main() {
application {
program {
extend(Orbital())

View File

@@ -3,7 +3,7 @@ import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*
import org.openrndr.extensions.Screenshots
suspend fun main() = application {
fun main() = application {
program {
val volumeTexture = VolumeTexture.create(128,128,32)
val rt = renderTarget(128, 128) {

View File

@@ -8,7 +8,7 @@ import org.openrndr.extra.noise.Random
import org.openrndr.math.Vector2
import org.openrndr.shape.Rectangle
suspend fun main() = application {
fun main() = application {
program {
val margin = 5.0
val squareSize = 100.0

View File

@@ -3,7 +3,7 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
suspend fun main() = application {
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.GRAY)

View File

@@ -3,7 +3,7 @@ import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.rectangleBatch
suspend fun main() = application {
fun main() = application {
program {
val batch = drawer.rectangleBatch {
fill = ColorRGBa.PINK

View File

@@ -3,7 +3,7 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
suspend fun main() = application {
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.GRAY)