MeshLib Documentation
Loading...
Searching...
No Matches
MRImGuiImage.h
Go to the documentation of this file.
1
#pragma once
2
#include "exports.h"
3
#include <
MRMesh/MRMeshFwd.h
>
4
#include <
MRMesh/MRMeshTexture.h
>
5
#include "
MRRenderGLHelpers.h
"
6
7
namespace
MR
8
{
9
10
// Simple ImGui Image
11
// create GL texture in constructor, free it in destructor
12
// cant be moved(for now) or copied(forever)
13
class
MRVIEWER_CLASS
ImGuiImage
14
{
15
public
:
16
MRVIEWER_API
ImGuiImage
();
17
MRVIEWER_API
virtual
~ImGuiImage
();
18
19
// Sets image to texture
20
MRVIEWER_API
void
update
(
const
MeshTexture
& texture );
21
22
// Returns void* for ImGui::Image( getImTextureId(), ... )
23
void
*
getImTextureId
()
const
{
return
(
void
*) (intptr_t) glTex_.getId(); }
24
25
// Returns gl texture id
26
unsigned
getId
()
const
{
return
glTex_.getId(); }
27
28
// Returns current MeshTexture
29
const
MeshTexture
&
getMeshTexture
()
const
{
return
texture_; }
30
31
int
getImageWidth
()
const
{
return
texture_.resolution.x; }
32
int
getImageHeight
()
const
{
return
texture_.resolution.y; }
33
34
private
:
35
GlTexture2
glTex_;
36
MeshTexture
texture_;
37
38
void
bind_();
39
};
40
41
}
//namespace MR
MRMeshTexture.h
MRMeshFwd.h
MRRenderGLHelpers.h
MR::GlTexture2
Definition
MRRenderGLHelpers.h:65
MR::ImGuiImage
Definition
MRImGuiImage.h:14
MR::ImGuiImage::getImageWidth
int getImageWidth() const
Definition
MRImGuiImage.h:31
MR::ImGuiImage::~ImGuiImage
virtual MRVIEWER_API ~ImGuiImage()
MR::ImGuiImage::ImGuiImage
MRVIEWER_API ImGuiImage()
MR::ImGuiImage::getImTextureId
void * getImTextureId() const
Definition
MRImGuiImage.h:23
MR::ImGuiImage::update
MRVIEWER_API void update(const MeshTexture &texture)
MR::ImGuiImage::getImageHeight
int getImageHeight() const
Definition
MRImGuiImage.h:32
MR::ImGuiImage::getMeshTexture
const MeshTexture & getMeshTexture() const
Definition
MRImGuiImage.h:29
MR::ImGuiImage::getId
unsigned getId() const
Definition
MRImGuiImage.h:26
MR
Definition
MRCameraOrientationPlugin.h:8
MR::MeshTexture
Definition
MRMeshTexture.h:13
MeshLib
source
MRViewer
MRImGuiImage.h
Generated by
1.11.0