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:
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