Nebula
Loading...
Searching...
No Matches
rmluicontext.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
16//------------------------------------------------------------------------------
18#include "input/inputevent.h"
19#include "util/string.h"
20
21namespace Rml
22{
23class Context;
24class ElementDocument;
25}
26
27namespace RmlUi
28{
29
31{
33
34public:
38 virtual ~RmlUiContext();
39
41 static void Create();
43 static void Discard();
45 static void FrameUpdate(const Graphics::FrameContext& ctx);
46
48 static bool LoadFontFace(const Util::String& path, bool fallback = false);
50 static Rml::ElementDocument* LoadDocument(const Util::String& path);
52 static void CloseDocument(Rml::ElementDocument* document);
54 static bool IsActive();
56 static Rml::Context* GetContext();
57
59 static void SetDebuggerVisible(bool visible);
61 static bool IsDebuggerVisible();
62
64 static bool ProcessInput(const Input::InputEvent& inputEvent);
65
66private:
68 static void Render(const CoreGraphics::CmdBufferId cmdBuf, const Math::rectangle<int>& viewport, const IndexT frame, const IndexT bufferIndex);
70 static void Present(const CoreGraphics::CmdBufferId cmdBuf, const Math::rectangle<int>& viewport);
72 static void OnViewportResized(const uint framescriptHash, SizeT width, SizeT height);
73};
74
75} // namespace RmlUi
Definition graphicscontext.h:175
The input events of the Input subsystems.
Definition inputevent.h:25
A 2d rectangle class.
Definition rectangle.h:20
static void Discard()
discard context, shuts RmlUi down
Definition rmluicontext.cc:206
static Rml::Context * GetContext()
get the RmlUi context, for data models, events and direct element access
Definition rmluicontext.cc:291
static void CloseDocument(Rml::ElementDocument *document)
close a document, does nothing once the context is discarded (RmlUi has destroyed all documents then)
Definition rmluicontext.cc:271
static bool IsDebuggerVisible()
check if the debugger is visible
Definition rmluicontext.cc:321
static void Create()
create context, initializes RmlUi
Definition rmluicontext.cc:162
static void SetDebuggerVisible(bool visible)
show or hide the RmlUi visual debugger
Definition rmluicontext.cc:301
static bool LoadFontFace(const Util::String &path, bool fallback=false)
load a font face (ttf, otf...), fallback faces are used for glyphs missing from other faces
Definition rmluicontext.cc:246
static void OnViewportResized(const uint framescriptHash, SizeT width, SizeT height)
called if the window size has changed
Definition rmluicontext.cc:444
static void FrameUpdate(const Graphics::FrameContext &ctx)
update the RmlUi context, call before logic each frame
Definition rmluicontext.cc:235
static Rml::ElementDocument * LoadDocument(const Util::String &path)
load a document (rml) into the context, it is hidden until Show() is called on it
Definition rmluicontext.cc:256
static void Render(const CoreGraphics::CmdBufferId cmdBuf, const Math::rectangle< int > &viewport, const IndexT frame, const IndexT bufferIndex)
render the UI into its offscreen targets, outside of any pass
Definition rmluicontext.cc:414
static bool IsActive()
check if RmlUi is running, it is shut down before features attached after GraphicsFeatureUnit deactiv...
Definition rmluicontext.cc:282
RmlUiContext()
constructor
static bool ProcessInput(const Input::InputEvent &inputEvent)
forward an input event, returns true if the UI consumed it
Definition rmluicontext.cc:332
static void Present(const CoreGraphics::CmdBufferId cmdBuf, const Math::rectangle< int > &viewport)
composite the UI onto the color buffer
Definition rmluicontext.cc:433
Nebula's universal string class.
Definition string.h:50
Definition rmluicontext.h:22
Definition rmluifileinterface.cc:11
Definition commandbuffer.h:176
Definition graphicsserver.h:63
int SizeT
Definition types.h:50
unsigned int uint
Definition types.h:41
int IndexT
Definition types.h:49