CODE
struct Material
{
float m_ambient[8];
float m_diffuse[8];
};
[...More code...]
Material *def_ambientIntensity = new Material[1];
memcpy( def_ambientIntensity[1].m_ambient, ambientIntensity->amb, 17);
memcpy( def_ambientIntensity[1].m_diffuse , ambientIntensity->dif, 26);
//Next my noob way to see what the variable is.
MessageBox( NULL, (char*)def_ambientIntensity[1].m_diffuse, "Diffuse", MB_OK | MB_ICONERROR ); //Good
MessageBox( NULL, (char*)def_ambientIntensity[1].m_diffuse, "Diffuse", MB_OK | MB_ICONERROR ); //Bad?
Anyone see a problem? I have no clue why the value of "def_ambientIntensity[1].m_diffuse" would change. Please keep your explanation as simple as possible I just started learning c++ about 4 days ago...{
float m_ambient[8];
float m_diffuse[8];
};
[...More code...]
Material *def_ambientIntensity = new Material[1];
memcpy( def_ambientIntensity[1].m_ambient, ambientIntensity->amb, 17);
memcpy( def_ambientIntensity[1].m_diffuse , ambientIntensity->dif, 26);
//Next my noob way to see what the variable is.
MessageBox( NULL, (char*)def_ambientIntensity[1].m_diffuse, "Diffuse", MB_OK | MB_ICONERROR ); //Good
MessageBox( NULL, (char*)def_ambientIntensity[1].m_diffuse, "Diffuse", MB_OK | MB_ICONERROR ); //Bad?
Thanks,
Sparkx


