ich möchte gerne die getpixel Funktion von JEDI-SDL benutzen. http://jedi-sdl.pascalgamedevelopment.c ... html#AEN90 Das funktioniert auch einwandfrei unter Win32 und Linux 32Bit. Wenn ich nun aber die Funktion unter Kubuntu 64bit kompilieren möchte, erhalte ich folgende Warnung:
Naja, soweit so gut, immerhin erhalte ich ein Programm, das aber leider nicht funktioniert und abstürzt.Conversion between ordinals and pointers are not portable
Ich ging mal auf die Suche und habe folgendes festgestellt:EAccessViolation : Access violation
$0000000000431BE0
$0000000000431A21
$0000000000411D6E
So, die fragliche Zeile sieht bei JEDI-SDL so aus:FPC currently uses 32 bits (4 bytes) for integers, whether the machine is a 32-bit or 64-bit machine. This will cause code expecting an integer and a pointer to be the same size to fail as a 64-bit machine uses 64-bit pointers. To allow you to write portable code, the FPC system unit introduces the types PtrInt and PtrUInt which are signed and unsigned integer data types with the same size as a pointer.
Code: Alles auswählen
p := Pointer(Uint32(surface_.pixels) + y * surface_.pitch + x * bpp);
Gibt es nun eine Möglichkeit, dass mein 64Bit FPC mir das korrekt übersetzt (type cast o.ä.)? (PtrInt und PtrUInt habe ich schon probiert.)