[orx-filters] Set shader parameter to null in Filter constructors

This commit is contained in:
Edwin Jakobs
2025-08-18 15:09:27 +02:00
parent 48b61c39e8
commit 8b4d31786c
15 changed files with 18 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ private var filterQuadFormat = vertexFormat {
/**
* Filter base class. Renders "full-screen" quads.
*/
open class CubemapFilter(private val shader: Shader? = null, private val watcher: ShaderWatcher? = null) {
open class CubemapFilter(private val shader: Shader? = null) {
/**
* parameter map
@@ -79,7 +79,9 @@ open class CubemapFilter(private val shader: Shader? = null, private val watcher
}
fun apply(source: Array<Cubemap>, target: RenderTarget) {
val shader = if (this.watcher != null) watcher.shader!! else this.shader!!
if (shader == null) {
return
}
target.bind()
if (filterQuad == null) {