var
Color: TColor32Rec;
begin
....
Color.A := 0;
Color.R := 192;
Color.G := 128;
Color.B := 64;
FillRect(Pow2Sprite.ImageDataPointer^, 0, 0, Pow2Sprite.Width, Pow2Sprite.Height, @Color);
....
uses
... ImagingClasses, ImagingOpenGL, ImagingUtility;
var
Sprite, Pow2Sprite: TSingleImage;
TexId: GLint;
begin
// Load orig 72x128 sprite
Sprite := TSingleImage.CreateFromFile('MySprite72x128.png');
// Create power of 2 image
Pow2Sprite := TSingleImage.CreateFromParams(NextPow2(Sprite.Width), NextPow2(Sprite.Height), Sprite.Format);
// Copy orig sprite to pow2 image
Sprite.CopyTo(0, 0, Sprite.Width, Sprite.Height, Pow2Sprite, 0, 0);
// Create GL texture using pow2 imag as a source
TexId := CreateGLTextureFromImage(Pow2Image.ImageDataPointer^);
.. do stuff ..
end;
Page created in 0.011 seconds with 19 queries.