Quote Originally Posted by Srki_82
Maybe I'm wrong, but i think that FPC doesn't automaticly convert pointer types to non pointer types (PSDL_Surface to TSDL_Surface).
You're 100% correct. In non-delphi modes you have to always explicitly dereference pointer.

Why ? The long story is, AFAIK: Because in non-delphi modes you get other feature: Assuming that PMyType is a pointer to TMyType, and you have variable like MyTypePtr (of type PMyType), you can write things like
MyTypePtr[100]
and it will be treated like MyTypePtr was a pointer to an array of TMyType structures. In Delphi (or in FPC in delphi mode) to do the same thing you would have to declare some dummy type that is a pointer to an "inifite" array, like
TMyTypeArray = array[0..MaxInt div SizeOf(TMyType)-1]of TMyType;
PTMyTypeArray = ^TTMyTypeArray;
and write
PTMyTypeArray(MyTypePtr)[100]

So in Delphi mode you get automatic dereferencing of pointers to arrays/records, and in non-delphi mode you get treating pointers as arrays (like in C). These two features together could in some cases produce ambiguous code, so you can get only one feature or the other, not both at once...

Quote Originally Posted by WILL
The funniest thing though... I move this function form the main 'program' source to a unit and reference to it and all of a sudden, no errors. Confused
Most probably you're accidentaly compiling your unit in delphi mode, and program file in non-delphi (like objfpc) mode. Maybe you include in your unit some file that does {$mode delphi} ? To hunt this down you can compile your code with -vc option ("Show conditionals"), look there for messages like
Macro defined: FPC_DELPHI
or
Macro defined: FPC_OBJFPC
These indicate FPC $mode changes.