Original Post
Hello guys, this is my first post to these forums. I've been here for a short period of time and I already like it. I'm having trouble making a copy of a directdraw surface in one of my classes' copy contructor. What is the correct way to do it? I don't know what the code tags are, and I don't see a code tag button so I'm just gonna take a guess for now.
Animation::Animation(const Animation & rhs) { m_width = rhs.m_width; m_height = rhs.m_height; m_bpp = rhs.m_bpp; Dialog::error("Animation::Animation(copy)","before"); //m_surface = rhs.m_surface; // this just copies the pointer? //****************************************************// //**************** RIGHT HERE ************************// //****************************************************// memcpy(m_surface,rhs.m_surface, sizeof(rhs.m_surface)); Dialog::error("Animation::Animation(copy)","after"); }