Changes between Version 11 and Version 12 of UsingResources


Ignore:
Timestamp:
05/24/13 11:41:26 (6 years ago)
Author:
welberge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsingResources

    v11 v12  
    4242}}} 
    4343 
    44 == Resource caching: hmi.util.ResourcePool == 
     44== Resource caching: hmi.util.!ResourcePool == 
    4545The hmi.util.Resource class is fine for loading resources from a resource directory, but does not take care of resource caching. That is, when you load, for instance, some texture image via a Resource object, you might easily load the same texture image several times. Even worse, you might create several different GLTexture objects, all based on the same texture image, resulting in wasting texture memory space of your graphics card. The ResourcePool class has been designed to handle such situations. A ResourcePool object requires you to create a so called “ResourceLoader” object, to be used when some resource has to be actually loaded from a resource file. The ResourcePool will then cache the result, and deliver the cached object the next time that the same 
    4646resource is asked for.