Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: BufferUtil?

Tags:

java

opengl

jogl

I'm trying to use this class with JOGL. It references BufferUtil, which I can't find anywhere. I found documentation, but no actual code. Eclipse doesn't suggest to import it from anywhere. What do I have to do to be able to use this code?

like image 914
Nick Heiner Avatar asked Sep 19 '10 17:09

Nick Heiner


3 Answers

In NeHe tutorials for JOGL, there are many places using BufferUtil to create the buffers. With JOGL 2.0 we can use com.jogamp.common.nio.Buffers instead.

For example,

BufferUtil.newIntBuffer(BUFSIZE) becomes Buffers.newDirectIntBuffer(BUFSIZE) BufferUtil.newByteBuffer(BUFSIZE) becomes Buffers.newDirectByteBuffer(BUFSIZE)

like image 71
tanza9 Avatar answered Nov 12 '22 01:11

tanza9


JOGL doc is rather here and here.

Use Buffers instead of BufferUtil: com.jogamp.common.nio.Buffers

TextureIO has been moved into the package com.jogamp.opengl.util.texture.TextureIO in JOGL 2.0. It is not a new class, it was already in JOGL 1.1.0.

like image 2
gouessej Avatar answered Nov 11 '22 23:11

gouessej


I ran into the same problem while porting a JOGL 1.x app to JOGL 2 and found BufferUtil equivalent methods in the new gluegen library: com.jogamp.common.nio.Buffers

JavaDoc: http://jogamp.org/deployment/jogamp-next/javadoc/gluegen/javadoc/com/jogamp/common/nio/Buffers.html

like image 1
gb96 Avatar answered Nov 11 '22 23:11

gb96