diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/RenderTestLoader.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/RenderTestLoader.kt index d545075ac..81fc27f6a 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/RenderTestLoader.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/RenderTestLoader.kt @@ -26,5 +26,6 @@ class RenderTestLoader { RenderTestUtil.rendering.start(latch) latch.dec() latch.await() + RenderTestUtil.context = RenderTestUtil.rendering.renderWindow } } diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/DummyRenderSystem.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/DummyRenderSystem.kt index 0e01ff5eb..c1ae86d98 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/DummyRenderSystem.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/DummyRenderSystem.kt @@ -95,11 +95,11 @@ class DummyRenderSystem( } override fun createIntUniformBuffer(data: IntArray): IntUniformBuffer { - return DummyIntUniformBuffer() + return DummyIntUniformBuffer(data) } override fun createFloatUniformBuffer(data: FloatBuffer): FloatUniformBuffer { - return DummyFloatUniformBuffer() + return DummyFloatUniformBuffer(data) } override fun createFramebuffer(): Framebuffer { diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyFloatUniformBuffer.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyFloatUniformBuffer.kt index 415c26ba8..64374093a 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyFloatUniformBuffer.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyFloatUniformBuffer.kt @@ -19,48 +19,35 @@ import de.bixilon.minosoft.gui.rendering.system.base.buffer.uniform.FloatUniform import de.bixilon.minosoft.gui.rendering.system.base.shader.NativeShader import java.nio.FloatBuffer -class DummyFloatUniformBuffer : FloatUniformBuffer { - override val bindingIndex: Int - get() = TODO("Not yet implemented") +class DummyFloatUniformBuffer( + override var buffer: FloatBuffer, +) : FloatUniformBuffer { + override val bindingIndex: Int = 0 override fun upload(range: IntRange) { - TODO("Not yet implemented") } override fun upload() { - TODO("Not yet implemented") } override fun use(shader: NativeShader, bufferName: String) { - TODO("Not yet implemented") } - override val state: RenderableBufferStates - get() = TODO("Not yet implemented") - override val type: RenderableBufferTypes - get() = TODO("Not yet implemented") + override val state: RenderableBufferStates = RenderableBufferStates.UPLOADED + override val type: RenderableBufferTypes = RenderableBufferTypes.UNIFORM_BUFFER override fun init() { - TODO("Not yet implemented") } override fun initialUpload() { - TODO("Not yet implemented") } override fun bind() { - TODO("Not yet implemented") } override fun unbind() { - TODO("Not yet implemented") } override fun unload() { - TODO("Not yet implemented") } - - override var buffer: FloatBuffer - get() = TODO("Not yet implemented") - set(value) {} } diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyIntUniformBuffer.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyIntUniformBuffer.kt index 681d15d69..8f5b5a254 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyIntUniformBuffer.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/buffer/uniform/DummyIntUniformBuffer.kt @@ -18,48 +18,35 @@ import de.bixilon.minosoft.gui.rendering.system.base.buffer.RenderableBufferType import de.bixilon.minosoft.gui.rendering.system.base.buffer.uniform.IntUniformBuffer import de.bixilon.minosoft.gui.rendering.system.base.shader.NativeShader -class DummyIntUniformBuffer : IntUniformBuffer { - override val bindingIndex: Int - get() = TODO("Not yet implemented") +class DummyIntUniformBuffer( + override var data: IntArray, +) : IntUniformBuffer { + override val bindingIndex: Int = 0 override fun upload(range: IntRange) { - TODO("Not yet implemented") } override fun upload() { - TODO("Not yet implemented") } override fun use(shader: NativeShader, bufferName: String) { - TODO("Not yet implemented") } - override val state: RenderableBufferStates - get() = TODO("Not yet implemented") - override val type: RenderableBufferTypes - get() = TODO("Not yet implemented") + override val state: RenderableBufferStates = RenderableBufferStates.UPLOADED + override val type: RenderableBufferTypes = RenderableBufferTypes.UNIFORM_BUFFER override fun init() { - TODO("Not yet implemented") } override fun initialUpload() { - TODO("Not yet implemented") } override fun bind() { - TODO("Not yet implemented") } override fun unbind() { - TODO("Not yet implemented") } override fun unload() { - TODO("Not yet implemented") } - - override var data: IntArray - get() = TODO("Not yet implemented") - set(value) {} } diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt index d1e6ead11..09a92a823 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyStaticTextureArray.kt @@ -16,6 +16,7 @@ package de.bixilon.minosoft.gui.rendering.system.dummy.texture import de.bixilon.kutil.collections.CollectionUtil.synchronizedMapOf import de.bixilon.kutil.latch.CountUpAndDownLatch import de.bixilon.minosoft.data.registries.ResourceLocation +import de.bixilon.minosoft.gui.rendering.system.base.RenderSystem import de.bixilon.minosoft.gui.rendering.system.base.shader.NativeShader import de.bixilon.minosoft.gui.rendering.system.base.texture.SpriteAnimator import de.bixilon.minosoft.gui.rendering.system.base.texture.StaticTextureArray @@ -23,10 +24,9 @@ import de.bixilon.minosoft.gui.rendering.system.base.texture.TextureArrayStates import de.bixilon.minosoft.gui.rendering.system.base.texture.TextureStates import de.bixilon.minosoft.gui.rendering.system.base.texture.texture.AbstractTexture -class DummyStaticTextureArray : StaticTextureArray { +class DummyStaticTextureArray(renderSystem: RenderSystem) : StaticTextureArray { override val textures: MutableMap = synchronizedMapOf() - override val animator: SpriteAnimator - get() = TODO("Not yet implemented") + override val animator: SpriteAnimator = SpriteAnimator(renderSystem) override val state: TextureArrayStates = TextureArrayStates.DECLARED override fun createTexture(resourceLocation: ResourceLocation, mipmaps: Boolean, default: () -> AbstractTexture): AbstractTexture { @@ -40,6 +40,7 @@ class DummyStaticTextureArray : StaticTextureArray { } override fun load(latch: CountUpAndDownLatch) { + animator.init() } override fun activate() { diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyTextureManager.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyTextureManager.kt index 78640da06..79fda1fa5 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyTextureManager.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/dummy/texture/DummyTextureManager.kt @@ -20,5 +20,5 @@ import de.bixilon.minosoft.gui.rendering.system.base.texture.dynamic.DynamicText class DummyTextureManager(val context: RenderWindow) : TextureManager() { override val dynamicTextures: DynamicTextureArray = DummyDynamicTextureArray() - override val staticTextures: StaticTextureArray = DummyStaticTextureArray() + override val staticTextures: StaticTextureArray = DummyStaticTextureArray(context.renderSystem) } diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/window/dummy/DummyWindow.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/window/dummy/DummyWindow.kt index 40a79d2ac..a27057401 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/window/dummy/DummyWindow.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/system/window/dummy/DummyWindow.kt @@ -14,6 +14,7 @@ package de.bixilon.minosoft.gui.rendering.system.window.dummy import de.bixilon.kotlinglm.vec2.Vec2i +import de.bixilon.kutil.observer.DataObserver.Companion.observed import de.bixilon.kutil.time.TimeUtil import de.bixilon.minosoft.gui.rendering.system.window.BaseWindow import de.bixilon.minosoft.gui.rendering.system.window.CursorModes @@ -35,8 +36,8 @@ class DummyWindow : BaseWindow { override var title: String = "" override val version: String = "dummy" override val time: Double get() = TimeUtil.millis() / 1000.0 - override val iconified: Boolean = false - override val focused: Boolean = false + override val iconified: Boolean by observed(false) + override val focused: Boolean by observed(false) override fun destroy() = Unit