Initialization and Shutdown

mi_ntlib_init
void mi_ntlib_init(void)

mental ray is highly portable and available for a wide range of systems ranging from PCs to supercomputers. It avoids operating-system dependent features whenever possible and relies on industry standards supported across all platforms, such as Posix. However, the Windows support for Posix functions is limited, so raylib includes a Posix support library that implements missing features. This sub-library must be initialized with a call to mi_ntlib_init, between mi_raylib_attach_process and mi_raylib_init. On non-Windows systems it does nothing.

mi_raylib_init
miBoolean mi_raylib_init(
    const miBoolean slave,
    const int       maxthreads,
    const miBoolean core)

This function initializes all modules in the library in the proper order, except MEM and NTLIB (because services from these two modules are often required before a full library initialization). The functions called before mi_raylib_init are normally mi_raylib_attach_process, mi_mem_error_handler, mi_img_error_handler, mi_mem_init, and mi_ntlib_init.

If raylib is encapsulated as a Windows DLL, mi_raylib_init should not be called from the DllMain because the startup of rendering threads would cause recursive calls of DllMain.

If mental ray fails to start up, miFALSE is returned. Common reason for such a failure are failures to start threads, or a failure to create local loopback network connections because a Windows firewall prohibits it.

mi_raylib_exit
void mi_raylib_exit(void)

This function calls the exit functions of all modules in the proper order, more or less the reverse of what mi_raylib_init did. After this call no raylib function except mi_raylib_detach_process may be used, not even mi_raylib_init. The only useful thing to do after exiting raylib is unloading it.

mi_raylib_attach_process
miBoolean mi_raylib_attach_process(void)

This function must be the very first raylib function to be called after the library is loaded. It allocates critical system resources needed even by all following raylib initialization functions. It returns miFALSE if unsuccessful.

mi_raylib_detach_process
miBoolean mi_raylib_detach_process(void)

This function does more or less the reverse of what mi_raylib_attach_process did. It should be the very last raylib function to be called, right after mi_raylib_exit.

Note that the initialization and the exit functions should all be called from one thread that stays alive during the entire lifetime of raylib. Other threads may later call raylib functions concurrently if they use the context functions described below.

mi_raylib_date
char *mi_raylib_date(void)

Return a static string containing the date when raylib was created.

mi_raylib_version
char *mi_raylib_version(void)

Return a static string containing the version number of raylib.

mi_version
void mi_version(void)

Print two messages using mi_info containing the date, version, and architecture of raylib. Also prints one message for each raylib module using mi_debug.

mi_lib_registry_lookup
   typedef enum {miRL_VALUE, miRL_VALUE_EXEC, miRL_LINK, miRL_CODE,
                 miRL_MI, miRL_SPDL, miRL_ECHO, miRL_SYSTEM } miRl_mode;

   char *mi_lib_registry_lookup(
        char            *name,          /* name of registry entry */
        miRl_mode       mode);          /* what to look up, side effects */

Look up a registry entry and return the string associated with the value of the key name. If there is no such key, or if no registry entry is found, return a null pointer. If side effects are enabled with mode miRL_VALUE_EXEC, also evaluate all the other keys the registry entry has, if found, in order. Mode miRL_value returns the standard value of the registry key; the other modes return auxiliary registry keys. All {name} substrings in the name are evaluated. As a bonus feature, {$name} returns the value of an environment variable, and {$?name} returns 1 if the environment variable var exists and 0 otherwise. A leading _ character suppresses errors for non-existence.

Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.