Changes between Version 3 and Version 4 of ~archive/ResourceManager
- Timestamp:
- Apr 15, 2017, 3:03:03 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
~archive/ResourceManager
v3 v4 9 9 1. Resources that are loaded (like a Texture) always have a Data-type (like !TextureData) where the data is stored. 10 10 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]. 12 12 Resources do: 13 13 * locate Files on the disc in a Directoy of your joice 14 14 * store a copy of a !ResourceData with a Key-Name. 15 15 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.16 In the following document [wiki:ResourceTexture ResourceTexture] is only assumed as an Example. This also works with ResourceMD2, ResourceOBJ, !ResourceSoundBuffer and so on. 17 17 == Usage Example == 18 18 * Share a Resource (assumes texutre has some data assigned to it): … … 24 24 }}} 25 25 Here 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] 27 27 {{{ 28 28 #!cpp … … 33 33 Texture storeTex = ResourceTexture("orxonox.png", GL_TEXTURE_2D); 34 34 }}} 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 :) ).35 As 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 :) ). 36 36 37 37 == 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. 39 39 * The Texture part sais, how to load a Texture from a disc. 40 40 * The Resource part sais, where the Resource can be found, and to check if the Resource was already loaded