##### Ninja Library - Debugging Function

# njFrameBufferBmp

Converts frame buffer to Bit Map Image

### FORMAT

`

  void njFrameBufferBmp( *bmp, *buffer )
  char *bmp
  char *buffer

`

### PARAMETER

  `*bmp` | BMP saving buffer
  `*buffer` | Work buffer

### RETURN

  None

### DESCRIPTION

  Changes the context of frame buffer into 24bit texture image.

  Set frame buffer to 24 bit BMP. The following sizes are required for bitmap buffer size and work buffer size.

  bitmap buffer size (bmp) = screen length x screen width x 3 bytes + 54 bytes
  work buffer size (buffer) = screen length x screen width x number of screen mode bytes

  * Number of screen mode bytes is when NJD_FRAMEBUFFER_MODE_RGB565, 2 bytes and when NJD_FRAMEBUFFER_MODE_ARGB8888, 4 bytes.

  For `njInitTextureBuffer()` function, work buffer does not need to be specified. If binary save is performed using CodeScape , bitmap buffer becomes BMP file. Currently, it applies only for frame#0. So using this function while frame#0 is drawn creates an image in the middle of rendering. (will be modified in future)

### EXAMPLE

      /* Converts the frame buffer context to a bitmap image as frame.bmp. */
      njFrameBufferBmp("frame.bmp");

      Sint8 *bmp;
      Sint8 *buffer;
      /* Set frame buffer as bitmap
      when screen mode is NJD_FRAMEBUFFER_MODE_RGB565
      */
      bmp = syMalloc(640*480*3+54);
      buffer = syMalloc(640*480*2);
       njFrameBufferBmp(bmp,buffer);
      Saves size of 640*480*3+54 from bmp address by CodeScape binary save.

### NOTE

  Specification have been modified. Buffer does not need to be specified in `njInitTextureBuffer()` function. It can be used for debugging purpose.

njFrameBufferBmp

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999