Hi, I’ve used Jogl successfully in the past and am now updating some code to the current 231 version.
In a web search I was not able to find any nio tutorials that seemed particularly relevant, they
all talk about file mapping. Probably that is relevant, but I don’t understand yet.
Some particular questions:
- if one uses a floatbuffer .array() and then indexes the array, when do you have to rewind?
float[] fbuf = theFloatbuffer.array();
for( i=0; ... ) {
float x = fbuf[i];
theFloatbuffer.rewind(); // is this needed here ??
}
-
How important is it that the buffer be “direct”?
-
Does a view of another buffer prevent it from being garbage collected?
E.g.,
{
{
ByteBuffer b = ByteBuffer.allocateDirect(len); // local scope
_globalfloatbuf = b.asFloatBuffer(); // bad idea?
}
}