Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
OgreImGuiOverlay.h
Go to the documentation of this file.
1// This file is part of the OGRE project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at https://www.ogre3d.org/licensing.
4
5#pragma once
6
7#include <OgreOverlay.h>
8
9#include <imgui.h>
10
11namespace Ogre
12{
13class ImGuiOverlay : public Overlay
14{
15public:
18
21 ImFont* addFont(const String& name, const String& group OGRE_RESOURCE_GROUP_INIT);
22
23 static void NewFrame(const FrameEvent& evt);
24
25 void _findVisibleObjects(Camera* cam, RenderQueue* queue, Viewport* vp);
26
27 void initialise(); // RIGSOFRODS: Private and non-virtual in OGRE... how does it even work?
28
29private:
30
31 typedef std::vector<ImWchar> CodePointRange;
32 std::vector<CodePointRange> mCodePointRanges;
33
34 class ImGUIRenderable : public Ogre::Renderable
35 {
36 public:
39
40 void initialise();
41
42 void updateVertexData(const ImVector<ImDrawVert>& vtxBuf, const ImVector<ImDrawIdx>& idxBuf);
43
44 bool preRender(SceneManager* sm, RenderSystem* rsys);
45
46 virtual void getWorldTransforms(Matrix4* xform) const { *xform = mXform; }
47 virtual void getRenderOperation(RenderOperation& op) { op = mRenderOp; }
48
49 const LightList& getLights(void) const;
50
51 void createMaterial();
52 void createFontTexture();
53
54 const MaterialPtr& getMaterial() const { return mMaterial; }
55
56 Real getSquaredViewDepth(const Camera*) const { return 0; }
57
58 void _update();
59
61
62 Matrix4 mXform;
63 RenderOperation mRenderOp;
64 TexturePtr mFontTex;
65 MaterialPtr mMaterial;
66 };
67
69};
70} // namespace Ogre
71
Real getSquaredViewDepth(const Camera *) const
const LightList & getLights(void) const
virtual void getWorldTransforms(Matrix4 *xform) const
void updateVertexData(const ImVector< ImDrawVert > &vtxBuf, const ImVector< ImDrawIdx > &idxBuf)
const MaterialPtr & getMaterial() const
bool preRender(SceneManager *sm, RenderSystem *rsys)
virtual void getRenderOperation(RenderOperation &op)
ImGUIRenderable mRenderable
void _findVisibleObjects(Camera *cam, RenderQueue *queue, Viewport *vp)
ImFont * addFont(const String &name, const String &group OGRE_RESOURCE_GROUP_INIT)
add font from ogre .fontdef file must be called before first show()
static void NewFrame(const FrameEvent &evt)
std::vector< CodePointRange > mCodePointRanges
std::vector< ImWchar > CodePointRange