Radium Engine  1.5.20
Loading...
Searching...
No Matches
TextureManager.hpp
1#pragma once
2
3#include <Engine/RaEngine.hpp>
4#include <map>
5#include <string>
6
7#include <Engine/Data/Texture.hpp>
8#include <Engine/OpenGL.hpp>
9namespace Ra {
10namespace Engine {
11namespace Data {
12
19class RA_ENGINE_API TextureManager final
20{
21
22 private:
23 public:
24 using TextureHandle = Ra::Core::Utils::Index;
25
30 TextureHandle addTexture( const TextureParameters& p );
31
36 Texture* getTexture( const TextureHandle& handle );
37
43 TextureHandle getTextureHandle( const std::string& name );
44
46 Texture* getTexture( const std::string& name ) {
47 return getTexture( getTextureHandle( name ) );
48 }
49
54 void deleteTexture( const TextureHandle& handle );
55
64 static ImageParameters loadTextureImage( const std::string& filename, bool linearize = false );
65
66 public:
69 TextureManager( TextureManager const& ) = delete;
70 TextureManager( TextureManager&& ) = delete;
71 TextureManager& operator=( TextureManager const& ) = delete;
72 TextureManager& operator=( TextureManager&& ) = delete;
73
74 private:
76};
77
78} // namespace Data
79} // namespace Engine
80} // namespace Ra
Manage Texture loading and registration.
Texture * getTexture(const std::string &name)
Convinience function to obtain Texture ptr from name.
Represent a Texture of the engine.
Definition Texture.hpp:120
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3
Describes the sampler and image of a texture.
Definition Texture.hpp:99