ultraq / redhorizon

Recreating the original 2D Command & Conquer games
Apache License 2.0
6 stars 4 forks source link

Use LWJGL memory utils for direct buffer management? #40

Closed ultraq closed 3 years ago

ultraq commented 3 years ago

At the moment I'm managing my own direct buffers, but I often come across the LWJGL memory management blog post that encourages the use of their own memory utilities: https://blog.lwjgl.org/memory-management-in-lwjgl-3/ It makes some pretty good points, so I should find some time to try it out and see how it works in this project.

ultraq commented 3 years ago

Well I've tried it and... no noticeable difference except that I have to configure a stack size because the default of 64KB is too small and it prevents dynamically allocating direct buffer objects any more? 🤷‍♂️ Is this better? 😅

Branch: https://github.com/ultraq/redhorizon/tree/lwjgl-memory-stack

ultraq commented 3 years ago

Well, I'll stick with it since it is the recommended way to use LWJGL.