BRender Technical Reference Manual:3 Functions (Structured Reference):Library Initialisation & Termination
Next|Prev|Up
Initialisation
BrBegin()
Termination
BrEnd()

Library Initialisation & Termination


Initialisation

The BRender library requires more than static initialisation, and needs an opportunity to perform various initialisations before most BRender functions are called. There is, as yet, no standard for library initialisation, so the function BrBegin()10 is provided as a means of explicitly initialising the BRender library.

However, there are a few things that should precede BrBegin()10, and in the following order:

  1. Install a diagnostic handler using BrDiagHandlerSet()116 (See Diagnostic Support, page 65)

  2. Install a memory allocator using BrAllocatorSet()100 (See Memory Management, page 53)

  3. Install a filing system using BrFilesystemSet()127 (See Filing System Support, page 57)

If any of these steps are not performed, BrBegin()10 will perform the equivalent to a usable default (appropriate to the platform). Which steps you perform depends upon your application's requirements.


BrBegin()

Description:
Initialise BRender. This function must be called before most BRender functions are used.

Declaration:
void BrBegin(void)

Preconditions:
Static initialisation has completed (main() has been entered). The BRender library has not yet been initialised, or has been terminated.

Effects:
Installs any missing handlers (diagnostic handler, memory allocator, filing system) to appropriate platform defaults.

Initialises filing system (See Filing System Support, page 57)

Initialises registry (See Pre-Rendering Pre-Processing, page 29)

Initialises resource classes (See Resource Management, page 48)

Creates various defaults (models, materials, etc.)

Remarks:
Do not call BrBegin()10 again without a preceding BrEnd()11.

See Also:
BrEnd()11


Termination

The BRender library should be closed down when it is no longer required (having first ensured the application has explicitly released all use of BRender facilities). This typically causes BRender to release all memory allocated in resource classes. Nevertheless, it may still be restarted using BrBegin()10 (though handlers do not necessarily need to be reset).


BrEnd()

Description:
End BRender, freeing its internal resources and memory.

Declaration:
void BrEnd(void)

Preconditions:
The BRender library has been initialised and has not already been terminated.

Effects:
Releases all memory allocated in resource classes. This is effectively all memory allocated by BRender for its own use and all memory allocated in the various BRender allocation functions, such as BrModelAllocate()
239.

Remarks:
Your application should have gracefully released all dependence upon BRender data and functions before calling BrEnd()11.

See Also:
BrBegin()10



Generated with CERN WebMaker