In PureBasic a debug callback routine could look like this:
And it is invoked like this:
The Blitz3D SDK documentation implies that the call to bbEndBlitz3D() can be omitted from the callback routine, but in practice it seems to be needed. The actual wording is:
Procedure MyDebugHandler(msg$) MessageRequester("My World Has Collapsed!", "Error: "+msg$) bbEndBlitz3D() End EndProcedure
And it is invoked like this:
bbSetBlitz3DDebugCallback(@MyDebugHandler())
The Blitz3D SDK documentation implies that the call to bbEndBlitz3D() can be omitted from the callback routine, but in practice it seems to be needed. The actual wording is:
The Blitz3D runtime is closed before the error handler is invoked by the Blitz3DSDK