Original Post
I don't really know how to word this so I'll just draw it in psudo code...
[source lang="cpp"]class ROOMCLASS
{
a texture
a constructor that creates that texture with the directx device
a destructor that releases the texture
}
class HOUSECLASS
{
a vector of ROOMCLASS called "rooms";
constructor:
{
ROOMCLASS temp_room;
rooms.push_back(temp_room);
}
// at this point I have checked and the texture in both temp_room and rooms[0] are both valid.
} // at this point a ROOMCLASS destructor is called and releases that texture without issue.
HOUSECLASS houses;
function MAKE_A_NEW_HOUSE
{
HOUSECLASS temp_house;
// at this point the texture in temp_house.room[0] appears to be invalid.
houses.push_back(temp_house);
} // at this point a ROOMCLASS destructor is called and causes an error.[/source]
Is the problem that you can't use vector.push_back when a texture is involved?
[source lang="cpp"]class ROOMCLASS
{
a texture
a constructor that creates that texture with the directx device
a destructor that releases the texture
}
class HOUSECLASS
{
a vector of ROOMCLASS called "rooms";
constructor:
{
ROOMCLASS temp_room;
rooms.push_back(temp_room);
}
// at this point I have checked and the texture in both temp_room and rooms[0] are both valid.
} // at this point a ROOMCLASS destructor is called and releases that texture without issue.
HOUSECLASS houses;
function MAKE_A_NEW_HOUSE
{
HOUSECLASS temp_house;
// at this point the texture in temp_house.room[0] appears to be invalid.
houses.push_back(temp_house);
} // at this point a ROOMCLASS destructor is called and causes an error.[/source]
Is the problem that you can't use vector.push_back when a texture is involved?