Game Development Reference
In-Depth Information
There's more...
As an exercise, more UI controls can be added to this minimalistic framework. It is easy
to add static text labels and images. More complex UI controls, such as input boxes, can
be implemented too, but will require much more effort. If you want to build a complex UI
for your game, we recommend using one of the open source C++ UI libraries at http://
en.wikipedia.org/wiki/List_of_platform-independent_GUI_libraries .
See also
F Implementing the animated 3D image selector
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…
1.
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 irst
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.
2.
The previously described method is exactly how we do it in our Linderdaum Puzzle
HD game:
LPhotoSize FSize;
3.
We set the current state of this image to L_NOTSTARTED initially:
LImageState FState;
clPtr<clGLTexture> FTexture;
clPtr<clBitmap> FNewBitmap;
 
Search WWH ::




Custom Search