Login  Register

Re: My Application crashed

Posted by gouessej on Jul 28, 2012; 9:44pm
URL: https://forum.jogamp.org/My-Application-crashed-tp4025350p4025684.html

Hi

Sorry for my late reply, I have just finished repairing my computer (corruption of bios data, no IDE device detection).

Think once again about what I said some weeks ago: tick(), update(), render(). As soon as you do that sequentially, you won't have threading problems. Calling put() on your direct NIO buffer is not enough, you have to send the data again if you use vertex arrays (glVertexPointer) or VBO (glBufferSubData or glBufferData). The direct NIO buffer is only in the GPU if you use glBufferData with null, this buffer and the data store are 2 different things.

I already spoke about this problem with direct NIO buffers in my blog, look at the latest article about TUER. You have to track the direct NIO buffers and to destroy them by yourself when you're absolutely sure you don't need them anymore. You should reuse them as often as possible instead of creating new ones. Slicing is useful too for very small ones but less with Java 1.7 as they are no more page aligned.

What's wrong with your example? You can still use get() to look at the data in the buffer, can't you? You can modify the content of a direct NIO buffer after creating it.

I advise you to look at the source code of the classes Mesh and MeshData of Ardor3D.
Julien Gouesse | Personal blog | Website