1
votes

Is it possible, in SDL2, to destroy a window while preserving the GL context that was made for it?

I'm trying to allow the user to toggle border-less window mode, which as far as I can tell, requires recreating the window. It would be ideal if I didn't have to reload all of the GL resources due to having to create a new GL context.

Can I just destroy the window and make the existing GL context the current context for the new window, or does destroying the window destroy/invalidate the OpenGL context which was created for it? I can only find documentation for sharing the context, but not for recycling it.

1

1 Answers

1
votes

SDL_SetWindowBordered(SDL_Window*, SDL_bool);

I don't know about the answer to your question though.