Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
A resource is any block of data used in different parts of a project. The data may be a sound, a script, a shader, a texture, a 3D model, an entire scene, or something else entirely.
The resource database holds a list of definitions for resources used by the project, along with references to classes responsible for loading them into the application on request.
Most objects that are called resources are static, i.e., they do not change over time. This extends to the techniques used to load or construct them as well. Take for example a font in an application, always loaded from a font file, and unchanged over that application's execution.
When a resource is required by an application, the resource may be in use simultaneously across multiple locations. The same 3D model may be used by multiple enemies in a game scene at the same time, for example.
On the other hand, any two projects may require entirely different sets of resources. Even within a single project, parts of it may require a resource that other parts do not. Eg., UI buttons, useful in game menus, have no place in the HUD of a first-person shooter.
It is also often the case that a single type of resource has multiple means of construction. Textures, for example, may be loaded from a file on-disk, but may also be procedurally generated using noise algorithms.
A resource database accounts for this by: