srp
software rendering pipeline
Loading...
Searching...
No Matches

Internal stuff that cannot be easity grouped into other modules. More...

Collaboration diagram for Various:
#define SRP_FORCEINLINE   inline
 
#define M_PI   3.14159265358979323846
 
#define MIN(a, b)   ( (a) > (b) ? (b) : (a) )
 
#define MAX(a, b)   ( (a) > (b) ? (a) : (b) )
 
#define CLAMP(min, max, value)
 
#define FRACTIONAL(x)   ( (x) - floor(x) )
 
#define INDEX_VOID_PTR(ptr, idx, nBytesPerElement)    ( ( (uint8_t*) (ptr) ) + (idx) * (nBytesPerElement) )
 
#define ADD_VOID_PTR(ptr, nBytes)    ( ( (uint8_t*) (ptr) ) + (nBytes) )
 

Detailed Description

Internal stuff that cannot be easity grouped into other modules.

Macro Definition Documentation

◆ ADD_VOID_PTR

#define ADD_VOID_PTR (   ptr,
  nBytes 
)     ( ( (uint8_t*) (ptr) ) + (nBytes) )

Add nBytes bytes to the void*

◆ CLAMP

#define CLAMP (   min,
  max,
  value 
)
Value:
( \
(value < min) ? \
(min) : \
(value > max) ? \
(max) : \
(value) \
)

Clamp the value between min and max

Returns
min, if value < min; max, if value > max; value otherwise

◆ FRACTIONAL

#define FRACTIONAL (   x)    ( (x) - floor(x) )

Get the fractional part of float or double

◆ INDEX_VOID_PTR

#define INDEX_VOID_PTR (   ptr,
  idx,
  nBytesPerElement 
)     ( ( (uint8_t*) (ptr) ) + (idx) * (nBytesPerElement) )

Index void* as if it was an array with nBytesPerElement bytes per element

◆ MAX

#define MAX (   a,
 
)    ( (a) > (b) ? (a) : (b) )

Get the maximum of two values

◆ MIN

#define MIN (   a,
 
)    ( (a) > (b) ? (b) : (a) )

Get the minimum of two values