LwjglDirectBuffer(int sizeInBytes) { super(sizeInBytes); nativeBuffer = MemoryUtil.memAlloc(sizeInBytes); }
public void update(String newText){ if (outputText.equals(newText)){ return; } super.update(newText); ByteBuffer ubo = memAlloc(Float.BYTES * panel.getVertices().length * 4); for (int i=0; i<panel.getVertices().length; i++){ ubo.putFloat(panel.getVertices()[i].getUVCoord().getX()); ubo.putFloat(panel.getVertices()[i].getUVCoord().getY()); ubo.putFloat(0); ubo.putFloat(0); } ubo.flip(); buffer.mapMemory(ubo); } }
@NativeType("void") public static String glGetProgramPipelineInfoLogEXT(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetProgramPipelineInfoLogEXT(pipeline, bufSize, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
@NativeType("void") public static String glGetTranslatedShaderSourceANGLE(@NativeType("GLuint") int shader, @NativeType("GLsizei") int bufsize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(bufsize); try { IntBuffer length = stack.ints(0); nglGetTranslatedShaderSourceANGLE(shader, bufsize, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } }
/** <a target="_blank" href="http://docs.gl/es3/glGetShaderSource">Reference Page</a> */ @NativeType("void") public static String glGetShaderSource(@NativeType("GLuint") int shader, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetShaderSource(shader, bufSize, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } }
/** <a target="_blank" href="http://docs.gl/es3/glGetProgramPipelineInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetProgramPipelineInfoLog(pipeline, bufSize, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** <a target="_blank" href="http://docs.gl/es3/glGetProgramInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetProgramInfoLog(@NativeType("GLuint") int program, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetProgramInfoLog(program, bufSize, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** <a target="_blank" href="http://docs.gl/es3/glGetShaderInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetShaderInfoLog(@NativeType("GLuint") int shader, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetShaderInfoLog(shader, bufSize, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** * Returns the information log for a shader object. * * @param shader the shader object whose information log is to be queried * @param maxLength the size of the character buffer for storing the returned information log * * @see <a target="_blank" href="http://docs.gl/gl4/glGetShaderInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetShaderInfoLog(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(maxLength); try { IntBuffer length = stack.ints(0); nglGetShaderInfoLog(shader, maxLength, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** * Returns the information log for a program object. * * @param program the program object whose information log is to be queried * @param maxLength the size of the character buffer for storing the returned information log * * @see <a target="_blank" href="http://docs.gl/gl4/glGetProgramInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetProgramInfoLog(@NativeType("GLuint") int program, @NativeType("GLsizei") int maxLength) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(maxLength); try { IntBuffer length = stack.ints(0); nglGetProgramInfoLog(program, maxLength, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** * Retrieves the info log string from a program pipeline object. * * @param pipeline the name of a program pipeline object from which to retrieve the info log * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} * * @see <a target="_blank" href="http://docs.gl/gl4/glGetProgramPipelineInfoLog">Reference Page</a> */ @NativeType("void") public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(bufSize); try { IntBuffer length = stack.ints(0); nglGetProgramPipelineInfoLog(pipeline, bufSize, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
/** * Returns the source code string from a shader object. * * @param shader the shader object to be queried * @param maxLength the size of the character buffer for storing the returned source code string * * @see <a target="_blank" href="http://docs.gl/gl4/glGetShaderSource">Reference Page</a> */ @NativeType("void") public static String glGetShaderSource(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(maxLength); try { IntBuffer length = stack.ints(0); nglGetShaderSource(shader, maxLength, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } }
/** * Returns the string making up the source code for a shader object. * * <p>The string {@code source} is a concatenation of the strings passed to OpenGL using {@link #glShaderSourceARB ShaderSourceARB}. The length of this concatenation is given by * {@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is not of type {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code source} will be unmodified.</p> * * @param obj the shader object to query * @param maxLength the maximum number of characters the GL is allowed to write into {@code source} */ @NativeType("void") public static String glGetShaderSourceARB(@NativeType("GLhandleARB") int obj, @NativeType("GLsizei") int maxLength) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(maxLength); try { IntBuffer length = stack.ints(0); nglGetShaderSourceARB(obj, maxLength, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } }
pushConstants = memAlloc(pushConstantRange); pushConstants.putFloat(BaseContext.getConfig().getX_ScreenResolution()); pushConstants.putFloat(BaseContext.getConfig().getY_ScreenResolution());
/** * A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This * string is called the info log and can be obtained with this command. * * <p>This string will be null terminated. The number of characters in the info log is given by {@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}, which can be queried with * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is a shader object, the returned info log will either be an empty string or it will contain * information about the last compilation attempt for that object. If {@code obj} is a program object, the returned info log will either be an empty string * or it will contain information about the last link attempt or last validation attempt for that object. If {@code obj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB} * or {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code infoLog} * will be unmodified.</p> * * <p>The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce * identical info logs.</p> * * @param obj the shader object to query * @param maxLength the maximum number of characters the GL is allowed to write into {@code infoLog} */ @NativeType("void") public static String glGetInfoLogARB(@NativeType("GLhandleARB") int obj, @NativeType("GLsizei") int maxLength) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer infoLog = memAlloc(maxLength); try { IntBuffer length = stack.ints(0); nglGetInfoLogARB(obj, maxLength, memAddress(length), memAddress(infoLog)); return memUTF8(infoLog, length.get(0)); } finally { memFree(infoLog); stack.setPointer(stackPointer); } }
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT); ByteBuffer pushConstants = memAlloc(Integer.BYTES * 1); IntBuffer intBuffer = pushConstants.asIntBuffer(); intBuffer.put(n);
ByteBuffer pushConstants = memAlloc(pushConstantRange); pushConstants.put(BufferUtil.createByteBuffer(getOrthographicMatrix())); pushConstants.putFloat(rgba.getX());
ByteBuffer pushConstants = memAlloc(pushConstantRange); for (int i=0; i<randomx.length; i++){ pushConstants.putFloat(randomx[i]);
1, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER); ByteBuffer pushConstants = memAlloc(Integer.BYTES + Float.BYTES); pushConstants.putInt(N); pushConstants.putFloat(strength);