Skip to content

Commit

Permalink
Propagates GameWindow.Quality to RenderContext
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Jul 4, 2023
1 parent b9213f1 commit 726759e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ class RenderContext(
/** Object storing all the rendering [Stats] like number of batches, number of vertices etc. */
val stats: Stats = Stats(),
val coroutineContext: CoroutineContext = EmptyCoroutineContext,
val batchMaxQuads: Int = BatchBuilder2D.DEFAULT_BATCH_QUADS
val batchMaxQuads: Int = BatchBuilder2D.DEFAULT_BATCH_QUADS,
val windowConfig: GameWindowConfig = GameWindowConfig.Impl()
) :
Extra by Extra.Mixin(),
BoundsProvider by bp,
AGFeatures by ag,
DeviceDimensionsProvider by deviceDimensionsProvider,
Closeable
{
val quality: GameWindow.Quality get() = windowConfig.quality

@PublishedApi internal val _buffers = AGProgramWithUniforms.BufferCache()
private val _programs = FastIdentityMap<Program, AGProgramWithUniforms>()

Expand Down
2 changes: 1 addition & 1 deletion korge/src/commonMain/kotlin/korlibs/korge/view/Views.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Views(
var name: String? = null
var currentVfs: VfsFile = resourcesVfs
var imageFormats = RegisteredImageFormats
val renderContext = RenderContext(ag, this, gameWindow, stats, coroutineContext, batchMaxQuads)
val renderContext = RenderContext(ag, this, gameWindow, stats, coroutineContext, batchMaxQuads, gameWindow)
@Deprecated("") val agBitmapTextureManager get() = renderContext.agBitmapTextureManager
@Deprecated("") val agBufferManager get() = renderContext.agBufferManager
var clearEachFrame = true
Expand Down

0 comments on commit 726759e

Please sign in to comment.