Timeline for CPU and RAM usage in OpenGL too high in Swift
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 25, 2016 at 1:38 | comment | added | Stephane Hockenhull | The part between glBindVertexArray(vaoID) and glBindVertexArray(0) that doesn't have the glDrawElements call is the part that setup the VertexArray, that goes into the LoadEverything() function with the glGenBuffers(1, &vboID) and glGenBuffers(1, &eboID). The glDeleteBuffers should not be called. At least until you don't need the buffers anymore (if you create a UnloadEverything() function for example). Once you get into level loading and unloading it gets more complicated but StackExchange isn't the place for this, plenty of good tutorials on-line for writing game engines. | |
Apr 25, 2016 at 1:22 | comment | added | rlam12 | That's why openGL assigns a GLuint to every object you create... Store those IDs somewhere | |
Apr 24, 2016 at 21:45 | vote | accept | fridgemagnet | ||
Apr 24, 2016 at 21:44 | comment | added | fridgemagnet | Thank you, it appears that was the case. I removed the texture loader and the RAM usage was constant, it appears it was creating extra data from a separate thread not deallocated. I understand how to load the textures and shaders only once, but how do I go about using the buffers once? | |
Apr 24, 2016 at 21:25 | history | answered | Stephane Hockenhull | CC BY-SA 3.0 |