passing a float as a pointer to a matrix

Posted by numerical25 on Stack Overflow See other posts from Stack Overflow or by numerical25
Published on 2010-05-10T12:33:38Z Indexed on 2010/05/10 12:44 UTC
Read the original article Hit count: 130

Filed under:
|
|

Honestly, I couldnt think of a better title for this issue because I am having 2 problems and I don't know the cause.

The first problem I have is this

//global declaration
float g_posX = 0.0f;
.............


//if keydown happens
g_posX += 0.03f;


&m_mtxView._41 = g_posX;

I get this error

cannot convert from 'float' to 'float *'

So I assume that the matrix only accepts pointers. So i change the varible to this....

//global declaration
float *g_posX = 0.0f;
.............


//if keydown happens
g_posX += 0.03f;


&m_mtxView._41 = &g_posX;

and I get this error

cannot convert from 'float' to 'float *'

which is pretty much saying that I can not declare g_posX as a pointer.

honestly, I don't know what to do.

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++