Заодно использую http://jedi-sdl.pascalgamedevelopment.com/docs.php#Docs.
Так вот.
Компилятор почему-то ругается на строчку
- Код: Выделить всё
- while (SDL_PollEvent(&event)>0) do
- Код: Выделить всё
- event : TSDL_Event;
Если заменить & на @ эту строчку он проходит, но ругается на строчки
- Код: Выделить всё
- if event.type_=SDL_QUIT then done:=1 else
 if event.type_=SDL_KEYDOWN then ...
Error: Incompatible types: got "untyped" expected "LongWord".
На всякий случай весь код:
- Код: Выделить всё
- program prgr;
 {$mode objfpc}{$H+}
 uses
 {$IFDEF UNIX}{$IFDEF UseCThreads}
 cthreads,
 {$ENDIF}{$ENDIF}
 Classes, sdl
 { you can add units after this };
 var screen : PSDL_Surface;
 done : integer;
 event : TSDL_Event;
 begin
 if (SDL_Init(SDL_INIT_VIDEO or SDL_INIT_VIDEO)<0) then
 begin
 Writeln('Ошибка при инициализации SDL! Код: ',SDL_GetError());
 readln;
 halt(1);
 end;
 screen := SDL_SetVideoMode(1024,768,32,SDL_HWSURFACE or SDL_DOUBLEBUF);
 if (screen=nil) then
 begin
 writeln('Ошибка при инициализации экрана! Код: ',SDL_GetError());
 readln;
 halt(1);
 end;
 done:=0;
 while (done=0) do
 begin
 while (SDL_PollEvent(@event)>0) do
 begin
 if event.type_=SDL_QUIT then done:=1 else
 if event.type_=SDL_KEYDOWN then
 if event.key.keysym.sym=SDLK_ESCAPE then done:=1;
 end;
 end;
 SDL_Quit();
 end.
Добавлено спустя 3 минуты 22 секунды:
Что-то я ступил... Сразу надо было @ ставить. Мозги не работают окончательно =) Остаётся только второй вопрос. Про if'ы.



 
 