Hmmm, I have a class member function problem, and I can't find where the problem is, because I have four functions that set light properties(ambient, diffuse, etc.) and I have it stored in a map. Now the map size increases everytime the set functions are called, but when I call the enable function one call later the members inside the map dissapear. Take a look:
//These five are called right after each othervoid KLight::SetPosition(const KVector3<float> &pos){ LightProperties.insert(std::pair<LightMode, KVector3<float> >(GL_POSITION, pos)); //LightProperties[GL_POSITION] = pos;}void KLight::SetAmbient(const KVector3<float> &amb){ LightProperties.insert(std::pair<LightMode, KVector3<float> >(GL_AMBIENT, amb)); //LightProperties[GL_AMBIENT] = amb;}void KLight::SetDiffuse(const KVector3<float> &dif){ LightProperties.insert(std::pair<LightMode, KVector3<float> >(GL_DIFFUSE, dif)); //LightProperties[GL_DIFFUSE] = dif;}void KLight::SetSpecular(const KVector3<float> &spc){ LightProperties.insert(std::pair<LightMode, KVector3<float> >(GL_SPECULAR, spc)); //LightProperties[GL_SPECULAR] = spc;}//And this function is where they disappear.void KLight::Enable(){ const GLenum lights[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7}; const GLenum enablinglight = lights[LightNumber]; glEnable(GL_LIGHTING); glEnable(enablinglight); char a[20]; sprintf(a, "%d", LightProperties.size()); MessageBox(NULL, a, a, NULL); for(std::map<LightMode, KVector3<float> >::iterator it = LightProperties.begin(); it != LightProperties.end(); it++) { KVector3<float> outcolor = it->second; glLightfv(enablinglight, it->first, outcolor.GetArray()); }}