python import sdl2.ext window.show() running = True while running: for event in sdl2.ext.get_events(): if event.type == sdl2.SDL_QUIT: running = False break python import sdl2.ext renderer = sdl2.ext.Renderer(window) python import sdl2.ext running = True while running: for event in sdl2.ext.get_events(): if event.type == sdl2.SDL_QUIT: running = False break elif event.type == sdl2.SDL_KEYDOWN: if event.key.keysym.sym == sdl2.SDLK_ESCAPE: running = False break elif event.key.keysym.sym == sdl2.SDLK_SPACE: python import sdl2.ext audio_device = sdl2.ext.AudioDriver().open() audio_stream = sdl2.ext.AudioStream(file="music.wav") audio_stream.start() audio_device.queue(audio_stream, autowait=True)


上一篇:
下一篇:
切换中文