Sorry, but as JSoftware said, that was what I meant when I said to add the cdecl or stdcall to your pascal libs.Originally Posted by JSoftware
Like this:
[pascal]library SDLTestLib;
uses
SDL;
var
MainSurface: PSDL_Surface;
procedure Initialize(); cdecl
begin
SDL_Init(SDL_INIT_VIDEO);
end;
procedure Finalize(); cdecl
begin
SDL_Quit;
end;
procedure CreateWindow(Width: Integer; Height: Integer; BPP: Integer); cdecl
begin
MainSurface := SDL_SetVideoMode(Width, Height, BPP, SDL_SWSURFACE);
if not Assigned(MainSurface) then WriteLn('Something isn''t right here.');
end;
procedure SetWindowCaption(Caption: PChar); cdecl
begin
SDL_WM_SetCaption(Caption, Caption);
end;
procedure Flip; cdecl
begin
SDL_Flip(MainSurface);
end;
exports
{$IFDEF DARWIN} {OS X entry points}
Initialize name '_Initialize',
Finalize name '_Finalize',
CreateWindow name '_CreateWindow',
SetWindowCaption name '_SetWindowCaption',
Flip name '_Flip',
{$ENDIF}
Initialize,
Finalize,
CreateWindow,
SetWindowCaption,
Flip;
end.
[/pascal]
Try something like above - see modified routines with cdecl added after...
If this doesn't work, try stdcall instead
cheers,
Paul
Bookmarks