void ShutdownRenderer() { // (I thought this was about SDLRenderer, not the example form!) // Example Form change state, ignore the next couple lines and the comment above CalculateWindowSize(true); buttonInit.Text = "Init"; timer.Stop(); // Tell the examples the renderer is invalid SDLExampleSet.UpdateRenderer(null); // Tell SDLRenderer to stop it's thread. We do this so we don't destroy resources // being used before destroying the renderer itself. if (sdlRenderer != null) { sdlRenderer.DestroyWindow(); } // While SDL2ThingLayer implements IDisposable in all it's classes and // explicitly disposes of their resources in their destructors, I always // like to clean up after myself (old habits). ReleaseAssets(); // Dispose of the Renderer if (sdlRenderer != null) { sdlRenderer.Dispose(); } // This is all you really need to do though, GC will handle the rest surface = null; texture = null; font = null; sdlRenderer = null; }
void InitInThread(SDLRenderer renderer) { // Set the render blender mode renderer.BlendMode = SDL.SDL_BlendMode.SDL_BLENDMODE_BLEND; // Load some assets CreateAssetsForRenderer(renderer); // Tell the examples the renderer to use SDLExampleSet.UpdateRenderer(sdlRenderer); // Barf to the console ConsoleDump(renderer); }