Base functionality.
More...
|
|
#define | B2_NULL_INDEX ( -1 ) |
| | Used to indicate an unset or invalid index value.
|
|
#define | B2_VERSION_MAJOR 3 |
| | Significant API and behavior changes.
|
|
#define | B2_VERSION_MINOR 2 |
| | API changes and features.
|
|
#define | B2_VERSION_REVISION 0 |
| | Bug fixes. No API changes.
|
|
| typedef void * | b2AllocCallbackFcn(size_t size, int alignment) |
| | Prototype for user allocation function.
|
| typedef void | b2FreeCallbackFcn(void *mem, size_t size) |
| | Prototype for user free function.
|
|
typedef int | b2AssertCallbackFcn(const char *condition, const char *fileName, int lineNumber) |
| | Prototype for the user assert callback. Return 0 to skip the debugger break.
|
|
typedef void | b2LogCallbackFcn(const char *message) |
| | Prototype for user log callback. Used to log warnings.
|
◆ b2Version
Version numbering scheme.
See https://semver.org/
| Data Fields |
|
int |
major |
Significant changes. |
|
int |
minor |
Incremental changes. |
|
int |
revision |
Bug fixes. |
◆ b2AllocCallbackFcn
| typedef void * b2AllocCallbackFcn(size_t size, int alignment) |
Prototype for user allocation function.
- Parameters
-
| size | the allocation size in bytes |
| alignment | the required alignment, guaranteed to be a power of 2 |
◆ b2FreeCallbackFcn
| typedef void b2FreeCallbackFcn(void *mem, size_t size) |
Prototype for user free function.
- Parameters
-
| mem | the memory previously allocated through b2AllocCallbackFcn |
| size | the allocation size in bytes |
◆ b2GetByteCount()
| size_t b2GetByteCount |
( |
void | | ) |
|
- Returns
- the total bytes allocated by Box2D
◆ b2IsAVX2Available()
| bool b2IsAVX2Available |
( |
void | | ) |
|
- Returns
- true if the current CPU has the AVX2 instruction set.
◆ b2IsDoublePrecision()
| bool b2IsDoublePrecision |
( |
void | | ) |
|
- Returns
- true if the library was built with BOX2D_DOUBLE_PRECISION (large world mode)
◆ b2SetAllocator()
This allows the user to override the allocation functions.
These should be set during application startup.
◆ b2SetAssertCallback()
Override the default assert function.
- Parameters
-
| assertFcn | a non-null assert callback |
◆ b2SetLogCallback()
Override the default log function.
- Parameters
-
| logFcn | a non-null log callback |