-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No need for off-heap Buffers in LWJGL 3 #73
Comments
Hi Jakob,
Thanks for your comment. I will have a look at it. I certainly improves
readability, but I need to check the drawbacks. All the examples from the
own LWJGL library still use buffers. If I change to that, it may take some
time, because buffer usage is spread all over the book.
Best regards.
El vie., 21 feb. 2020 a las 16:46, Jakob K (<[email protected]>)
escribió:
… The tutorial uses Buffers allocated in off-heap a lot.
But this is not necessary since LWJGL 3.
https://github.com/LWJGL/lwjgl3/releases/tag/3.0.0 <http://url>
LWJGL/lwjgl3#175 <http://url>
So in a lot of cases it would be easier to just use arrays.
I have currently only followed the tutorial to *Loading more complex
models* and the following are parts where I remember Buffers being used:
- Mesh for glBufferData
- ShaderProgram for glUniformMatrix4fv (here
value.get(stack.mallocFloat(16)) can be replaced with value.get(new
float[16])
- Texture where in loadTexture a ByteBuffer is still necessary because
stbi_load does only return this type, but the buffers of w h and
channels can be replaced with normal arrays
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/lwjglgamedev/lwjglbook/issues/73?email_source=notifications&email_token=ADMXGJYBWLQWOYECFBSMHBLRD7ZOHA5CNFSM4KZFPX4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPKYBYA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMXGJ52JK22IXNUSY6BMWDRD7ZOHANCNFSM4KZFPX4A>
.
|
Hi Jakob, It seems that Hotspot Critical Natives is considered an undocumented feature with some bugs. You can see some thoghts about this from Spasi here:
So, by now I would not use them, at least in the initialization code, which would get little benefit from this change. In any case, I would leave this open until LWGL 3.3 is released, beacuse it is supposed to get some updates on this issue. Plesae, let me know your view on this. Best regards. |
Hey, after reading through this I would leave this issue here open until the release of LWJGL 3.3 and then look at it again. |
The tutorial uses Buffers allocated in off-heap a lot.
But this is not necessary since LWJGL 3.
https://github.com/LWJGL/lwjgl3/releases/tag/3.0.0
LWJGL/lwjgl3#175
So in a lot of cases it would be easier to just use arrays.
I have currently only followed the tutorial to Loading more complex models and the following are parts where I remember Buffers being used:
Mesh
forglBufferData
ShaderProgram
forglUniformMatrix4fv
(herevalue.get(stack.mallocFloat(16))
can be replaced withvalue.get(new float[16])
Texture
where inloadTexture
aByteBuffer
is still necessary becausestbi_load
does only return this type, but the buffers ofw
h
andchannels
can be replaced with normal arraysThe text was updated successfully, but these errors were encountered: