ClearMemory function?


I’m got this code from here The code is displayed on that page, no downloads needed.

Tagent mapping, I have it integrated into my code.(My first time doing tangent mapping, so not confident enough to rewrite it)

It all compiles fine, aside from one a missing function ClearMemory. The line in the code.

ClearMemory(tan1, vertexCount * sizeof(Vector3D) * 2);

I’m using vc++. I did a find in files search and no includes I have include it, nor can I find it on the web.

Any ideas where or a similar function i can use instead? (tan1 is a class of vector3ds)

Common man… Use your brain!

memset(tan1, 0, vertexCount * sizeof(Vector3D) * 2);


memset(tan1, 0, vertexCount * sizeof(Vector3D) * 2);
You may have to
#include <memory.h>

The function appears to fill all of the array. It isn’t strictly necessary to “clear” it. IMO the whole thing would still work if you just omit the ClearMemory call, instead of replacing it with something more portable.

Try just writing ZeroMemory, that function should be included.

How about asking in an appropriate forum?