Update GL46 refs to GL45
This commit is contained in:
parent
85e81a0b0b
commit
352dea020a
@ -9,7 +9,7 @@ import org.lwjgl.glfw.GLFW
|
||||
import org.lwjgl.glfw.GLFWErrorCallback
|
||||
import org.lwjgl.opengl.GL
|
||||
import org.lwjgl.opengl.GL11
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import org.lwjgl.opengl.GLCapabilities
|
||||
import org.lwjgl.system.MemoryStack
|
||||
import org.lwjgl.system.MemoryUtil
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl
|
||||
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import org.lwjgl.system.MemoryUtil
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import java.nio.ByteBuffer
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl
|
||||
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
|
||||
// GL_INVALID_ENUM
|
||||
// GL_INVALID_VALUE
|
||||
|
@ -8,16 +8,16 @@ import org.lwjgl.opengl.GL30.GL_RGB
|
||||
import org.lwjgl.opengl.GL30.GL_TEXTURE_2D
|
||||
import org.lwjgl.opengl.GL30.glFramebufferTexture2D
|
||||
import org.lwjgl.opengl.GL45.glCheckNamedFramebufferStatus
|
||||
import org.lwjgl.opengl.GL46
|
||||
import org.lwjgl.opengl.GL45
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
|
||||
class GLFrameBuffer : GLObject() {
|
||||
override val client = StarboundClient.current()
|
||||
override val pointer = GL46.glGenFramebuffers()
|
||||
override val pointer = GL45.glGenFramebuffers()
|
||||
|
||||
init {
|
||||
checkForGLError("Creating framebuffer")
|
||||
client.registerCleanable(this, GL46::glDeleteFramebuffers, pointer)
|
||||
client.registerCleanable(this, GL45::glDeleteFramebuffers, pointer)
|
||||
}
|
||||
|
||||
val isComplete: Boolean get() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl
|
||||
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import org.lwjgl.stb.STBImage
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.defs.image.Image
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl
|
||||
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
|
||||
enum class GLType(
|
||||
val identity: Int,
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl
|
||||
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
|
||||
class VertexArrayObject : GLObject() {
|
||||
|
@ -4,7 +4,7 @@ import it.unimi.dsi.fastutil.objects.Object2BooleanArrayMap
|
||||
import it.unimi.dsi.fastutil.objects.Object2BooleanFunction
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectFunction
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.client.gl.GLObject
|
||||
import ru.dbotthepony.kstarbound.client.gl.checkForGLError
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl.vertex
|
||||
|
||||
import org.lwjgl.opengl.GL46
|
||||
import org.lwjgl.opengl.GL45
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.client.gl.VertexArrayObject
|
||||
import ru.dbotthepony.kstarbound.client.gl.BufferObject
|
||||
@ -32,16 +32,16 @@ class StreamVertexBuilder(
|
||||
ebo.unbind()
|
||||
}
|
||||
|
||||
fun upload(drawType: Int = GL46.GL_DYNAMIC_DRAW) {
|
||||
fun upload(drawType: Int = GL45.GL_DYNAMIC_DRAW) {
|
||||
builder.upload(vbo, ebo, drawType)
|
||||
}
|
||||
|
||||
fun bind() = vao.bind()
|
||||
fun unbind() = vao.unbind()
|
||||
|
||||
fun draw(primitives: Int = GL46.GL_TRIANGLES) {
|
||||
fun draw(primitives: Int = GL45.GL_TRIANGLES) {
|
||||
bind()
|
||||
GL46.glDrawElements(primitives, builder.indexCount, builder.indexType, 0L)
|
||||
GL45.glDrawElements(primitives, builder.indexCount, builder.indexType, 0L)
|
||||
checkForGLError()
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package ru.dbotthepony.kstarbound.client.gl.vertex
|
||||
|
||||
import org.lwjgl.opengl.GL46
|
||||
import org.lwjgl.opengl.GL46.GL_UNSIGNED_INT
|
||||
import org.lwjgl.opengl.GL46.GL_UNSIGNED_SHORT
|
||||
import org.lwjgl.opengl.GL46.GL_UNSIGNED_BYTE
|
||||
import org.lwjgl.opengl.GL45
|
||||
import org.lwjgl.opengl.GL45.GL_UNSIGNED_INT
|
||||
import org.lwjgl.opengl.GL45.GL_UNSIGNED_SHORT
|
||||
import org.lwjgl.opengl.GL45.GL_UNSIGNED_BYTE
|
||||
import ru.dbotthepony.kstarbound.client.gl.GLType
|
||||
import ru.dbotthepony.kstarbound.client.gl.BufferObject
|
||||
import ru.dbotthepony.kvector.util2d.AABB
|
||||
@ -220,7 +220,7 @@ class VertexBuilder(
|
||||
return this
|
||||
}
|
||||
|
||||
fun upload(vbo: BufferObject.VBO, ebo: BufferObject.EBO, drawType: Int = GL46.GL_DYNAMIC_DRAW) {
|
||||
fun upload(vbo: BufferObject.VBO, ebo: BufferObject.EBO, drawType: Int = GL45.GL_DYNAMIC_DRAW) {
|
||||
end()
|
||||
|
||||
check(elementVertices == 0) { "Not fully built vertex element ($mode requires ${mode?.elements} vertex points to be present, yet last strip has only $elementVertices elements)" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.render
|
||||
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import ru.dbotthepony.kbox2d.api.IDebugDraw
|
||||
import ru.dbotthepony.kbox2d.api.Transform
|
||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNIT
|
||||
|
@ -2,7 +2,7 @@ package ru.dbotthepony.kstarbound.client.render
|
||||
|
||||
import it.unimi.dsi.fastutil.chars.Char2ObjectArrayMap
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectFunction
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.client.freetype.LoadFlag
|
||||
import ru.dbotthepony.kstarbound.client.gl.*
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client.render
|
||||
|
||||
import org.lwjgl.opengl.GL46
|
||||
import org.lwjgl.opengl.GL45
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.client.gl.checkForGLError
|
||||
import ru.dbotthepony.kstarbound.client.gl.shader.GLShaderProgram
|
||||
@ -9,7 +9,7 @@ import ru.dbotthepony.kvector.arrays.Matrix4f
|
||||
|
||||
class Mesh() {
|
||||
constructor(builder: VertexBuilder) : this() {
|
||||
load(builder, GL46.GL_STATIC_DRAW)
|
||||
load(builder, GL45.GL_STATIC_DRAW)
|
||||
}
|
||||
|
||||
val state = StarboundClient.current()
|
||||
@ -23,7 +23,7 @@ class Mesh() {
|
||||
var indexType = 0
|
||||
private set
|
||||
|
||||
fun load(builder: VertexBuilder, mode: Int = GL46.GL_DYNAMIC_DRAW) {
|
||||
fun load(builder: VertexBuilder, mode: Int = GL45.GL_DYNAMIC_DRAW) {
|
||||
vao.bind()
|
||||
vbo.bind()
|
||||
ebo.bind()
|
||||
@ -41,7 +41,7 @@ class Mesh() {
|
||||
|
||||
fun render() {
|
||||
vao.bind()
|
||||
GL46.glDrawElements(GL46.GL_TRIANGLES, indexCount, indexType, 0L)
|
||||
GL45.glDrawElements(GL45.GL_TRIANGLES, indexCount, indexType, 0L)
|
||||
checkForGLError()
|
||||
vao.unbind()
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ru.dbotthepony.kstarbound.client.render
|
||||
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import org.lwjgl.opengl.GL46.*
|
||||
import org.lwjgl.opengl.GL45.*
|
||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNITf
|
||||
import ru.dbotthepony.kstarbound.Starbound
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
|
Loading…
Reference in New Issue
Block a user