Previous: 4.51.2.4.31. ogGetPixel() To the Table of Contents Next: 4.51.2.4.33. ogGetPtr()
4.51.2.4.31. ogGetPixel() Table of Contents 4.51.2.4.33. ogGetPtr()

- 4.51.2.4.32. -
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.32. ogGetPixFmt()


4.51.2.4.32. ogGetPixFmt()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Gets the pixel format of a surface.

Declaration:
  procedure ogGetPixFmt(var pixfmt:ogPixelFmt);
Remarks:

Returns information about the surface's pixel format including the bitdepth, RGBA ordering, and RGBA mask size.

See also: Sample code:
{ogGetPixFmt.pas}

uses
  ObjGfx40, CRT;

var 
  buf:^ogSurface;
  pixfmt:ogPixelFmt;
    
begin
  new(buf, ogInit);

  screen^.ogCreate(640, 480, OG_PIXFMT_32BPP);
  screen^.ogGetPixFmt(pixfmt);

  {Create a buffer with the identical dimensions and pixel format as
   the screen}
  buf^.ogCreate(screen^.ogGetMaxX+1, screen^.ogGetMaxY+1, pixfmt);

  dispose(buf, ogDone);
end.



Previous: 4.51.2.4.31. ogGetPixel() To the Table of Contents Next: 4.51.2.4.33. ogGetPtr()
4.51.2.4.31. ogGetPixel() Table of Contents 4.51.2.4.33. ogGetPtr()

- 4.51.2.4.32. -