View Full Version : ClearMemory function?

10-17-2004, 04:54 AM

I'm got this code from here http://www.terathon.com/code/tangent.html 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)

10-17-2004, 05:16 AM
Common man... Use your brain!

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


10-17-2004, 05:17 AM
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.

10-17-2004, 06:08 AM
Try just writing ZeroMemory, that function should be included.

10-17-2004, 06:33 AM
How about asking in an appropriate forum?