When i move sdl window or the console window the app freeze... :? It's a problem on the code or what ?
[pascal]
program onMines;
{$APPTYPE CONSOLE}
uses
SysUtils,
SDL,
const_unit,
type_unit;
var
screen: PSDL_Surface;
ltick: Cardinal;
event: TSDL_Event;
const
fps = Trunc(1000 / 30);
begin
SDL_Init(SDL_INIT_VIDEO);
screen := SDL_SetVideoMode(640, 480, 24, SDL_SWSURFACE or SDL_DOUBLEBUF);
while True do
begin
ltick := SDL_GetTicks;
SDL_PollEvent(@event);
case event.type_ of
SDL_MOUSEMOTION:
Writeln(Format('mouse moved to x:%s | y:%s',[IntToStr(event.motion.x), IntToStr(event.motion.y)]));
SDL_KEYDOWN:
Writeln(Format('tecla : %s foi pressionada',[IntToStr(event.key.keysym.scancode)]) );
SDL_QUITEV:
Break;
end;
SDL_Delay(fps - (SDL_GetTicks - ltick));
end;
SDL_Quit;
end.
[/pascal]
and,
how can i have the console window to make only sdl window visible?
Edit: one more question, in that code when i press "A" it recognizes many many A presses
Bookmarks