how to initialize ?

Started by
1 comment, last by Kippesoep 18 years, 10 months ago
take a look: void f() { static D3DXMATRIX matrix; ZeroMemory(&matrix, sizeof(D3DXMATRIX)); .... } this way,every time the matrix will be zero. so how to have this way: static D3DXMATRIX matrix = ZeroMemroy(...); I know this not work,just give some tip. so how to do? I must do this way? int static i = 0;i++;if (i ==1)ZeroMemory(&matrix, sizeof(D3DXMATRIX));
Advertisement
void f()
{
static D3DXMATRIX matrix;
static initialised = false;
if ( !initialised )
{
ZeroMemory(&matrix, sizeof(D3DXMATRIX));
initialised = true;
}

...
}
My games: www.spiralfast.com/pacifist
Why not just:
static D3DXMATRIX matrix (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

Kippesoep

This topic is closed to new replies.

Advertisement