Skip to content

Commit 579797f

Browse files
Migrate to Compose Multiplatform (#3)
* Added KMP support for iOS * added working ios example * added working ios example replaced ios project with uikit one * cleaned up code added entry point for desktop compose * added support for browser Added skia support for browser through BrowserViewportWindow * added a new mandela pattern * Optimized performance for some older ones fix broken animation add variation of PersistableCanvas * updated jekyll readmes with new gifs * updated documentation Added links to sources * fix duplicate double conversion
1 parent 418452f commit 579797f

File tree

95 files changed

+1392
-802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1392
-802
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
*.iml
2+
.gradle
3+
.idea
4+
.DS_Store
5+
build
6+
captures
7+
.externalNativeBuild
8+
.cxx
19
/.gradle/
210
/build/
311
/.idea/
412
/local.properties
13+
xcuserdata
14+
/kotlin-js-store/yarn.lock

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@
44

55
### [Creative Coding Examples](https://thelumiereguy.github.io/CreativeCodingExamples/)
66

7-
A collection of Creative Coding examples by me & other artists. We've used Jetpack Compose and Processing (Java Edition) to create these.
7+
A collection of Creative Coding examples by me & other artists. We've used Jetbrains Compose and Processing (Java Edition) to create these.
88

99

1010
| Example | Screenshot | Link(s) |
1111
| :---: | :-: | :-: |
12-
| Circle Pattern | ![Circle Pattern](https://user-images.githubusercontent.com/46375353/179366829-64cd405a-9100-42b7-a1e0-e3320285f56c.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/circle_pattern/CirclePattern.kt) / [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/circle_pattern/DrawCirclePatternComposable.kt) |
12+
| Circle Pattern | ![Circle Pattern](https://user-images.githubusercontent.com/46375353/179366829-64cd405a-9100-42b7-a1e0-e3320285f56c.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/circle_pattern/CirclePattern.kt) / [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/circle_pattern/DrawCirclePatternComposable.kt) |
1313
| Circleception | ![Circleception](https://user-images.githubusercontent.com/46375353/179367087-85e7421b-b513-4da0-b6f6-681bcd4e477d.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/circleception/Circleception.kt) |
1414
| Divine Intervention | ![DivineIntervention](https://user-images.githubusercontent.com/46375353/179367322-707adf6a-3974-4163-be93-ce4be088a96d.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/divine_intervention/DivineIntervention.kt) |
1515
| Fractal Spirograph | ![FractalSpirograph](https://user-images.githubusercontent.com/46375353/179367414-269f33f1-70be-4b5b-ac15-b163190be50e.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/fractal_spiralograph/FractalSpirograph.kt) |
1616
| Hexagonal Mandela | ![HexagonalMandela](https://user-images.githubusercontent.com/46375353/179367484-ec5fdaae-6bce-40c8-8d85-4b5686669a26.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/hexagonal_mandela/HexagonalMandela.kt)|
1717
| Iris | ![Iris](https://user-images.githubusercontent.com/46375353/179367667-cd1b3dba-6bdb-4db9-84c8-478bf1c4bfb8.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/iris/Iris.kt)|
1818
| Phyllotaxis | ![Phyllotaxis](https://user-images.githubusercontent.com/46375353/179415678-b0a9a4db-4cdd-4a4f-8fdb-ba641a8b4630.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/phyllotaxis/Phyllotaxis.kt)|
1919
| Whirlpool | ![Whirlpool](https://user-images.githubusercontent.com/46375353/179419156-b761c125-6e90-43f1-beb1-0f2d146579fc.png) | [Processing](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/processing/src/main/kotlin/dev/thelumiereguy/examples/whirlpool/Whirlpool.kt)|
20-
| Animated Shapes | ![AnimatedShapes](https://user-images.githubusercontent.com/46375353/180615046-350a6bb4-5a2b-4c6e-8afb-621a099decb6.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/5b445fe655e11224078b8c21891dcb21498d08d2/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/animated_shapes/AnimatedShapes.kt#L80)|
21-
| Bouncy Balls | ![BouncyBalls](https://user-images.githubusercontent.com/46375353/180617883-ec901aaf-30b6-4f90-a574-24dbd0fec9c5.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/bouncy_balls_sound/BouncyBalls.kt)|
22-
| Cantor Circles | ![Cantor Circles](https://user-images.githubusercontent.com/46375353/180618092-ba3cd911-8056-4213-b917-0e1c5c64f072.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/cantor_circles/CantorCirclePattern.kt)|
23-
| Dot Product Shading | ![Dot Product Shading](https://user-images.githubusercontent.com/46375353/180618953-d41e0336-5a25-4c74-b220-63026b5a5f05.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/dot_product_shading/DotProductShading.kt)|
24-
| Stroked Ripples | ![Stroked Ripples](https://user-images.githubusercontent.com/46375353/180619124-c945242d-1fcf-48d7-9025-cbfbb04c4715.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/stroked_ripples/StrokedRipples.kt)|
25-
| Torus | ![Torus](https://user-images.githubusercontent.com/46375353/180619244-1f412194-2963-45c9-8023-64392e554601.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/torus/Torus.kt)|
26-
| Cubic Sphere | ![Cubic Sphere](https://user-images.githubusercontent.com/46375353/180620025-9a10a098-ca6f-4c3b-a570-ac5929faeda8.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/cubic_sphere/CubicSphere.kt)|
27-
| A basic Flow field | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/194867317-9949df47-5dcb-4b98-b9da-e2b769458fae.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/basic_flow_field/BasicFlowField.kt)|
28-
| Flow field Variation 1 | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/195086156-c7a47bda-a483-4263-aba5-75b63c590a42.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/flow_field_patterns/FlowFieldPattern1.kt)|
29-
| Flow field Variation 2 | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/195086168-eaf28638-e5b9-4410-ba2a-2e7df2bd9ac5.png) | [Jetpack Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/flow_field_patterns/FlowFieldPattern2.kt)|
20+
| Animated Shapes | ![AnimatedShapes](https://user-images.githubusercontent.com/46375353/180615046-350a6bb4-5a2b-4c6e-8afb-621a099decb6.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/5b445fe655e11224078b8c21891dcb21498d08d2/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/animated_shapes/AnimatedShapes.kt#L80)|
21+
| Bouncy Balls | ![BouncyBalls](https://user-images.githubusercontent.com/46375353/180617883-ec901aaf-30b6-4f90-a574-24dbd0fec9c5.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/bouncy_balls_sound/BouncyBalls.kt)|
22+
| Cantor Circles | ![Cantor Circles](https://user-images.githubusercontent.com/46375353/180618092-ba3cd911-8056-4213-b917-0e1c5c64f072.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/cantor_circles/CantorCirclePattern.kt)|
23+
| Dot Product Shading | ![Dot Product Shading](https://user-images.githubusercontent.com/46375353/180618953-d41e0336-5a25-4c74-b220-63026b5a5f05.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/dot_product_shading/DotProductShading.kt)|
24+
| Stroked Ripples | ![Stroked Ripples](https://user-images.githubusercontent.com/46375353/180619124-c945242d-1fcf-48d7-9025-cbfbb04c4715.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/stroked_ripples/StrokedRipples.kt)|
25+
| Torus | ![Torus](https://user-images.githubusercontent.com/46375353/180619244-1f412194-2963-45c9-8023-64392e554601.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/torus/Torus.kt)|
26+
| Cubic Sphere | ![Cubic Sphere](https://user-images.githubusercontent.com/46375353/180620025-9a10a098-ca6f-4c3b-a570-ac5929faeda8.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/cubic_sphere/CubicSphere.kt)|
27+
| A basic Flow field | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/194867317-9949df47-5dcb-4b98-b9da-e2b769458fae.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/basic_flow_field/BasicFlowField.kt)|
28+
| Flow field Variation 1 | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/195086156-c7a47bda-a483-4263-aba5-75b63c590a42.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/flow_field_patterns/FlowFieldPattern1.kt)|
29+
| Flow field Variation 2 | ![Basic Flow Field](https://user-images.githubusercontent.com/46375353/195086168-eaf28638-e5b9-4410-ba2a-2e7df2bd9ac5.png) | [Jetbrains Compose](https://github.com/thelumiereguy/CreativeCodingExamples/blob/master/jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/examples/flow_field_patterns/FlowFieldPattern2.kt)|
3030

3131

3232
### Contributions
@@ -38,6 +38,7 @@ We would like you to play with this repository and contribute and show-off your
3838
1. [**k5-compose**](https://github.com/CuriousNikhil/k5-compose) - A p5.js port for Jetpack Compose Desktop
3939
2. [**Processing**](https://processing.org/) - Processing [Java Edition]
4040
3. [**Jetpack Compose**](https://developer.android.com/jetpack/compose) - Jetpack Compose on Mobile
41+
4. [**Jetbrains Compose**](https://www.jetbrains.com/lp/compose-mpp/) - Jetbrains Compose for Android, iOS, Web, Desktop
4142
- All above three modules are separated in the repository.
4243

4344
**Please check the [contribution guide in wiki](https://github.com/thelumiereguy/CreativeCodingExamples/wiki/Contribution-Guide) to upload your artworks!**

androidApp/build.gradle.kts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
plugins {
2+
id("com.android.application")
3+
kotlin("android")
4+
}
5+
6+
repositories {
7+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
8+
google()
9+
mavenCentral()
10+
}
11+
12+
android {
13+
namespace = "dev.thelumiereguy.creative_coding_compose.android"
14+
compileSdk = 33
15+
defaultConfig {
16+
applicationId = "dev.thelumiereguy.creative_coding_compose.android"
17+
minSdk = 21
18+
targetSdk = 33
19+
versionCode = 1
20+
versionName = "1.0"
21+
}
22+
buildFeatures {
23+
compose = true
24+
}
25+
composeOptions {
26+
kotlinCompilerExtensionVersion = "1.3.0"
27+
}
28+
compileOptions {
29+
sourceCompatibility = JavaVersion.VERSION_11
30+
targetCompatibility = JavaVersion.VERSION_11
31+
}
32+
kotlinOptions {
33+
jvmTarget = "11"
34+
}
35+
packagingOptions {
36+
resources {
37+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
38+
}
39+
}
40+
buildTypes {
41+
getByName("release") {
42+
isMinifyEnabled = false
43+
}
44+
}
45+
}
46+
47+
dependencies {
48+
implementation(project(":compose_common"))
49+
implementation("androidx.compose.ui:ui:1.2.1")
50+
implementation("androidx.compose.ui:ui-tooling:1.2.1")
51+
implementation("androidx.compose.ui:ui-tooling-preview:1.2.1")
52+
implementation("androidx.compose.foundation:foundation:1.2.1")
53+
implementation("androidx.compose.material:material:1.2.1")
54+
implementation("androidx.activity:activity-compose:1.6.0")
55+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/Theme.CreativeCodingExamples">
12+
<activity
13+
android:name=".MainActivity"
14+
android:exported="true">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN"/>
17+
18+
<category android:name="android.intent.category.LAUNCHER"/>
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>

jetpack-compose/src/main/java/dev/thelumiereguy/creative_coding_compose/MainActivity.kt renamed to androidApp/src/main/java/dev/thelumiereguy/creative_coding_compose/android/MainActivity.kt

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dev.thelumiereguy.creative_coding_compose
1+
package dev.thelumiereguy.creative_coding_compose.android
22

33
import android.app.Activity
44
import android.os.Build
@@ -11,22 +11,17 @@ import androidx.compose.foundation.background
1111
import androidx.compose.foundation.layout.fillMaxSize
1212
import androidx.compose.ui.Modifier
1313
import androidx.compose.ui.graphics.Color
14-
import dev.thelumiereguy.creative_coding_compose.examples.flow_field_patterns.FlowFieldPattern1
15-
import dev.thelumiereguy.creative_coding_compose.theme.CreativeCodingComposeTheme
14+
import dev.thelumiereguy.creative_coding_compose.CreativeCodingExampleScreen
1615

1716
class MainActivity : ComponentActivity() {
18-
1917
override fun onCreate(savedInstanceState: Bundle?) {
2018
super.onCreate(savedInstanceState)
21-
setFullScreen()
2219
setContent {
23-
CreativeCodingComposeTheme {
24-
FlowFieldPattern1(
25-
modifier = Modifier
26-
.fillMaxSize()
27-
.background(Color.Black)
28-
)
29-
}
20+
CreativeCodingExampleScreen(
21+
Modifier
22+
.fillMaxSize()
23+
.background(Color.Black)
24+
)
3025
}
3126
}
3227
}

0 commit comments

Comments
 (0)