Previous: 4.51.2.4.28. ogGetMaxX() To the Table of Contents Next: 4.51.2.4.30. ogGetPal()
4.51.2.4.28. ogGetMaxX() Table of Contents 4.51.2.4.30. ogGetPal()

- 4.51.2.4.29. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.4. ogSurface object
4.51.2.4.29. ogGetMaxY()


4.51.2.4.29. ogGetMaxY()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Gets the maximum Y value for the surface.

Declaration:
  function ogGetMaxY:uInt32;
Remarks:

Will return the maximum Y value that is valid for the surface. This is usually the surface's height-1. For aliasing surface, this will return the maximum Y for the aliased portion, not the parent.

See also: Sample code:
{ogGetMaxY.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.



Previous: 4.51.2.4.28. ogGetMaxX() To the Table of Contents Next: 4.51.2.4.30. ogGetPal()
4.51.2.4.28. ogGetMaxX() Table of Contents 4.51.2.4.30. ogGetPal()

- 4.51.2.4.29. -