CRI ADX  Last Updated: 2024-07-17 10:47 p
CriAtomExRngInterfaceTag Struct Reference

Random Number Generator interface. More...

#include <cri_le_atom_ex.h>

Data Fields

CriSint32(* CalculateWorkSize )(void)
 Calculate the work buffer size. More...
 
CriAtomExRngHn(* Create )(void *work, CriSint32 work_size)
 Create a Random Number Generator. More...
 
void(* Destroy )(CriAtomExRngHn rng)
 Destroy a Random Number Generator. More...
 
CriSint32(* Generate )(CriAtomExRngHn rng, CriSint32 min, CriSint32 max)
 Generate a random number. More...
 
void(* SetSeed )(CriAtomExRngHn rng, CriUint32 seed)
 Set a random seed. More...
 

Detailed Description

Random Number Generator interface.

Field Documentation

◆ CalculateWorkSize

CriSint32(* CalculateWorkSize) (void)

Calculate the work buffer size.

Returns
CriSint32 work buffer size
Description:
Calculates the size of the work buffer required to create a Random Number Generator.

◆ Create

CriAtomExRngHn(* Create) (void *work, CriSint32 work_size)

Create a Random Number Generator.

Parameters
[in]workwork buffer
[in]work_sizework buffer size
Returns
CriAtomExRngHn Random Number Generator handle
Description:
Creates a Random Number Generator.
If this function fails to create a Random Number Generator, it returns NULL.

◆ Destroy

void(* Destroy) (CriAtomExRngHn rng)

Destroy a Random Number Generator.

Parameters
[in]rngRandom Number Generator handle
Description:
Destroys a Random Number Generator.

◆ Generate

CriSint32(* Generate) (CriAtomExRngHn rng, CriSint32 min, CriSint32 max)

Generate a random number.

Parameters
[in]rngRandom Number Generator handle
[in]minminimum value
[in]maxmaximum value
Returns
CriSint32 random number
Description:
Generates a new random number.
The generated number will be between min and max (both included).

◆ SetSeed

void(* SetSeed) (CriAtomExRngHn rng, CriUint32 seed)

Set a random seed.

Parameters
[in]rngRandom Number Generator handle
[in]seedrandom seed
Description:
Sets the random seed used to generate a random number.

The documentation for this struct was generated from the following file: