-
Notifications
You must be signed in to change notification settings - Fork 2
ResourceManager
This class contains and keeps track of all resources (objects, textures, shaders, etc). You can get the game's resource manager with getResourcemanager().
Class ResourceManager
- addShader
- addNamedShader
- findShader
- clearShaders
- addTexture
- addNamedTexture
- findTexture
- clearTextures
- addObjectGeometryGroup
- addNamedObjectGeometryGroup
- addCustomObjectGeometryGroup
- findObjectGeometryGroup
- clearObjectGeometryGroups
- addSound
- addNamedSound
- findSound
- clearSounds
Shader& addShader(string vertexShaderFile, string fragmentShaderFile)
Add (and process) a Shader program. The files are in the shaders directory. The name shader name is automatically generated from the file names. Returns the newly create shader.
Shader& addNamedShader(string name, string vertexShaderFile, string fragmentShaderFile)
Add a Shader, but specify the name to find them later. Same as addShader(). Returns the newly created shader.
Shader& findShader(string shaderName)
Find the shader by name.
Clear all Shaders from memory.
Texture& addTexture(string textureFile, TextureType type)
Add a Shader and store it on the GPU. See TextureType for information on types. Generates name from file name. Returns the newly create texture.
Texture& addNamedTexture(string textureName, string textureFile)
Same as addTexture(), but with a name instead of an automatically generated one. Returns the newly created texture.
Texture& findTexture(string textureName)
Find the texture by name.
Clear all Textures, great for freeing vram!
ObjectGeometryGroup& addObjectGeometryGroup(string objectFile)
Add an ObjectGeometryGroup and store it on the GPU. This would be a .obj file containing one or more objects. Generates a name from the file name. Returns the newly create object geometry group. Objects in the object file that have the same name will be modified to have unique names.
ObjectGeometryGroup& addNamedObjectGeometryGroup(string objectGeometryGroupName, string objectFile)
Add an ObjectGeometryGroup and specify a name instead of automatically generating one from the file name. Returns the newly create object geometry group.
ObjectGeometryGroup& addCustomObjectGeometryGroup(ObjectGeometryGroup& customGroupToTrack)
Add an ObjectGeometryGroup that was created from Lua. The only use to this function is to let the resource manager track the object geometry group for us so we can get it back using findObjectGeometryGroup.
ObjectGeometryGroup& findObjectGeometryGroup(string shaderName)
Find the ObjectGeometryGroup by name.
Clear all ObjectGeometryGroups from memory.
Add a new Sound. See SoundType for more information on each type. The sound's name is generated from the file name.
Add a new Sound with the specified name.
Sound& findSound(string soundName)
Find the Sound by name.
Clear the Sounds from memory.
- Understanding the Lua API reference
- Tutorial
- Units
- Notes
- Lua API reference
- Callbacks
- Global
- Game
- Engine
- ResourceManager
- Shader
- Texture
- TextureType
- ObjectGeometryGroup
- ObjectGeometry
- Sound
- SoundType
- GPUBuffer_uint
- GPUBuffer_vec2
- GPUBuffer_vec3
- InputManager
- KeyCode
- EntityManager
- Entity
- PhysicsBody
- PhysicsBodyType
- Camera
- Object
- TexturedObject
- ShadedObject
- Light
- GraphicsManager
- Utils
- IVec2
- Vec2
- Vec3
- Vec4