Changes between Version 1 and Version 2 of ~archive/ResourceManager
- Timestamp:
- Nov 28, 2007, 12:14:28 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
~archive/ResourceManager
v1 v2 5 5 For this Orxonox provides a Shared Resource System for these time-consuming processes. 6 6 7 1. Resources that are loaded (like a Texture) always have a Data-type (like TextureData) where the data is stored.7 1. Resources that are loaded (like a Texture) always have a Data-type (like !TextureData) where the data is stored. 8 8 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 9 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 ResourceTexture.9 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]. 10 10 Resources do: 11 11 * locate Files on the disc in a Directoy of your joice 12 * store a copy of a ResourceData with a Key-Name.12 * store a copy of a !ResourceData with a Key-Name. 13 13 14 In the following document ResourceTexture is only assumed as an Example. This also works with ResourceMD2, ResourceOBJ,ResourceSoundBuffer and so on.14 In the following document [wiki:archive/ResourceTexture ResourceTexture] is only assumed as an Example. This also works with ResourceMD2, ResourceOBJ, !ResourceSoundBuffer and so on. 15 15 == Usage Example == 16 16 * Share a Resource (assumes texutre has some data assigned to it): … … 22 22 }}} 23 23 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. 24 * Load a Texture from the disc with ResourceTexture24 * Load a Texture from the disc with [wiki:archive/ResourceTexture ResourceTexture] 25 25 {{{ 26 26 #!cpp … … 31 31 Texture storeTex = ResourceTexture("orxonox.png", GL_TEXTURE_2D); 32 32 }}} 33 As you can see Texture is loaded over ResourceTexture, the data loaded in Resource Texture is assigned as easy from Texture to storeTex as from any other Texture (since ResourceTextureisA Texture :) ).33 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 :) ). 34 34 35 35 == Behind the scenes == 36 ResourceTextureis a Handler that is derived from Texture and Resource.36 [wiki:archive/ResourceTexture ResourceTexture] is a Handler that is derived from Texture and Resource. 37 37 * The Texture part sais, how to load a Texture from a disc. 38 38 * The Resource part sais, where the Resource can be found, and to check if the Resource was already loaded