internal void Start(ISDLNative hwnd) { Start(hwnd.SdlSystem); if (SDLI.SDL_WasInit(hwnd.SdlSystem) == hwnd.SdlSystem) { sdlHwnd = hwnd; PollEvents(sdlHwnd.Start); } }
/// <summary> /// EventPump will only function with one system - TIMER or VIDEO or AUDIO, etc. /// Can be stopped and restarted with a different system although the effects of /// doing so needs to be fully discovered. /// </summary> /// <param name="system"></param> internal void Start(uint system = SDL_INIT.TIMER) { if (sdlHwnd == null || SDLI.SDL_WasInit(system) != sdlHwnd.SdlSystem) { // changing SDL system initialization SDLI.SDL_Quit(); SDLI.SDL_Init(system); } if (!IsRunning && system == SDL_INIT.TIMER) { PollEvents(); } }
void ISDLNative.Start(EventPump eventPump) { if (SDLI.SDL_WasInit(sdlSystem) != sdlSystem) { // TODO: set error condition } eventPump.EventPumpStateChanged += EventPumpStateChanged; configure?.Invoke(); nativePointer = SDLI.SDL_CreateWindow(title, location.X, location.Y, size.Width, size.Height, (SDL_WINDOW)Style); renderer = new Renderer(nativePointer, size.Width, size.Height); eventPump.RendererUpdate(renderer.Update); isInitialized = true; initialized?.Invoke(isInitialized); }