Skip to content

Commit

Permalink
Release shader on recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Jul 27, 2024
1 parent 1b6103c commit 3302a1d
Show file tree
Hide file tree
Showing 15 changed files with 125 additions and 93 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ android {
applicationId "app.jerboa.spp"
minSdk 23
targetSdk 34
versionCode 43
versionName "0.6.0"
versionCode 44
versionName "0.6.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/app/jerboa/spp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import android.widget.Toast
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import app.jerboa.spp.ViewModel.MUSIC
import app.jerboa.spp.ViewModel.REVIEW_RATE_LIMIT_MILLIS
import app.jerboa.spp.ViewModel.RenderViewModel
import app.jerboa.spp.ViewModel.SOCIAL
import app.jerboa.spp.viewmodel.MUSIC
import app.jerboa.spp.viewmodel.REVIEW_RATE_LIMIT_MILLIS
import app.jerboa.spp.viewmodel.RenderViewModel
import app.jerboa.spp.viewmodel.SOCIAL
import app.jerboa.spp.composable.renderScreen
import app.jerboa.spp.ui.theme.SPPTheme
import com.google.android.gms.common.ConnectionResult
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/app/jerboa/spp/composable/about.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import app.jerboa.spp.AppInfo
import app.jerboa.spp.R
import app.jerboa.spp.ViewModel.SOCIAL
import app.jerboa.spp.viewmodel.SOCIAL

@OptIn(ExperimentalAnimationApi::class)
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import app.jerboa.spp.ViewModel.COLOUR_MAP
import app.jerboa.spp.viewmodel.COLOUR_MAP

@Composable
fun colourMapMenu(
Expand Down
30 changes: 15 additions & 15 deletions app/src/main/java/app/jerboa/spp/composable/mainMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import app.jerboa.spp.AppInfo
import app.jerboa.spp.ViewModel.COLOUR_MAP
import app.jerboa.spp.ViewModel.MAX_LOG_AR
import app.jerboa.spp.ViewModel.MAX_LOG_FADE
import app.jerboa.spp.ViewModel.MAX_LOG_MASS
import app.jerboa.spp.ViewModel.MAX_LOG_ORBIT
import app.jerboa.spp.ViewModel.MAX_LOG_SPEED
import app.jerboa.spp.ViewModel.MAX_LOG_SPIN
import app.jerboa.spp.ViewModel.MAX_PARTICLES
import app.jerboa.spp.ViewModel.MIN_LOG_AR
import app.jerboa.spp.ViewModel.MIN_LOG_FADE
import app.jerboa.spp.ViewModel.MIN_LOG_MASS
import app.jerboa.spp.ViewModel.MIN_LOG_ORBIT
import app.jerboa.spp.ViewModel.MIN_LOG_SPIN
import app.jerboa.spp.ViewModel.PARAM
import app.jerboa.spp.ViewModel.TOY
import app.jerboa.spp.viewmodel.COLOUR_MAP
import app.jerboa.spp.viewmodel.MAX_LOG_AR
import app.jerboa.spp.viewmodel.MAX_LOG_FADE
import app.jerboa.spp.viewmodel.MAX_LOG_MASS
import app.jerboa.spp.viewmodel.MAX_LOG_ORBIT
import app.jerboa.spp.viewmodel.MAX_LOG_SPEED
import app.jerboa.spp.viewmodel.MAX_LOG_SPIN
import app.jerboa.spp.viewmodel.MAX_PARTICLES
import app.jerboa.spp.viewmodel.MIN_LOG_AR
import app.jerboa.spp.viewmodel.MIN_LOG_FADE
import app.jerboa.spp.viewmodel.MIN_LOG_MASS
import app.jerboa.spp.viewmodel.MIN_LOG_ORBIT
import app.jerboa.spp.viewmodel.MIN_LOG_SPIN
import app.jerboa.spp.viewmodel.PARAM
import app.jerboa.spp.viewmodel.TOY
import kotlin.math.ceil
import kotlin.math.log10
import kotlin.math.pow
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/app/jerboa/spp/composable/menuPrompt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
Expand All @@ -17,10 +16,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import app.jerboa.spp.ViewModel.MUSIC
import app.jerboa.spp.viewmodel.MUSIC

@OptIn(ExperimentalAnimationApi::class)
@Composable
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/app/jerboa/spp/composable/renderScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package app.jerboa.spp.composable

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -11,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import app.jerboa.spp.AppInfo
import app.jerboa.spp.ViewModel.*
import app.jerboa.spp.viewmodel.*

@Composable
fun renderScreen(
Expand Down
15 changes: 6 additions & 9 deletions app/src/main/java/app/jerboa/spp/composable/screen.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package app.jerboa.spp.composable

import android.annotation.SuppressLint
import android.util.Log
import androidx.compose.animation.*
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView
import androidx.lifecycle.MutableLiveData
import app.jerboa.spp.AppInfo
import app.jerboa.spp.ViewModel.COLOUR_MAP
import app.jerboa.spp.ViewModel.MUSIC
import app.jerboa.spp.ViewModel.PARAM
import app.jerboa.spp.ViewModel.SOCIAL
import app.jerboa.spp.ViewModel.TOY
import app.jerboa.spp.data.ColourMap
import app.jerboa.spp.ui.SPPView
import app.jerboa.spp.viewmodel.COLOUR_MAP
import app.jerboa.spp.viewmodel.MUSIC
import app.jerboa.spp.viewmodel.PARAM
import app.jerboa.spp.viewmodel.SOCIAL
import app.jerboa.spp.viewmodel.TOY
import app.jerboa.spp.ui.view.SPPView
import kotlinx.coroutines.launch

@OptIn(ExperimentalAnimationApi::class)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/app/jerboa/spp/composable/socials.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import app.jerboa.spp.AppInfo
import app.jerboa.spp.R
import app.jerboa.spp.ViewModel.SOCIAL
import app.jerboa.spp.viewmodel.SOCIAL

@Composable
fun socials(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/app/jerboa/spp/data/Shader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package app.jerboa.spp.data

import android.opengl.GLES31
import android.util.Log
import app.jerboa.glskeleton.utils.compileGLSLProgram
import app.jerboa.spp.utils.compileGLSLProgram
import java.nio.ByteBuffer
import java.nio.ByteOrder

Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/app/jerboa/spp/data/ShaderData.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package app.jerboa.spp.data

import android.util.Log
import app.jerboa.glskeleton.utils.compileGLSLProgram
import java.nio.ByteBuffer
import java.nio.ByteOrder
import android.opengl.GLES31 as gl3

abstract class ShaderData(open val vertexShader: String, open val fragmentShader: String)
class Mat4(
val elements: FloatArray = FloatArray(16){0f}
Expand Down
Loading

0 comments on commit 3302a1d

Please sign in to comment.