Nebula
Loading...
Searching...
No Matches
RmlUi::RmlUiContext Class Reference

#include <rmluicontext.h>

Detailed Description

Graphics context plugin for RmlUi (https://github.com/mikke89/RmlUi), an HTML/CSS style UI library and the successor of libRocket.

Owns the RmlUi core, a single Rml::Context the size of the main window, renders it in the StaticUI subgraph of the default frame script and composites the result in StaticUI To Backbuffer.

Inherits Graphics::GraphicsContext.

Public Member Functions

 RmlUiContext ()
 constructor
virtual ~RmlUiContext ()
 destructor
Public Member Functions inherited from Graphics::GraphicsContext
 GraphicsContext ()
 constructor
virtual ~GraphicsContext ()
 destructor

Static Public Member Functions

static void Create ()
 create context, initializes RmlUi
static void Discard ()
 discard context, shuts RmlUi down
static void FrameUpdate (const Graphics::FrameContext &ctx)
 update the RmlUi context, call before logic each frame
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
static Rml::ElementDocument * LoadDocument (const Util::String &path)
 load a document (rml) into the context, it is hidden until Show() is called on it
static void CloseDocument (Rml::ElementDocument *document)
 close a document, does nothing once the context is discarded (RmlUi has destroyed all documents then)
static bool IsActive ()
 check if RmlUi is running, it is shut down before features attached after GraphicsFeatureUnit deactivate
static Rml::Context * GetContext ()
 get the RmlUi context, for data models, events and direct element access
static void SetDebuggerVisible (bool visible)
 show or hide the RmlUi visual debugger
static bool IsDebuggerVisible ()
 check if the debugger is visible
static bool ProcessInput (const Input::InputEvent &inputEvent)
 forward an input event, returns true if the UI consumed it

Private Member Functions

 __DeclarePluginContext ()

Static Private Member Functions

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
static void Present (const CoreGraphics::CmdBufferId cmdBuf, const Math::rectangle< int > &viewport)
 composite the UI onto the color buffer
static void OnViewportResized (const uint framescriptHash, SizeT width, SizeT height)
 called if the window size has changed

Additional Inherited Members

Static Protected Member Functions inherited from Graphics::GraphicsContext
static void InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
static void InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
template<class ID_ALLOCATOR>
static void InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state)

Constructor & Destructor Documentation

◆ RmlUiContext()

RmlUi::RmlUiContext::RmlUiContext ( )

constructor

◆ ~RmlUiContext()

RmlUi::RmlUiContext::~RmlUiContext ( )
virtual

destructor

Member Function Documentation

◆ __DeclarePluginContext()

RmlUi::RmlUiContext::__DeclarePluginContext ( )
private

◆ CloseDocument()

void RmlUi::RmlUiContext::CloseDocument ( Rml::ElementDocument * document)
static

close a document, does nothing once the context is discarded (RmlUi has destroyed all documents then)

◆ Create()

void RmlUi::RmlUiContext::Create ( )
static

create context, initializes RmlUi

◆ Discard()

void RmlUi::RmlUiContext::Discard ( )
static

discard context, shuts RmlUi down

◆ FrameUpdate()

void RmlUi::RmlUiContext::FrameUpdate ( const Graphics::FrameContext & ctx)
static

update the RmlUi context, call before logic each frame

◆ GetContext()

Rml::Context * RmlUi::RmlUiContext::GetContext ( )
static

get the RmlUi context, for data models, events and direct element access

◆ IsActive()

bool RmlUi::RmlUiContext::IsActive ( )
static

check if RmlUi is running, it is shut down before features attached after GraphicsFeatureUnit deactivate

◆ IsDebuggerVisible()

bool RmlUi::RmlUiContext::IsDebuggerVisible ( )
static

check if the debugger is visible

◆ LoadDocument()

Rml::ElementDocument * RmlUi::RmlUiContext::LoadDocument ( const Util::String & path)
static

load a document (rml) into the context, it is hidden until Show() is called on it

◆ LoadFontFace()

bool RmlUi::RmlUiContext::LoadFontFace ( const Util::String & path,
bool fallback = false )
static

load a font face (ttf, otf...), fallback faces are used for glyphs missing from other faces

◆ OnViewportResized()

void RmlUi::RmlUiContext::OnViewportResized ( const uint framescriptHash,
SizeT width,
SizeT height )
staticprivate

called if the window size has changed

◆ Present()

void RmlUi::RmlUiContext::Present ( const CoreGraphics::CmdBufferId cmdBuf,
const Math::rectangle< int > & viewport )
staticprivate

composite the UI onto the color buffer

◆ ProcessInput()

bool RmlUi::RmlUiContext::ProcessInput ( const Input::InputEvent & inputEvent)
static

forward an input event, returns true if the UI consumed it

RmlUi's Process* calls return true when the event was NOT consumed.

◆ Render()

void RmlUi::RmlUiContext::Render ( const CoreGraphics::CmdBufferId cmdBuf,
const Math::rectangle< int > & viewport,
const IndexT frame,
const IndexT bufferIndex )
staticprivate

render the UI into its offscreen targets, outside of any pass

◆ SetDebuggerVisible()

void RmlUi::RmlUiContext::SetDebuggerVisible ( bool visible)
static

show or hide the RmlUi visual debugger


The documentation for this class was generated from the following files: