Box2D 3.1.0
A 2D physics engine for games
Loading...
Searching...
No Matches
Base

Base functionality More...

Data Structures

struct  b2Version
 Version numbering scheme. More...
 

Typedefs

typedef void * b2AllocFcn(unsigned int size, int alignment)
 Prototype for user allocation function.
 
typedef void b2FreeFcn(void *mem)
 Prototype for user free function.
 
typedef int b2AssertFcn(const char *condition, const char *fileName, int lineNumber)
 Prototype for the user assert callback. Return 0 to skip the debugger break.
 

Functions

void b2SetAllocator (b2AllocFcn *allocFcn, b2FreeFcn *freeFcn)
 This allows the user to override the allocation functions.
 
int b2GetByteCount (void)
 
void b2SetAssertFcn (b2AssertFcn *assertFcn)
 Override the default assert callback.
 
b2Version b2GetVersion (void)
 Get the current version of Box2D.
 

Detailed Description

Base functionality


Data Structure Documentation

◆ b2Version

struct b2Version

Version numbering scheme.

See https://semver.org/

Data Fields
int major Significant changes.
int minor Incremental changes.
int revision Bug fixes.

Typedef Documentation

◆ b2AllocFcn

typedef void * b2AllocFcn(unsigned int size, int alignment)

Prototype for user allocation function.

Parameters
sizethe allocation size in bytes
alignmentthe required alignment, guaranteed to be a power of 2

◆ b2FreeFcn

typedef void b2FreeFcn(void *mem)

Prototype for user free function.

Parameters
memthe memory previously allocated through b2AllocFcn

Function Documentation

◆ b2GetByteCount()

int b2GetByteCount ( void )
Returns
the total bytes allocated by Box2D

◆ b2SetAllocator()

void b2SetAllocator ( b2AllocFcn * allocFcn,
b2FreeFcn * freeFcn )

This allows the user to override the allocation functions.

These should be set during application startup.

◆ b2SetAssertFcn()

void b2SetAssertFcn ( b2AssertFcn * assertFcn)

Override the default assert callback.

Parameters
assertFcna non-null assert callback