Skip to content

Commit

Permalink
fix shaders loading bug and update openglfx dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-sts committed May 26, 2024
1 parent 445bce2 commit 9d8ec35
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ dependencies {
testImplementation("org.testfx:openjfx-monocle:$testfxMonocleVersion")
testImplementation("io.mockk:mockk:$mockkVersion")

implementation("com.github.husker-dev.openglfx:core:$openglfxVersion")
implementation("com.github.husker-dev.openglfx:lwjgl:$openglfxVersion")
implementation("com.huskerdev:openglfx:$openglfxVersion")
implementation("com.huskerdev:openglfx-lwjgl:$openglfxVersion")
implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion"))
implementation("org.lwjgl:lwjgl:$lwjglVersion")
implementation("org.lwjgl:lwjgl-assimp:$lwjglVersion")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ junitJupiterEngineVersion=5.9.2
testfxVersion=4.0.16-alpha
testfxMonocleVersion=jdk-12.0.1+2
mockkVersion=1.13.5
openglfxVersion=3.0.5
openglfxVersion=4.0.5
lwjglVersion=3.3.3
jomlVersion=1.10.5
14 changes: 7 additions & 7 deletions src/main/kotlin/solve/rendering/canvas/OpenGLCanvas.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package solve.rendering.canvas

import com.huskerdev.openglfx.GLCanvasAnimator
import com.huskerdev.openglfx.events.GLDisposeEvent
import com.huskerdev.openglfx.events.GLInitializeEvent
import com.huskerdev.openglfx.events.GLRenderEvent
import com.huskerdev.openglfx.events.GLReshapeEvent
import com.huskerdev.openglfx.canvas.GLCanvasAnimator
import com.huskerdev.openglfx.canvas.events.GLDisposeEvent
import com.huskerdev.openglfx.canvas.events.GLInitializeEvent
import com.huskerdev.openglfx.canvas.events.GLRenderEvent
import com.huskerdev.openglfx.canvas.events.GLReshapeEvent
import com.huskerdev.openglfx.lwjgl.LWJGLExecutor
import org.joml.Vector2i
import org.lwjgl.opengl.GL.createCapabilities
Expand All @@ -28,10 +28,10 @@ import solve.rendering.engine.Window
import solve.rendering.engine.utils.minus
import solve.rendering.engine.utils.plus
import solve.rendering.engine.utils.toFloatVector
import com.huskerdev.openglfx.OpenGLCanvas as OpenGLFXCanvas
import com.huskerdev.openglfx.canvas.GLCanvas as OpenGLFXCanvas

abstract class OpenGLCanvas {
val canvas: OpenGLFXCanvas = OpenGLFXCanvas.create(LWJGLExecutor.LWJGL_MODULE)
val canvas: OpenGLFXCanvas = OpenGLFXCanvas(LWJGLExecutor.LWJGL_MODULE, flipY = true)

protected lateinit var window: Window

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package solve.rendering.engine.core.texture

import com.huskerdev.openglfx.core.GL_NEAREST
import org.joml.Vector2f
import org.lwjgl.opengl.GL11.GL_LINEAR
import org.lwjgl.opengl.GL11.GL_NEAREST
import org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER
import org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER
import org.lwjgl.opengl.GL11.glBindTexture
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/solve/utils/ResourcesUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fun getResourceAbsolutePath(resourcesPath: String): String? {
return null
}

return resourceAbsolutePath.substring(1..resourceAbsolutePath.lastIndex)
return resourceAbsolutePath
}

private fun getResource(resourcesPath: String) = Any::class::class.java.getResource("/$resourcesPath")
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal class ImagePlanesParserTests {
val chosenRGBColor = if (unpaintedColors.isEmpty()) {
usedColors.random()
} else {
unpaintedColors.removeFirst()
unpaintedColors.removeAt(0)
}
val chosenColor = getColorByIntRGB(chosenRGBColor)

Expand Down

0 comments on commit 9d8ec35

Please sign in to comment.