mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 13:51:53 +09:00
LibGDX stuffs for issue #23
This commit is contained in:
44
src/net/torvald/terrarum/TestTestTest.kt
Normal file
44
src/net/torvald/terrarum/TestTestTest.kt
Normal file
@@ -0,0 +1,44 @@
|
||||
package net.torvald.terrarum
|
||||
|
||||
import com.badlogic.gdx.ApplicationAdapter
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplication
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
|
||||
import com.badlogic.gdx.graphics.GL20
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2017-06-11.
|
||||
*/
|
||||
class TestTestTest : ApplicationAdapter() {
|
||||
|
||||
lateinit var batch: SpriteBatch
|
||||
lateinit var img: Texture
|
||||
|
||||
override fun create() {
|
||||
batch = SpriteBatch()
|
||||
img = Texture("assets/test_texture.tga")
|
||||
}
|
||||
|
||||
override fun render() {
|
||||
Gdx.gl.glClearColor(1f, 0f, 0f, 1f)
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||
batch.begin()
|
||||
batch.draw(img, 0f, 0f)
|
||||
batch.end()
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
batch.dispose()
|
||||
img.dispose()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) { // LWJGL 3 won't work? java.lang.VerifyError
|
||||
val config = LwjglApplicationConfiguration()
|
||||
LwjglApplication(TestTestTest(), config)
|
||||
}
|
||||
Reference in New Issue
Block a user