File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
common/src/main/kotlin/com/lambda/graphics/texture Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -25,18 +25,11 @@ import org.lwjgl.opengl.GL45C.*
2525import java.awt.image.BufferedImage
2626
2727open class Texture (
28- private val image : BufferedImage ? ,
28+ image : BufferedImage ? ,
2929 private val levels : Int = 4 ,
3030) {
3131 val id = glGenTextures()
3232
33- open fun init () = image
34- ?.let {
35- bind()
36- upload(it)
37- bind(0 )
38- }
39-
4033 open fun bind (slot : Int = 0) {
4134 bindTexture(id, slot)
4235 glTexParameterf(GL_TEXTURE_2D , GL_TEXTURE_LOD_BIAS , RenderSettings .lodBias)
@@ -70,6 +63,10 @@ open class Texture(
7063 }
7164
7265 init {
73- init () // The overridden method will run and not the base one due to kotlin's order of execution ;)
66+ image?.let {
67+ bind()
68+ upload(it)
69+ bind(0 )
70+ }
7471 }
7572}
You can’t perform that action at this time.
0 commit comments