NAP
nap
system_modules
napimgui
src
imguiicon.h
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5
#pragma once
6
7
// Local Includes
8
#include "imgui/imgui.h"
9
10
// External Includes
11
#include <rtti/rtti.h>
12
#include <nap/resource.h>
13
#include <texture.h>
14
15
namespace
nap
16
{
17
// Forward Declares
18
class
Core;
19
class
IMGuiService;
20
24
class
NAPAPI
Icon
:
public
Resource
25
{
26
RTTI_ENABLE(
Resource
)
27
public
:
32
Icon
(
nap::IMGuiService
& guiService);
33
39
Icon
(
nap::IMGuiService
& guiService,
const
std::string& imagePath);
40
47
virtual
bool
init(
utility::ErrorState
& error);
48
52
const
std::string&
getPath
()
const
{
return
mImagePath; }
53
57
const
std::string&
getName
()
const
{
return
mName; }
58
62
const
nap::Texture2D
&
getTexture
()
const
{
return
mTexture; }
63
67
IMGuiService
&
getGuiService
() {
return
mGuiService; }
68
73
ImTextureID getTextureHandle()
const
;
74
75
bool
mInvert =
false
;
76
std::string
mImagePath
;
77
78
private
:
79
Texture2D
mTexture;
80
IMGuiService
& mGuiService;
//< GUI Service
81
std::string mName;
//< Icon name, without extension
82
};
83
84
using
IconObjectCreator
=
rtti::ObjectCreator<Icon, IMGuiService>
;
85
}
nap::Icon::getTexture
const nap::Texture2D & getTexture() const
Definition:
imguiicon.h:62
nap::Icon::mImagePath
std::string mImagePath
Property: 'ImagePath' path to the image on disk.
Definition:
imguiicon.h:76
nap::rtti::ObjectCreator
Definition:
factory.h:49
nap::utility::ErrorState
Definition:
errorstate.h:19
nap::Icon
Definition:
imguiicon.h:24
nap::Texture2D
Definition:
texture.h:128
nap::Icon::getGuiService
IMGuiService & getGuiService()
Definition:
imguiicon.h:67
nap::Icon::getName
const std::string & getName() const
Definition:
imguiicon.h:57
nap::Icon::getPath
const std::string & getPath() const
Definition:
imguiicon.h:52
nap::IMGuiService
Definition:
imguiservice.h:165
nap
Definition:
templateapp.h:17
nap::Resource
Definition:
resource.h:19
Generated by doxygen