Jump to content
  • Advertisement

Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    66187

Dirty Rect Algo at work!!!

Sign in to follow this  
H_o_p_s

168 views



Need I really say anything for this horrid picture??

-=EDIT=-

Getting there... My current problem is that I need to take a portion of the bufferstrategy and copy it to a BufferedImage. The only problem is that I don't think that it is possible...

You can see two 'buffers'(really the same buffer, just copied to a different location and back again). The other problem is that I don't know how to change a color to alpha... anyhelp on that?
Sign in to follow this  


3 Comments


Recommended Comments

Quote:
Original post by H_o_p_s
My current problem is that I need to take a portion of the bufferstrategy and copy it to a BufferedImage. The only problem is that I don't think that it is possible...

Well, that depends. If - as is most often the case - your BufferStrategy is created (and accessed) using a VolatileImage, then it's a piece of caek, in a manner of speaking. It all depends on whether you can actually access it. If so, then you can use VolatileImage.getSnapshot() (note - you need a variable name, it's not a static method), which returns a BufferedImage of the contents on the VolatileImage itself. At least that what it seems to imply ... and then you do whatever it is that needs to be done.

Disclaimer : I haven't actually tried this, as it's been awhile since I've played with Java2D. I'm hoping to get back to it in the near future.

On a related note, your demo is looking very nice. Keep up the good work. [smile]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!