Hi again.
I make this ultra simple example for test SDL2 on Delphi XE5. It work perfect on Win32, Win64 and MacOSX but not in android (compile ok and deploy to phone, but when open say "application has stopped" and close it.)
For Android I add file "libSDL2.so" in menu deployment to folder "/lib"
SDL2Test.dpr :
Code:
program SDL2Test;
uses
System.SysUtils;
const
{$IFDEF MSWINDOWS}
SDL_LibName = 'SDL2.dll';
{$ENDIF}
{$IFDEF ANDROID}
SDL_LibName = 'libSDL2.so';
{$ENDIF}
{$IFDEF MACOS}
{$IFDEF IOS}
{$IFDEF CPUARM}
SDL_LibName = 'libSDL2.a';
{$ELSE}
SDL_LibName = 'libSDL2Simulator.a';
{$ENDIF}
{$ELSE}
SDL_LibName = 'SDL2';
{$ENDIF}
{$ENDIF}
function SDL_Init(flags: UInt32): LongInt cdecl; external SDL_LibName name 'SDL_Init';
begin
try
if SDL_Init(0) < 0 then
Writeln('Can not Init SDL')
else
Writeln('SDL Init OK');
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
repeat
until False;
end.
What is the problem ?
Kotai.
Bookmarks