MeshLib C++ Docs
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>
5#include "MRRenderGLHelpers.h"
6#include "MRViewer/MRImGui.h"
7
8namespace MR
9{
12
13
17class MRVIEWER_CLASS ImGuiImage
18{
19public:
20 MRVIEWER_API ImGuiImage();
21 MRVIEWER_API virtual ~ImGuiImage();
22
24 MRVIEWER_API void update( const MeshTexture& texture );
25
28 ImTextureID getImTextureId() const { return (ImTextureID) (intptr_t) glTex_.getId(); }
29
31 unsigned getId() const { return glTex_.getId(); }
32
34 const MeshTexture& getMeshTexture() const { return texture_; }
35
36 int getImageWidth() const { return texture_.resolution.x; }
37 int getImageHeight() const { return texture_.resolution.y; }
38
39private:
40 GlTexture2 glTex_;
41 MeshTexture texture_;
42
43 void bind_();
44};
45
46}
represents OpenGL 2D texture owner, and allows uploading data in it remembering texture size
Definition MRRenderGLHelpers.h:68
Definition MRImGuiImage.h:18
int getImageWidth() const
Definition MRImGuiImage.h:36
virtual MRVIEWER_API ~ImGuiImage()
MRVIEWER_API ImGuiImage()
ImTextureID getImTextureId() const
Definition MRImGuiImage.h:28
MRVIEWER_API void update(const MeshTexture &texture)
Sets image to texture.
int getImageHeight() const
Definition MRImGuiImage.h:37
const MeshTexture & getMeshTexture() const
Returns current MeshTexture.
Definition MRImGuiImage.h:34
unsigned getId() const
Returns gl texture id.
Definition MRImGuiImage.h:31
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshTexture.h:13