![]() |
![]() |
![]() |
| 4.51.2.4.23. ogGetAlphaMasker() | Table of Contents | 4.51.2.4.25. ogGetBytesPerPix() |
function ogGetBPP:uInt32;Remarks:
Returns the bits per pixel for the surface. Currently this can be 0, 8, 15, 16, 24, or 32. A graphics surface of 0BPP is considered not created.
Use this formula to calculate the number of bytes per pixel:
bytesPerPixel := (BPP+7) shr 3;
See also:
{ogGetBPP.pas}
uses
ObjGfx40;
type
New_ogSurface = object(ogSurface)
procedure printStatus;
end;
procedure New_ogSurface.printStatus;
begin
writeln;
writeln('DataState: ',OG_DATA_STATE_STR[ogGetDataState]);
writeln('MaxX: ',ogGetMaxX);
writeln('MaxY: ',ogGetMaxY);
writeln('BPP: ',ogGetBPP);
writeln('Bytes Per Pix: ',ogGetBytesPerPix);
if (ogGetDataState<>ogNONE) then
writeln('Surface is: ',ogGetMaxX+1,'x',ogGetMaxY+1,'x',ogGetBPP,'bpp')
else
writeln('Surface is: not created');
writeln;
end;
var
buf:^New_ogSurface;
begin
new(buf, ogInit);
writeln('Status before ogCreate()');
buf^.printStatus;
if not buf^.ogCreate(2048, 2048, OG_PIXFMT_32BPP) then
begin
writeln('Error allocating surface');
halt
end;
writeln('Status after ogCreate()');
buf^.PrintStatus;
dispose(buf, ogDone);
end.
![]() |
![]() |
![]() |
| 4.51.2.4.23. ogGetAlphaMasker() | Table of Contents | 4.51.2.4.25. ogGetBytesPerPix() |