private static void DestroySDL(ref IntPtr win, ref IntPtr ren) { scene.Dispose(); if (ren != IntPtr.Zero) { SDL.SDL_DestroyRenderer(ren); ren = IntPtr.Zero; } if (win != IntPtr.Zero) { SDL.SDL_DestroyWindow(win); win = IntPtr.Zero; } SDL_image.IMG_Quit(); SDL.SDL_Quit(); }