Re: [Sdl4fp-users] Event handling
Brought to you by:
trixx
From: <sam...@br...> - 2006-02-25 22:05:53
|
Hi You're using a pointer that you haven't allocated yet (then it will be NIL). Either you have to allocate it like this: VAR event_test:pSDL_EVENT; BEGIN New(event_test); Or you can use a record variable and pass it as a pointer to the SDL_PollEvent function (this is what the C code does): USES SDL, SDL_VIDEO, SDL_EVENTS; VAR event_test: *SDL_EVENT*; ... SDL_INIT(SDL_INIT_VIDEO); ... WHILE SDL_POLLEVENT(*@*event_test)=1 do BEGIN CASE event_te*st.eve*nttype OF SDL_KEYDOWN: ... SDL_EVENTQUIT: ... END; END; /Samuel Matthias wrote: > Anytime the compiler gets to the line with expression > event_test^.eventtype it stops because protection fault. Actually > event_test^.eventtype should store an integer-value but allocating it > to a variable of such kind will also lead to abortion. > > What am I doing wrong? > > Thanks for your help. > > Matthias |