protected override void OnShown(EventArgs e) { base.OnShown(e); // int ret_init = SDL.SDL_Init(SDL.SDL_INIT_VIDEO); if (ret_init == -1) { throw new Exception("Could not initialize SDL!"); } uint retii = SDL.SDL_WasInit(SDL.SDL_INIT_VIDEO); _sdl_formhandle = SDL.SDL_CreateWindowFrom(this.panel1.Handle); _sdl_initSDL2 = true; SDL.SDL_version ver; SDL.SDL_VERSION(out ver); this.textBox1.AppendText(string.Format("\r\nSDL {0}.{1}.{2}", ver.major, ver.minor, ver.patch )); SDL.SDL_RenderPresent(_sdl_formhandle); //刷新屏幕 this.Focus(); this.timer1.Start(); }