Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Created August 19, 2010 09:03
Show Gist options
  • Save bil-bas/537441 to your computer and use it in GitHub Desktop.
Save bil-bas/537441 to your computer and use it in GitHub Desktop.
Gosu::Image::as_devil
# Gosu::Image::as_devil (including workaround for Gosu to_blob colour shift bug)
module Gosu
class Image
def as_devil
raise ArgumentError, "Must provide a block" unless block_given?
devil_image = Devil.from_blob(Image.from_blob(to_blob, width, height).to_blob, width, height)
yield devil_image
gosu_image = devil_image.to_gosu $window
devil_image.delete
gosu_image
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment