Base functionality.
More...
|
| typedef void * | b3AllocFcn(int32_t size, int32_t alignment) |
| | Prototype for user allocation function.
|
| typedef void | b3FreeFcn(void *mem) |
| | Prototype for user free function.
|
|
typedef int | b3AssertFcn(const char *condition, const char *fileName, int lineNumber) |
| | Prototype for the user assert callback. Return 0 to skip the debugger break.
|
|
typedef void | b3LogFcn(const char *message) |
| | Prototype for user log callback. Used to log warnings.
|
|
| void | b3SetAllocator (b3AllocFcn *allocFcn, b3FreeFcn *freeFcn) |
| | This allows the user to override the allocation functions.
|
|
int32_t | b3GetByteCount (void) |
| | Total bytes allocated by Box3D.
|
| void | b3SetAssertFcn (b3AssertFcn *assertFcn) |
| | Override the default assert callback.
|
|
int | b3InternalAssert (const char *condition, const char *fileName, int lineNumber) |
| | Internal assertion handler. Allows for host intervention.
|
|
void | b3SetLogFcn (b3LogFcn *logFcn) |
| | Override the default logging callback.
|
|
b3Version | b3GetVersion (void) |
| | Get the current version of Box3D.
|
| bool | b3IsDoublePrecision (void) |
◆ b3Version
Version numbering scheme.
See https://semver.org/
| Data Fields |
|
int |
major |
Significant changes. |
|
int |
minor |
Incremental changes. |
|
int |
revision |
Bug fixes. |
◆ B3_ASSERT
| #define B3_ASSERT |
( |
| condition | ) |
|
Value:( (void)( ( !!( condition ) ) || (
b3InternalAssert( #condition, __FILE__, (
int)( __LINE__ ) ), 0 ) ) )
int b3InternalAssert(const char *condition, const char *fileName, int lineNumber)
Internal assertion handler. Allows for host intervention.
Assert that a condition is true.
◆ B3_BREAKPOINT
| #define B3_BREAKPOINT assert( 0 ) |
◆ B3_VALIDATE
| #define B3_VALIDATE |
( |
| ... | ) |
|
Value:
Validation is typically only enabled in debug builds.
Floating point tolerance checks should use this instead of the regular assertion
◆ b3AllocFcn
| typedef void * b3AllocFcn(int32_t size, int32_t alignment) |
Prototype for user allocation function.
- Parameters
-
| size | the allocation size in bytes |
| alignment | the required alignment, guaranteed to be a power of 2 |
◆ b3FreeFcn
| typedef void b3FreeFcn(void *mem) |
Prototype for user free function.
- Parameters
-
| mem | the memory previously allocated through b3AllocFcn |
◆ b3IsDoublePrecision()
| bool b3IsDoublePrecision |
( |
void | | ) |
|
- Returns
- true if the library was built with BOX3D_DOUBLE_PRECISION (large world mode)
◆ b3SetAllocator()
This allows the user to override the allocation functions.
These should be set during application startup.
◆ b3SetAssertFcn()
Override the default assert callback.
- Parameters
-
| assertFcn | a non-null assert callback |