Skip to content

Commit a940909

Browse files
committed
v0.4.6
- replaced Error by Exception - removed deprecated - Jigsaw support - kotlin 1.3.10
1 parent 9cd42e9 commit a940909

File tree

18 files changed

+51
-65
lines changed

18 files changed

+51
-65
lines changed

build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ group = 'com.github.kotlin-graphics'
99

1010
apply plugin: 'com.github.johnrengelman.shadow'
1111

12+
ext.moduleName = 'com.github.kotlin_graphics.gln'
13+
1214
buildscript {
1315

14-
ext.kotlinVersion = '1.3.0'
16+
ext.kotlinVersion = '1.3.10'
1517

1618
repositories {
1719
jcenter() // shadow
@@ -33,7 +35,7 @@ dependencies {
3335
implementation "$kotlin-stdlib:$kotlinVersion"
3436
implementation "$kotlin-reflect:$kotlinVersion"
3537

36-
implementation 'com.github.kotlin-graphics:gli:9776ae45a3'
38+
implementation 'com.github.kotlin-graphics:gli:332f512955594fc59b011a1b6e29a138fe3fc789'
3739

3840
//testCompile 'io.kotlintest:kotlintest-runner-junit5:3.0.6'
3941

@@ -81,4 +83,11 @@ compileKotlin {
8183
artifacts {
8284
archives sourcesJar
8385
// archives javadocJar
86+
}
87+
88+
jar {
89+
inputs.property("moduleName", moduleName)
90+
manifest {
91+
attributes('Automatic-Module-Name': moduleName)
92+
}
8493
}

src/main/kotlin/gln/buffer/buffer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ sealed class BufferTarget(val i: Int) {
115115
GL_TEXTURE_BUFFER -> BufferTarget2.Texture
116116
GL_TRANSFORM_FEEDBACK_BUFFER -> BufferTarget2.Transform
117117
GL_UNIFORM_BUFFER -> BufferTarget2.Uniform
118-
else -> throw Error()
118+
else -> throw Exception()
119119
}
120120
}
121121
}

src/main/kotlin/gln/cap/caps.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import glm_.vec3.Vec3i
55
import gln.*
66
import kool.cap
77
import kool.free
8-
import kool.intBufferBig
8+
import kool.IntBuffer
99
import org.lwjgl.opengl.ATITextureCompression3DC.GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI
1010
import org.lwjgl.opengl.EXTTextureCompressionLATC.*
1111
import org.lwjgl.opengl.EXTTextureCompressionS3TC.*
@@ -1120,7 +1120,7 @@ class Caps(profile: Profile) {
11201120
inner class Formats {
11211121

11221122
private val compressed by lazy {
1123-
val buffer = intBufferBig(limits.NUM_COMPRESSED_TEXTURE_FORMATS)
1123+
val buffer = IntBuffer(limits.NUM_COMPRESSED_TEXTURE_FORMATS)
11241124
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, buffer)
11251125
(0 until buffer.cap).map { buffer[it] }.also {
11261126
buffer.free()

src/main/kotlin/gln/debug/debug.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fun glDebugMessageCallback(callback: (source: GlDebugSource, type: GlDebugType,
7272
// OpenGL43 -> GL43::nglDebugMessageControl
7373
// GL_KHR_debug -> KHRDebug::nglDebugMessageControl
7474
// GL_ARB_debug_output -> ARBDebugOutput::nglDebugMessageControlARB
75-
// else -> throw Error()
75+
// else -> throw Exception()
7676
// // if (caps.GL_AMD_debug_output)
7777
// // AMDDebugOutput.glDebugMessageEnableAMD(GL11.GL_DONT_CARE, GL11.GL_DONT_CARE, GL43.GL_DEBUG_SEVERITY_NOTIFICATION, 0, false)
7878
// }

src/main/kotlin/gln/enums.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ inline class DataType(val i: Int) {
986986
GL11.GL_3_BYTES -> Vec3b.size
987987
GL11.GL_4_BYTES -> Vec4b.size
988988
GL11.GL_DOUBLE -> Double.BYTES
989-
else -> throw Error()
989+
else -> throw Exception()
990990
}
991991
}
992992

src/main/kotlin/gln/framebuffer/block.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fun checkFramebuffer(location: String = "", throws: Boolean = true): Boolean {
127127
else -> throw IllegalStateException()
128128
}}"
129129
if(throws)
130-
throw Error(message)
130+
throw Exception(message)
131131
else
132132
System.err.println(message)
133133
false

src/main/kotlin/gln/gl11i.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ interface gl11i {
530530
*
531531
* @see <a target="_blank" href="http://docs.gl/gl4/glGenTextures">Reference Page</a>
532532
*/
533-
infix fun genTextures(count: Int): GLtextures = GLtextures(intBufferBig(count).apply { GL11C.nglGenTextures(rem, adr) })
533+
infix fun genTextures(count: Int): GLtextures = GLtextures(IntBuffer(count).apply { GL11C.nglGenTextures(rem, adr) })
534534

535535
/**
536536
* Returns n previously unused texture names in textures. These names are marked as used, for the purposes of GenTextures only, but they acquire texture

src/main/kotlin/gln/gl15i.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package gln
77

88
import glm_.L
99
import kool.adr
10-
import kool.intBufferBig
10+
import kool.IntBuffer
1111
import kool.rem
1212
import kool.remSize
1313
import gln.`object`.GlBuffer
@@ -316,7 +316,7 @@ interface gl15i {
316316
*
317317
* @see <a target="_blank" href="http://docs.gl/gl4/glGenQueries">Reference Page</a>
318318
*/
319-
infix fun genQueries(count: Int): GlQueries = GlQueries(intBufferBig(count).apply { GL15C.nglGenQueries(rem, adr) })
319+
infix fun genQueries(count: Int): GlQueries = GlQueries(IntBuffer(count).apply { GL15C.nglGenQueries(rem, adr) })
320320

321321
/**
322322
* Generates query object names.

src/main/kotlin/gln/gl20i.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import glm_.vec4.Vec4
2727
import glm_.vec4.Vec4d
2828
import glm_.vec4.Vec4i
2929
import glm_.vec4.Vec4s
30+
import gln.`object`.GLshaders
3031
import gln.`object`.GlProgram
32+
import gln.`object`.GlShader
3133
import gln.glf.VertexAttribute
3234
import kool.*
3335
import org.lwjgl.opengl.*
@@ -514,7 +516,7 @@ interface gl20i {
514516
infix fun getAttachedShaders(program: GlProgram): GLshaders =
515517
stak {
516518
val maxCount = program.attachedShadersCount
517-
val shaders = intBufferBig(maxCount)
519+
val shaders = IntBuffer(maxCount)
518520
GL20C.nglGetAttachedShaders(program.i, maxCount, NULL, shaders.adr)
519521
GLshaders(shaders)
520522
}

src/main/kotlin/gln/gln.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import java.nio.ByteBuffer
1818
import java.nio.IntBuffer
1919
import java.nio.ShortBuffer
2020

21-
@Deprecated("use appBuffer instead")
21+
@Deprecated("use kool instead")
2222
val buf: ByteBuffer = MemoryUtil.memAlloc(256)
23-
@Deprecated("use appBuffer instead")
23+
@Deprecated("use kool instead")
2424
val bufAd = buf.adr
2525

2626
operator fun IntBuffer.get(e: Enum<*>) = get(e.ordinal)
@@ -81,15 +81,15 @@ fun checkError(location: String = "", throws: Boolean = true): Boolean {
8181
else -> throw IllegalStateException()
8282
}
8383
if (throws)
84-
throw Error("OpenGL Error ($message) at $location")
84+
throw Exception("OpenGL Error ($message) at $location")
8585
else
8686
System.err.println(message)
8787
false
8888
}
8989
}
9090
}
9191

92-
val VERSION = "0.4.5"
92+
val VERSION = "0.4.6"
9393

9494
fun main(args: Array<String>) {
9595

@@ -114,5 +114,5 @@ val Buffer.glType: Int
114114
is ByteBuffer -> GL11C.GL_UNSIGNED_BYTE
115115
is ShortBuffer -> GL11C.GL_UNSIGNED_SHORT
116116
is IntBuffer -> GL11C.GL_UNSIGNED_INT
117-
else -> throw Error("unsupported")
117+
else -> throw Exception("unsupported")
118118
}

0 commit comments

Comments
 (0)