Hey guys, i'm having the following problem. I'm simply trying to load some jpg textures from a pak file with GLVfsPak to a Material Library but no matter what, i can't get it to work. Here's my code:
The pak file is loading correctly in PakBalls. The error i get is "TBinaryReader, read type error." at AddMaterialsFromStream. Oh, i also forgot to mention that i'm writing in DelphiXE.
Any help will be trully appreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A small correction, BBCode seems to hate Delphi :P
for i := 0 to PakBalls.Files.Count - 1 do begin
LibBalls.AddMaterialsFromStream(PakBalls.GetFile(PakBalls.Files.Strings[ i ]));
LibBalls.Materials[ i ].Material.Texture.TextureMode := tmModulate;
LibBalls.Materials[ i ].Material.Texture.Disabled := false;
end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anyway, i think i got it working. I changed the loop to:
for i := 0 to PakBalls.Files.Count - 1 do begin
LibBalls.AddTextureMaterial(IntToStr(i + 1), PakBalls.Files.Strings[ i ], true);
with LibBalls.Materials[ i ].Material do begin
Texture.TextureMode := tmModulate;
Texture.Disabled := false;
end;
end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey guys, i'm having the following problem. I'm simply trying to load some jpg textures from a pak file with GLVfsPak to a Material Library but no matter what, i can't get it to work. Here's my code:
The pak file is loading correctly in PakBalls. The error i get is "TBinaryReader, read type error." at AddMaterialsFromStream. Oh, i also forgot to mention that i'm writing in DelphiXE.
Any help will be trully appreciated!
A small correction, BBCode seems to hate Delphi :P
Anyway, i think i got it working. I changed the loop to:
Please, follow to our forum https://sourceforge.net/apps/phpbb/glscene/
there you can get more quickly answer