Asuro/src/include/texture.pas
Kieron Morris d7a54d858d TARGA & Texture Units
Added TARGA and Texture units to represent & parse TARGA into and provide a standard texture format for use when drawing.
2022-02-07 19:48:00 +00:00

34 lines
641 B
ObjectPascal

unit texture;
interface
uses
lmemorymanager, color;
type
TTexture = packed record
Width : uint32;
Height : uint32;
Size : uint32;
Pixels : PRGB32;
end;
PTexture = ^TTexture;
Function newTexture(width, height: uint32): PTexture;
implementation
Function newTexture(width, height: uint32): PTexture;
var
texture: PTexture;
begin
texture:= PTexture(kalloc(sizeof(TTexture)));
texture^.Pixels:= PRGB32(kalloc(width * height * sizeof(TRGB32)));
texture^.Width:= width;
texture^.Height:= height;
texture^.Size:= width * height;
newTexture:= texture;
end;
end.