Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualWaterlimon

Posted 03 February 2013 - 11:10 AM

So i have the situation, where i have a class that contains some allocated data (in this case an opengl vertex buffer allocated on the GPU). I have a grid of these objects, and i want to move them all to a bigger grid.
This means doing something along the lines of
bigGrid[x]=smallGrid[x]
that is,
1.A=B
2.~B()
Which is a problem since i have set my vertex buffer deallocate itself upon destruction. How would you recommend me to overcome this problem? Should i use the newish move semantics here?

Thanks

Oh and the original grid is destroyed after copying all of them. So im basically just moving them.

#4Waterlimon

Posted 03 February 2013 - 11:08 AM

So i have the situation, where i have a class that contains some allocated data (in this case an opengl vertex buffer allocated on the GPU). I have a grid of these objects, and i want to move them all to a bigger grid.

This means doing something along the lines of

bigGrid[x]=smallGrid[x]

that is,

1.A=B

2.~B()

Which is a problem since i have set my vertex buffer deallocate itself upon destruction. How would you recommend me to overcome this problem? Should i use the newish move semantics here?

 

Thanks


#3Waterlimon

Posted 03 February 2013 - 11:05 AM

So i have the situation, where i have a class that contains some allocated data (in this case an opengl vertex buffer allocated on the GPU).

I have a grid of these objects, and i want to move them all to a bigger grid.

This means doing something along the lines of
bigGrid[x]=smallGrid[x]
that is,
1.A=B
2.~B()

Which is a problem since i have set my vertex buffer deallocate itself upon destruction.

How would you recommend me to overcome this problem?

Should i use the newish move semantics here?

Thanks

#2Waterlimon

Posted 03 February 2013 - 11:03 AM

So i have the situation, where i have a class that contains some allocated data (in this case an opengl vertex buffer allocated on the GPU).

I have a grid of these objects, and i want to move them all to a bigger grid.

This means doing something along the lines of
bigGrid[x]=smallGrid[x]
that is,
1.A=B
2.~B()

Which is a problem since i have set my vertex buffer deallocate itself upon destruction.

How would you recommend me to overcome this problem?

Should i use the newish move semantics here?

Thanks

#1Waterlimon

Posted 03 February 2013 - 11:03 AM

So i have the situation, where i have a class that contains some allocated data (in this case an opengl vertex buffer allocated on the GPU).

 

I have a grid of these objects, and i want to move them all to a bigger grid.

 

This means doing something along the lines of

bigGrid[x]=smallGrid[x]

that is,

1.A=B

2.~B

 

Which is a problem since i have set my vertex buffer deallocate itself upon destruction.

 

How would you recommend me to overcome this problem?

 

Should i use the newish move semantics here?

 

Thanks


PARTNERS