Code:
var
  screen: PSDL_Surface;
  dot: PSDL_Surface;
  event: PSDL_Event;
  Running: Boolean;
  nextstep: Cardinal;

begin
  Running := True;
  SDL_Init(SDL_INIT_VIDEO);
  screen := SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE or SDL_HWACCEL);
  dot := imagingsdl.LoadSDLSurfaceFromFile('dot.png');

  repeat
    //  event manager
    while SDL_PollEvent(@event) > 0 do
    begin
      case event.type_ of
        SDL_QUITEV: Running := False;
      end;
    end;

    if SDL_GetTicks >= nextstep then
    begin
      drawbg;
      SDL_UpdateRect(screen, 0, 0, 640, 480);
      SDL_FillRect(screen, nil, 0);
      Inc(frames);
      Inc(nextstep, interval);
    end;

    SDL_Delay(1);

  until not Running;

  SDL_FreeSurface(dot);
  SDL_Quit;

end.
The app is crashing with this message on "case event.type_ of" line



For me looks everything right :?
What is the problem?