Help: SDL .X11.lock_func in X11 lazarus / 39-Graphics ---------------------------------------------------------------------- trn76 · 2014-02-09 19:51 Hi. I'm trying to lock the SDL window by using the x11.lock_func() in SDL, but cannot get it to work - getting an exception! The SDL header is newest pascal translation (v1.40... nothing wrong with it), SDL is working fine. I am trying this on Udoo (ARM based, debian hardfloat... but ever runtime examples are running fine, so guess SDL libs are good). Using fpc 2.6.2.. This is my stripped code: Code: [Select]uses   x, xlib, xutil, sdl ++ var   gX11_Lock : procedure();   fSurfaceSDL: PSDL_Surface;   fSysInfoSDL : TSDL_SysWMinfo;   fSDLVideoInfo: PSDL_VideoInfo;   fPX11Display : PDisplay; .... begin     // SDL get videoinfo     fSDLVideoInfo:= SDL_GetVideoInfo();     if fSDLVideoInfo = nil then halt;     fSurfaceSDL := SDL_SetVideoMode(500, 600, 24, SDL_SWSURFACE);     if fSurfaceSDL = nil then begin       {$IFDEF Logging}uglog.log.Error('ERROR: SDL could not set videomode, quitting!');{$ENDIF}       halt;     end;     // get system-dependent information about a window     SDL_VERSION(fSysInfoSDL.version);     if SDL_GetWMInfo(@fSysInfoSDL) <= 0 then begin       {$IFDEF Logging}uglog.log.Error('ERROR: SDL SDL_GetWMInfo!');{$ENDIF}     halt;     end;   fPX11Display := XOpenDisplay(nil);   if fPX11Display = nil then begin     {$IFDEF Logging}uglog.log.Error('ERROR: Unable to get X11 Display');{$ENDIF}     halt;   end;   // --- now im doing some EGL init, nothing to do with SDL here!   // ok... the structure seem fine when debbuggin   pointer(gX11_Lock) := fSysInfoSDL.X11.lock_func;   // and here it fails:   gX11_Lock(); end; Am I calling "gX11_Lock" wrong? ... Any help here would be nice... driving me nuts - for the time beeing I'm connection EGL->XWindow->GLES.. no problem, but I wanne use EGL->SDL->GLES.. Thanks ---------------------------------------------------------------------- BlueIcaro · 2014-03-25 23:52 Do you have the sdl library avaliable on path of your system, or in the same folder where your programa are running? Try to run your program step by step to know in which line  you got the exception. /BLueIcaro ---------------------------------------------------------------------- zeljko · 2014-03-26 11:31 @BlueIcaro: Since when library can be in same dir as application (without LD_LIBRARY_PATH setted up so) under linux ? ---------------------------------------------------------------------- trn76 · 2014-04-24 19:21 Hi, sorry for the late reply.   // and here it fails:   gX11_Lock(); so... yes, SDL is working fine, but like I said.... calling the lock function fails (tried on various systems). Still havent figured it out.