SaveModelA

This function saves the current model in an array.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall SaveModelA(
            __int64             model,
            unsigned char       * content,
            __int64             * size
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t SaveModelA(
            int64_t             model,
            unsigned char       * content,
            int64_t             * size
        );    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property content

Size: 32 bit / 4 byte (reference)
The content of this IO call, the size of the content is defined by attribute size.

Property size

Size: 32 bit / 4 byte (reference)
The size of the content as defined in number of bytes.

Example

Here you can find code snippits that show how the API call SaveModelA can be used.

#include "engine/include/engine.h"
#include <assert.h>

void    SaveModelByArray(int64_t model, wchar_t * fileName)
{
    FILE    * myFileWrite = nullptr;

    _wfopen_s(&myFileWrite, fileName, L"wb");
    if (&myFileWrite) {
        int64_t size = 0;

        SaveModelA(model, 0, &size);

        unsigned char   * content = new unsigned char[(int_t) size];
        SaveModelA(model, content, &size);

        fwrite(content, 1, (size_t) size, myFileWrite);
        delete[] content;

        fclose(myFileWrite);
    }
    else {
        assert(false);
    }
}