Quote Originally Posted by serkank View Post
Code:
tekrar:
  hwnd:=panel1.Handle;
  if hwnd = 0 then goto tekrar;
WOW! Last time I have seen GOTO commands in pascal based program was when I was checking an old TurboPascal code.
BTW That is a potential infinite loop. A realy BAD thing.
I think you can throw that code out as it serves no purpose. What it will do is cause your application to hang if hwnd would equal 0.

I also see you are using JEDI OpenGL components. If I'm not mistaken they relly on SDL1 and are no longer maintained. I'm not sure about that.
Maybe you should think of using latest SDL library which bases on SDL2.
You might wanna check this site: http://www.freepascal-meets-sdl.net/