Ejemplo n.º 1
0
 private static void QuitSDL2()
 {
     SDL_ttf.TTF_Quit();
     SDL_image.IMG_Quit();
     SDL_mixer.Mix_Quit();
     SDL.SDL_Quit();
 }
Ejemplo n.º 2
0
        private static void Close()
        {
            //Free loaded images
            _PromptTexture.Free();

            //Free the sound effects
            SDL_mixer.Mix_FreeChunk(_Scratch);
            SDL_mixer.Mix_FreeChunk(_High);
            SDL_mixer.Mix_FreeChunk(_Medium);
            SDL_mixer.Mix_FreeChunk(_Low);
            _Scratch = IntPtr.Zero;
            _High    = IntPtr.Zero;
            _Medium  = IntPtr.Zero;
            _Low     = IntPtr.Zero;

            //Free the music
            SDL_mixer.Mix_FreeMusic(_Music);
            _Music = IntPtr.Zero;

            //Destroy window
            SDL.SDL_DestroyRenderer(Renderer);
            SDL.SDL_DestroyWindow(_Window);
            _Window  = IntPtr.Zero;
            Renderer = IntPtr.Zero;

            //Quit SDL subsystems
            SDL_mixer.Mix_Quit();
            SDL_image.IMG_Quit();
            SDL.SDL_Quit();
        }
Ejemplo n.º 3
0
 public void Dispose()
 {
     sceneRenderer.Dispose();
     Screen.Dispose();
     SDL_mixer.Mix_CloseAudio();
     SDL_mixer.Mix_Quit();
     SDL_ttf.TTF_Quit();
     SDL_image.IMG_Quit();
     SDL_Quit();
 }
Ejemplo n.º 4
0
        public void Quit()
        {
            Audio.Dispose();
            Content.Dispose();

            SDL_mixer.Mix_Quit();
            SDL_gpu.GPU_Quit();
            SDL2.SDL_Quit();

            Environment.Exit(0);
        }
Ejemplo n.º 5
0
 protected virtual void Dispose(bool cleanManagedResources)
 {
     if (cleanManagedResources)
     {
         TextureProvider.Dispose();
         DisposeMusic();
         SDL_mixer.Mix_Quit();
         SDL.SDL_DestroyRenderer(WRenderer);
         SDL.SDL_DestroyWindow(Window);
         SDL.SDL_Quit();
     }
 }
Ejemplo n.º 6
0
        void GEALOSprog()
        {
            init();

            while (running)
            {
                time.update();

                while (SDL.SDL_PollEvent(out SDL.SDL_Event e) == 1)
                {
                    switch (e.type)
                    {
                    case SDL.SDL_EventType.SDL_QUIT:
                        running = false;
                        break;

                    case SDL.SDL_EventType.SDL_KEYDOWN:
                        input.setPress(e.key.keysym.sym, true);
                        break;

                    case SDL.SDL_EventType.SDL_KEYUP:
                        if (e.key.repeat == 0)
                        {
                            input.setPress(e.key.keysym.sym, false);
                        }
                        break;
                    }
                }

                update();
            }

            SDL_mixer.Mix_Quit();
            SDL_ttf.TTF_Quit();
            SDL_image.IMG_Quit();
            SDL.SDL_Quit();
        }