##### Ninja Library - System Function

# njSetVertexBuffer

Sets the vertex buffer area

### FORMAT

`

  void njSetVertexBuffer( *buffer, size )
  Uint32 *buffer
  Sint32 size

`

### PARAMETER

  `*buffer` | Pointer to vertex buffer area
  `size` | Vertex buffer area size

### RETURN

  None

### DESCRIPTION

  Allows the user to set the vertex buffer areas. The `njlnitVertexBuffer()` function sets the vertex buffer areas from the area set here. When this function is used, the user settings will be used until all the applications are closed. It is also possible to set a user specified area during use. If the vertex buffer size is changed because of mode change, execute `njSetVertexBuffer()` function before executing `njlniteVertexBuffer()` function.

  The memory sizes obtained with 3 V latency and 2 V latency are as follows.

  3 V latency | Obtained memory size = (op + om + tp + tm + pt)x4 + 352(required internal area) bytes
  2 V latency | Obtained memory size = 100(buffer with minus) + (other buffers)x4 + 352(required internal area)

  Example:
  In the case of 3 V
  njInitVertexBuffer( 100000, 0, 100000, 0, 0);
  op = 100000*4 bytes = 400000 bytes
  tp = 100000*4 bytes = 400000 bytes
  Required internal area = 352 bytes
  Total 800352 bytes

  In the case of 2 V latency with the same settings as above
  njInitVertexBuffer( -100000, 0, 50000, 0 ,0);
  op = minus is 100 bytes
  to = 50000*4 bytes = 200000 bytes (half is acceptable as this is a single buffer)
  Required internal area = 352 bytes
  Total 200452 bytes

### EXAMPLE

      Normal initialization procedure:

      sbInitSystem(NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
      njSetVertexBuffer(buffer,size);
      njInitVertexBuffer( -100000, 0, 50000, 0 ,0);

      Initialization procedure when the mode is changed:

      njChangeSystem(NJD_RESOLUTION_640x480_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1);
      njSetVertexBuffer(buffer,size);
      njInitVertexBuffer( -100000, 0, 50000, 0 ,0);

### REFERENCE

  `njInitVertexBuffer()
  `

njSetVertexBuffer

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999