CALLBACKS


To make library usage polyvalent as possible, it will no care about some tasks.You need to write theses
tasks and declare them to the module.Theses are values accepted by MD3_SetOption () :

=I/O=


I/O function needs to be defined by caller to allow control of memory allocation and if program uses
archives system instead of direct file loading.

$$MD3_OPTION_FOPEN

    fOpen(STRING filename, mode)
        -filename : file to be loaded
        -mode : module will pass only $$RD (defined in xblite)
        
return the file handle        

$$MD3_OPTION_FREAD

    fRead (hFile, lpBuffer, nNumberOfBytesToRead)
        -hFile : file handle
        -lpBuffer : where datas will be loaded
        -nNumberOfBytesToRead : self explanatory
        
return the ammount of bytes rode        

$$MD3_OPTION_FCLOSE

    fClose(hFile)
        -hFile : file to close
        
no return value

$$MD3_OPTION_FSEEK

    fSeek(hFile, lDistanceToMove)
        -hFile : handle to file
        -lDistanceToMove : position to seek, absolute
        
return position        

$$MD3_OPTION_PRINT

    Print(STRING text$)
        -text$ : text emitted by the module, various informations when processing a file
        
no return value

$$MD3_OPTION_MALLOC

    mAlloc(nbytes)
        -nbytes : ammount of bytes to allocate
        
return adress of the bytes allocated, this adress is used as a handle too        

$$MD3_OPTION_MFREE

    mFree(addr/hdl)
        -addr : adress of the bytes to free, this is a handle too
    

=SHADERS=


$$MD3_OPTION_SHADER_LOAD
    
    Shader_Load(STRING shadername)
        -shadername : shader to load
        
    The module will not care about shader managing but these function must be defined
    
Return shaderID of the loaded shader
    
$$MD3_OPTION_SHADER_FREE

    Shader_Free(XLONG shaderID)
        -shaderID : ID of the shader loaded by Shader_Load

        
    The module will not care about shader managing but these function must be defined
    
no return value    
    

=Rendering=


The module allows to use your own renderer procedure.This is very usefull if you uses delayed rendering,
multipass rendering, depth sorting, transparence managing, stack rendering... ...etc

$$MD3_OPTION_PUSH_SURFACE

    PushSurface (tMD3Model MD3m[],tMD3instance instance,XLONG shaderID,XLONG surface)
        -MD3m[] : an array containing all the models loaded by the module.Index to the targeted model can be
        found in 'instance.model'
        -instance : instance targeted
        -ShaderID : Shader used by the surface, the module will not care about it, just a reference
        -surface:surfaceID of the surface to be rendered
        
This function is called by BuildRender ().You can use the default renderer if you want to render directly the
surface by calling MD3_RenderMethod (tMD3instance @instance,surface,flags)