@Handoko, I made some test with glSlideshow with PNG image
1) 1024x768 image : no problem, all work perfectly
2) same image resized to 4096x4096 : application crash. I commented
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Image.Width, Image.Height, 0,
//GL_BGRA, GL_UNSIGNED_BYTE, Image.RawImage.Data);
in unit uniGraphics, line 290/291 -> Nothing is drawn of course, but application don't crash.
3) same image resized 4096x4096 : I uncommented lines above, then I commented lines 325/327 in unit frmMain
// Resize the image if it's larger than screen size
// with Image.Picture.Bitmap do
// if (Width > Screen.Width) or (Height > Screen.Height) then
// gls_ScaleDown(Screen.Width, Screen.Height, Image.Picture.Bitmap);
No crash and image is drawn and move according the transition selected, but it's slow due to 4096x4096 pixels image.
Maybe it's a relationship to the fact that video cards only accept texture sizes in power of 2? But I don't know if this is a rules for all cards or only some of them.
In the framework for educ'race game, i use the following function to compute the new size of an image to resize it in power of 2. I tryed it with the 4096x4096 png image and it work.
function TTextureManager.ValueOfNextPowerOfTwo(aValue: integer): integer;
begin
Result :=1;
while ( power (2,Result)<aValue ) do inc ( Result );
Result := trunc(power (2,Result));
end;
...
dup := TBGRABitmap.Create('xxxxx.png');
temp := TBGRABitmap.Create( ValueOfNextPowerOfTwo(dup.Width),ValueOfNextPowerOfTwo(dup.Height),BGRAPixelTransparent );
temp.PutImage ( 0, 0, dup, dmSet);
...
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, temp.Width , temp.Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, temp.Data );
Note, in glTexImage2D call I now use 'GL_BGRA' as you advised me