given the following code:
(note that this code wrong and wont work)
private fun getUniformLocations(){
//if linking succeeded get all the active uniforms and store them in our map of uniform variable location
val numUniforms = glGetProgrami(shaderProgramID, GL_ACTIVE_UNIFORMS)
val maxCharLength = glGetProgrami(shaderProgramID, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH)
if(numUniforms > 0 && maxCharLength > 0){
var charBuffer = BufferUtils.createByteBuffer(maxCharLength)
for(i in 0 until numUniforms){
var length: Int = 0
var size: Int = 0
var dataType: Int = 0
nglGetActiveUniform(shaderProgramID, i, maxCharLength, length.toLong(), size.toLong(),dataType.toLong(), charBuffer )
val location = glGetUniformLocation(shaderProgramID,charBuffer)
println("uniform at $location is ${charBuffer}")
}
}
}```
you can asume that the shaderProgramID is right, its where the whole shader is build on and the shader works just fine
this function doesnt return anything yet, i was planning to save all the Uniforms in a list with there type and stuff,
But for now i am just printing the result untill i get it working
So the problem.
I am trying to do the method `nglGetActiveUniform()` or `glGetActiveUniform()` both will do the same i think, but with other imputs (`ngl` being the some kind of java wrapper thingy of `gl`, or at least thats what i heard)
anyway, for both i need to enter some `long`s which would be the pointers to in this case of the `charBuffer`
I tried maby things but i cant seem to get a pointer/long of the charbuffer. Or maby i did but then i cant seem to get the right end result
for this method i for example need to enter the following