Hello Guest

Resetting context but keeping the data

  • 0 Replies
Resetting context but keeping the data
« on: June 01, 2020, 05:32:08 »
Is it possible to re-create context but keep the VAO/VBO's?

In my application, sometimes the window (surface) to which I render gets hidden completely. When it gets shown again - the surface ID changes, and I can't keep rendering to it with the context that I had before.

My solution is to close the context completely as soon as the surface gets hidden, and then create a new one when it gets re-opened.

The problem here is lots of data that I don't necessarily want to re-create. For example I have to triangulate shapes that are calculated in a different part of the program, and that work is quite CPU-intensive. Maybe I could instead just keep the previous VBO and use it? But all attempts have given me no success.

Maybe I'm missing something? Or maybe I can even do away with closing the context (again, I didn't find a solution).

It works as is, but I feel that it's sub-optimal.

Thank you!