Lugdunum
0.1.0
include
lug
Graphics
Builder
Texture.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <vector>
5
6
#include <
lug/Graphics/Resource.hpp
>
7
#include <
lug/Graphics/Render/Texture.hpp
>
8
#include <
lug/Graphics/Vulkan/Builder/Texture.hpp
>
9
10
namespace
lug
{
11
namespace
Graphics {
12
13
class
Renderer;
14
15
namespace
Builder {
16
17
class
LUG_GRAPHICS_API
Texture
{
18
friend
Resource::SharedPtr<lug::Graphics::Render::Texture>
lug::Graphics::Vulkan::Builder::Texture::build
(const ::lug::Graphics::Builder::Texture&);
19
20
struct
Layer
{
21
const
unsigned
char
* data{
nullptr
};
22
};
23
24
public
:
25
enum class
Type
{
26
Texture2D,
27
CubeMap
28
};
29
30
public
:
31
explicit
Texture
(
Renderer
& renderer);
32
33
Texture
(
const
Texture
&) =
delete
;
34
Texture
(
Texture
&&) =
delete
;
35
36
Texture
& operator=(
const
Texture
&) =
delete
;
37
Texture
& operator=(
Texture
&&) =
delete
;
38
39
~
Texture
();
40
45
void
setName(
const
std::string& name);
46
47
void
setType(
Type
type);
48
49
void
setMipLevels(uint32_t mipLevels);
50
51
void
setMagFilter(
Render::Texture::Filter
magFilter);
52
void
setMinFilter(
Render::Texture::Filter
minFilter);
53
void
setMipMapFilter(
Render::Texture::Filter
mipMapFilter);
54
void
setWrapS(
Render::Texture::WrappingMode
wrapS);
55
void
setWrapT(
Render::Texture::WrappingMode
wrapT);
56
void
setWrapW(
Render::Texture::WrappingMode
wrapW);
57
58
bool
addLayer(
const
std::string& filename,
bool
hdr =
false
);
59
bool
addLayer(uint32_t width, uint32_t height,
Render::Texture::Format
format,
const
unsigned
char
* data =
nullptr
);
60
61
Resource::SharedPtr<Render::Texture>
build
();
62
63
protected
:
64
Renderer
&
_renderer
;
65
66
std::string
_name
;
67
68
Type
_type{Type::Texture2D};
69
70
uint32_t _width{0};
71
uint32_t _height{0};
72
Render::Texture::Format
_format{
Render::Texture::Format::Undefined
};
73
74
uint32_t _mipLevels{1};
75
76
Render::Texture::Filter
_magFilter{
Render::Texture::Filter::Nearest
};
77
Render::Texture::Filter
_minFilter{
Render::Texture::Filter::Nearest
};
78
Render::Texture::Filter
_mipMapFilter{
Render::Texture::Filter::Nearest
};
79
80
Render::Texture::WrappingMode
_wrapS{
Render::Texture::WrappingMode::ClampToEdge
};
81
Render::Texture::WrappingMode
_wrapT{
Render::Texture::WrappingMode::ClampToEdge
};
82
Render::Texture::WrappingMode
_wrapW{
Render::Texture::WrappingMode::ClampToEdge
};
83
84
std::vector<Layer>
_layers
;
85
};
86
87
#include <
lug/Graphics/Builder/Texture.inl
>
88
89
}
// Builder
90
}
// Graphics
91
}
// lug
lug::Graphics::Builder::Texture::_renderer
Renderer & _renderer
Definition:
Texture.hpp:64
lug::Graphics::Render::Texture::Filter::Nearest
LUG_GRAPHICS_API
#define LUG_GRAPHICS_API
Definition:
Export.hpp:11
lug::Graphics::Builder::Texture::_name
std::string _name
Definition:
Texture.hpp:66
lug::Graphics::Vulkan::Builder::Texture::build
Resource::SharedPtr< lug::Graphics::Render::Texture > build(const ::lug::Graphics::Builder::Texture &builder)
Definition:
Texture.cpp:17
lug::Graphics::Resource::SharedPtr< lug::Graphics::Render::Texture >
lug::Graphics::Builder::Texture
Definition:
Texture.hpp:17
Resource.hpp
lug::Graphics::Render::Texture::Filter
Filter
Definition:
Texture.hpp:20
lug::Graphics::Render::Texture::WrappingMode
WrappingMode
Definition:
Texture.hpp:25
Texture.inl
lug::Graphics::Builder::Texture::Layer
Definition:
Texture.hpp:20
lug::Graphics::Renderer
Definition:
Renderer.hpp:18
Texture.hpp
lug
Definition:
Application.hpp:11
lug::Graphics::Render::Texture::WrappingMode::ClampToEdge
lug::Graphics::Render::Texture::Format
Format
Definition:
Texture.hpp:31
Texture.hpp
lug::Graphics::Builder::Texture::Type
Type
Definition:
Texture.hpp:25
lug::Graphics::Render::Texture::Format::Undefined
lug::Graphics::Builder::Texture::_layers
std::vector< Layer > _layers
Definition:
Texture.hpp:84
Generated by
1.8.13