Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
textureManager.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2024 Rahul Satish Vadhyar
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22
23#pragma once
30#include <map>
31#include "texture.hpp"
32namespace Chronos {
33namespace Engine {
34
42 public:
47 std::map<int, Chronos::Engine::Texture> textures;
49
57 void init(Chronos::Engine::Device* device, VkCommandPool commandPool);
58
66 int addTexture(std::string texturePath, std::string textureName);
67
73 void removeTexture(int textureNo);
74
84
88 void destroy();
89
90 private:
92 VkCommandPool commandPool;
93 };
94
95};
96};
This initializes, manages and destroys the logical and physical devices(GPU).
Definition device.hpp:47
This is the texture manager for Chronos. It handles creation, modification, updating and desrtuction ...
void destroy()
Destroys the texture manager.
void init(Chronos::Engine::Device *device, VkCommandPool commandPool)
Initializes the texture manager.
Chronos::Engine::Texture getTexture(int textureNo)
Gets the texture from the texture manager.
int addTexture(std::string texturePath, std::string textureName)
Adds a texture to the texture manager.
void removeTexture(int textureNo)
Removes a texture from the texture manager.
std::map< int, Chronos::Engine::Texture > textures
The textures that are managed by this class. They are mapped via texture nos.
Chronos::Engine::Device * device
This class holds the Vulkan data and objects needed for a texture.
Definition texture.hpp:134
Contains the functions for image manipulation along with the Texture class.