vsgImGui: include/vsgImGui/Texture.h Source File

vsgImGui 0.5.0 VulkanSceneGraph, ImGui and ImPlot integration library

Loading...
Searching...
No Matches
Texture.h
1/* <editor-fold desc="MIT License">
2
3Copyright(c) 2023 Timothy Moore
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
22
23</editor-fold> */
24
25#pragma once
26
27#include <vsg/nodes/Compilable.h>
28#include <vsg/state/Sampler.h>
29
30#include <vsgImGui/RenderImGui.h>
31
32namespace vsgImGui
33{
35 class VSGIMGUI_DECLSPEC Texture : public vsg::Inherit<vsg::Compilable, Texture>
36 {
37 public:
38 Texture(vsg::ref_ptr<vsg::Data> data = {}, vsg::ref_ptr<vsg::Sampler> sampler = {});
39
40 void compile(vsg::Context& context) override;
41
43 ImTextureID id(uint32_t deviceID) const;
44
45 vsg::ref_ptr<vsg::DescriptorSet> descriptorSet;
46 uint32_t height = 0;
47 uint32_t width = 0;
48
49 protected:
50 virtual ~Texture();
51 };
52} // namespace vsgImGui
vsgImGui::Texture
Texture adapter that uses a DescriptorSet/DescriptorImage to hold a texture image on the GPU in a for...
Definition Texture.h:36
vsgImGui::Texture::id
ImTextureID id(uint32_t deviceID) const
get the ImTextureID used with ImGui::Image(..) calls