Hi,
Sorry to bother you folks, with something that's probably very simple.
But, the code attached does not work, it will not load the splash.bmp for some strange reason.
However, if I copy the code in the procedure displaySplash in gfx.pas over to main.pas about displaySplash, like so...
procedure mainLoop;
var
done: Boolean;
filename: String;
begin
filename := dataDir + '/images/splash.bmp';
image := SDL_loadBMP(@filename[1]);
if (image = nil) then
begin
writeLn('Couldn''t load ' + filename);
halt(1);
end;
if (SDL_BlitSurface(image, nil, screen, nil) < 0) then
begin
writeLn('BlitSurface error:' {+ SDL_GetError()});
end;
SDL_updateRect(screen, 0, 0, image^.w, image^.h);
SDL_freeSurface(image);
//displaySplash;
done := FALSE;
while (done = FALSE) do
begin
if (SDL_PollEvent(event) > 0) then
begin
if (event^.eventtype = SDL_EventQuit) then
begin
done := TRUE;
end;
end;
end;
cleanUp;
end;It will work. It won't work if it's called from the gfx library I'm trying to build up for a game I'm developing, in SDL.
Could someone explain/help me please.
thanks in advance.
James
