Skip to content

Commit

Permalink
fix: use mutable state for GLSurface.fboSizeOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Oct 15, 2024
1 parent 0f8c086 commit 9a4966e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/silenium/compose/gl/surface/GLSurface.kt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class GLSurface internal constructor(
private val cleanupBlock: () -> Unit = {},
private val presentMode: PresentMode = PresentMode.MAILBOX,
private val swapChainSize: Int = 10,
internal var fboSizeOverride: FBOSizeOverride? = null,
fboSizeOverride: FBOSizeOverride? = null,
) : Thread("GLSurfaceView-${index.getAndIncrement()}") {
enum class PresentMode(internal val impl: (Int, (IntSize) -> FBO) -> FBOSwapChain) {
/**
Expand All @@ -213,12 +213,12 @@ class GLSurface internal constructor(
*/
FIFO(::FBOFifoSwapChain),
}

private var directContext: DirectContext? = null
private var renderContext: GLContext<*>? = null
private var size: IntSize = IntSize.Zero
private var fboPool: FBOPool? = null
internal var invalidations by mutableStateOf(0L)
internal var fboSizeOverride: FBOSizeOverride? by mutableStateOf(fboSizeOverride)

internal fun launch() {
GL.createCapabilities()
Expand Down

0 comments on commit 9a4966e

Please sign in to comment.