Image gallery with Picasa downloader
In this recipe, we will integrate our Picasa images downloader with a carousel-based 3D gallery, and use it as a picture selection page in our game.
How to do it…
To download the images and track the state of the downloader, we use the
sImageDescriptor
structure describing the state of any game image:class sImageDescriptor: public iObject { public: size_t FID; std::string FURL;
Now comes the image size code. We support a single image type only: small 256 pixel-wide previews. Multi-stage previews can be implemented when the game first loads very small images over the network, let's say not larger than 128 pixels. Then larger 256 pixel previews replace them to give crisp previews on Full HD screens. And after the player has picked an image from the gallery, a full-sized preview is fetched from the server.
The previously described method is exactly how we do it in our Linderdaum Puzzle HD game:
LPhotoSize FSize;
We set the current state of this image to...