@Handoko:
Yes, i was just reading it back to see where that routine originated from. Thanks for the heads up.
Ok in that case, the addition of var to that T parameter should be enough as IMG_LoadTexture() return-type is PSDL_Texture.
No idea how that could have worked in the past though
Ok.. so.. That's it.
bg (stands for background ) is type of PSDL_Texture and so in the procedure, T ( stands for Texture ) is type of PSDL_Texture, too.
bg.png is a small image 1x1 pixels colored of white.
But.. i don't know the difference between PSDL_Texture and TSDL_Texture but i always write PSDL_Texture.
For this.. I solved with another method..
bg := IMG_LoadTexture( GameRenderer, FilePath('Resources\bg.png') );
FilePath() is a function i created :
function FilePath( FileName : String ) : PChar;
var
DirStr : string;
DirPChar : PChar;
begin
DirStr := GetCurrentDir + '\' + FileName;
DirPChar := StrAlloc( Length( DirStr ) + 1 );
if StrPCopy( DirPChar, DirStr ) <> DirPChar then HALT;
FilePath := DirPChar;
writeln( DirPChar, ' loaded' );
end;
Should be PChar because syntax is that:
function IMG_LoadTexture(renderer: PSDL_Renderer; _file: PAnsiChar): PSDL_Texture;
Tested and so i should do like this..
After fixing this i found another problem loading mp3 files on windows 10 always using FilePath() function.
MenuLoop := Mix_LoadMUS( FilePath('Resources\MenuLoop.mp3') );
Works on windows 8.1 and doesn't works on windows 10.
Ok so Tuesday there's school.. Computers have windows 7, and i hope for no problems.
Thanks again for replies! I appreciate so much them, i will upload my game as soon as possible.