TGUI
=
=
Download
Tutorials
1.x
0.9
0.8
Documentation
1.x
0.9
0.8
Examples
1.x
0.9
0.8
Community
TGUI
1.14-dev
Toggle main menu visibility
Loading...
Searching...
No Matches
include
TGUI
Backend
Renderer
Vulkan
BackendTextureVulkan.hpp
1
2
//
3
// TGUI - Texus' Graphical User Interface
4
// Copyright (C) 2012-2026 Bruno Van de Velde (vdv_b@tgui.eu)
5
//
6
// This software is provided 'as-is', without any express or implied warranty.
7
// In no event will the authors be held liable for any damages arising from the use of this software.
8
//
9
// Permission is granted to anyone to use this software for any purpose,
10
// including commercial applications, and to alter it and redistribute it freely,
11
// subject to the following restrictions:
12
//
13
// 1. The origin of this software must not be misrepresented;
14
// you must not claim that you wrote the original software.
15
// If you use this software in a product, an acknowledgment
16
// in the product documentation would be appreciated but is not required.
17
//
18
// 2. Altered source versions must be plainly marked as such,
19
// and must not be misrepresented as being the original software.
20
//
21
// 3. This notice may not be removed or altered from any source distribution.
22
//
24
25
#ifndef TGUI_BACKEND_TEXTURE_VULKAN_HPP
26
#define TGUI_BACKEND_TEXTURE_VULKAN_HPP
27
28
#include <TGUI/Backend/Renderer/BackendTexture.hpp>
29
30
#include <vulkan/vulkan.h>
31
33
34
namespace
tgui
35
{
36
class
BackendRendererVulkan
;
37
46
class
TGUI_API
BackendTextureVulkan
:
public
BackendTexture
47
{
48
public
:
56
struct
ImageResources
57
{
58
ImageResources(std::shared_ptr<BackendRendererVulkan> renderer);
59
~ImageResources();
60
61
ImageResources(
const
ImageResources&) =
delete
;
62
ImageResources& operator=(
const
ImageResources&) =
delete
;
63
64
std::shared_ptr<BackendRendererVulkan> renderer;
65
VkImage image = VK_NULL_HANDLE;
66
VkDeviceMemory memory = VK_NULL_HANDLE;
67
VkImageView imageView = VK_NULL_HANDLE;
68
VkDescriptorSet descriptorSet = VK_NULL_HANDLE;
69
VkDescriptorPool descriptorPool = VK_NULL_HANDLE;
70
std::uint64_t uploadId = 0;
// Last upload to the image, the destructor waits for it to finish
71
};
72
80
BackendTextureVulkan
(std::shared_ptr<BackendRendererVulkan> renderer, VkImageUsageFlags additionalUsageFlags = 0);
81
91
bool
loadTextureOnly
(Vector2u size,
const
std::uint8_t* pixels,
bool
smooth)
override
;
92
100
[[nodiscard]] VkImage
getInternalImage
()
const
;
101
107
[[nodiscard]] VkImageView
getInternalImageView
()
const
;
108
113
[[nodiscard]]
const
std::shared_ptr<ImageResources>& getImageResources()
const
114
{
115
return
m_imageResources;
116
}
117
119
120
protected
:
122
// Creates the image, its memory, the image view and the descriptor set
124
[[nodiscard]] std::shared_ptr<ImageResources> createImageResources(Vector2u size)
const
;
125
127
128
protected
:
129
std::shared_ptr<BackendRendererVulkan> m_renderer;
130
VkImageUsageFlags m_usageFlags;
131
std::shared_ptr<ImageResources> m_imageResources;
132
};
133
}
// namespace tgui
134
135
#endif
// TGUI_BACKEND_TEXTURE_VULKAN_HPP
tgui::BackendRendererVulkan
Backend renderer that uses Vulkan.
Definition
BackendRendererVulkan.hpp:72
tgui::BackendTextureVulkan::loadTextureOnly
bool loadTextureOnly(Vector2u size, const std::uint8_t *pixels, bool smooth) override
Loads the texture from an array of 32-bits RGBA pixels, but don't take ownership of the pixels.
tgui::BackendTextureVulkan::getInternalImageView
VkImageView getInternalImageView() const
Returns the view of the internal image.
tgui::BackendTextureVulkan::getInternalImage
VkImage getInternalImage() const
Returns the internal image.
tgui::BackendTextureVulkan::BackendTextureVulkan
BackendTextureVulkan(std::shared_ptr< BackendRendererVulkan > renderer, VkImageUsageFlags additionalUsageFlags=0)
Constructor.
tgui
Namespace that contains all TGUI functions and classes.
Definition
AbsoluteOrRelativeValue.hpp:37
Generated on
for TGUI by
1.18.0