toWindowEventID method
Convert from a SDL_WindowEventID
member.
Implementation
WindowEventID toWindowEventID() {
switch (this) {
case SDL_WindowEventID.SDL_WINDOWEVENT_NONE:
return WindowEventID.none;
case SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN:
return WindowEventID.shown;
case SDL_WindowEventID.SDL_WINDOWEVENT_HIDDEN:
return WindowEventID.hidden;
case SDL_WindowEventID.SDL_WINDOWEVENT_EXPOSED:
return WindowEventID.exposed;
case SDL_WindowEventID.SDL_WINDOWEVENT_MOVED:
return WindowEventID.moved;
case SDL_WindowEventID.SDL_WINDOWEVENT_RESIZED:
return WindowEventID.resized;
case SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED:
return WindowEventID.sizeChanged;
case SDL_WindowEventID.SDL_WINDOWEVENT_MINIMIZED:
return WindowEventID.minimized;
case SDL_WindowEventID.SDL_WINDOWEVENT_MAXIMIZED:
return WindowEventID.maximized;
case SDL_WindowEventID.SDL_WINDOWEVENT_RESTORED:
return WindowEventID.restored;
case SDL_WindowEventID.SDL_WINDOWEVENT_ENTER:
return WindowEventID.enter;
case SDL_WindowEventID.SDL_WINDOWEVENT_LEAVE:
return WindowEventID.leave;
case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED:
return WindowEventID.focusGained;
case SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST:
return WindowEventID.focusLost;
case SDL_WindowEventID.SDL_WINDOWEVENT_CLOSE:
return WindowEventID.close;
case SDL_WindowEventID.SDL_WINDOWEVENT_TAKE_FOCUS:
return WindowEventID.takeFocus;
case SDL_WindowEventID.SDL_WINDOWEVENT_HIT_TEST:
return WindowEventID.hitTest;
case SDL_WindowEventID.SDL_WINDOWEVENT_ICCPROF_CHANGED:
return WindowEventID.iccprofChanged;
case SDL_WindowEventID.SDL_WINDOWEVENT_DISPLAY_CHANGED:
return WindowEventID.displayChanged;
default:
throw SdlError(
this,
'Unrecognised `SDL_WindowEventID` member.',
);
}
}