Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 3 and Version 4 of ~archive/ResourceManager


Ignore:
Timestamp:
Apr 15, 2017, 3:03:03 PM (3 years ago)
Author:
landauf
Comment:

fixed links

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/ResourceManager

    v3 v4  
    99 1. Resources that are loaded (like a Texture) always have a Data-type (like !TextureData) where the data is stored.
    1010 2. The Resources have a counted pointer to these Data, so if you copy one Texture to another one, only the pointer will be copied, and the reference-count of the pointer will be automatically increased
    11  3. To Finaly load a Resource from disc, and keep a constant version of the Data in check, the Resource functionality is finally used: for the Resource Texture the coresponding Resourcerer is [wiki:archive/ResourceTexture ResourceTexture].
     11 3. To Finaly load a Resource from disc, and keep a constant version of the Data in check, the Resource functionality is finally used: for the Resource Texture the coresponding Resourcerer is [wiki:ResourceTexture ResourceTexture].
    1212   Resources do:
    1313   * locate Files on the disc in a Directoy of your joice
    1414   * store a copy of a !ResourceData with a Key-Name.
    1515
    16 In the following document [wiki:archive/ResourceTexture ResourceTexture] is only assumed as an Example. This also works with ResourceMD2, ResourceOBJ, !ResourceSoundBuffer and so on.
     16In the following document [wiki:ResourceTexture ResourceTexture] is only assumed as an Example. This also works with ResourceMD2, ResourceOBJ, !ResourceSoundBuffer and so on.
    1717== Usage Example ==
    1818  * Share a Resource (assumes texutre has some data assigned to it):
     
    2424}}}
    2525Here you can see, that copy has _NO_ pointer type, so we can copy one Texture to another one, and both textures share the same data.
    26   * Load a Texture from the disc with [wiki:archive/ResourceTexture ResourceTexture]
     26  * Load a Texture from the disc with [wiki:ResourceTexture ResourceTexture]
    2727{{{
    2828#!cpp
     
    3333  Texture storeTex = ResourceTexture("orxonox.png", GL_TEXTURE_2D);
    3434}}}
    35 As you can see Texture is loaded over [wiki:archive/ResourceTexture ResourceTexture], the data loaded in Resource Texture is assigned as easy from Texture to storeTex as from any other Texture (since [wiki:archive/ResourceTexture ResourceTexture] isA Texture :) ).
     35As you can see Texture is loaded over [wiki:ResourceTexture ResourceTexture], the data loaded in Resource Texture is assigned as easy from Texture to storeTex as from any other Texture (since [wiki:ResourceTexture ResourceTexture] isA Texture :) ).
    3636
    3737== Behind the scenes ==
    38 [wiki:archive/ResourceTexture ResourceTexture] is a Handler that is derived from Texture and Resource.
     38[wiki:ResourceTexture ResourceTexture] is a Handler that is derived from Texture and Resource.
    3939  * The Texture part sais, how to load a Texture from a disc.
    4040  * The Resource part sais, where the Resource can be found, and to check if the Resource was already loaded