4#include <foundation/Common.h>
7#include "ActionRegistry.h"
17 enum class RaycastMethod : uint8
46 std::recursive_mutex m_SurfaceLocker;
70 std::atomic<bool> m_ShouldRedraw =
false;
76 std::atomic<bool> m_ShouldExit =
false;
88 Callback m_RenderCallback;
94 RaycastMethod m_RaycastMethod = RaycastMethod::Weighted;
107 void setActiveComponent(
Component *component);
119 Component *findLinearComponentRaycast(
const Int2 &direction);
125 static void surfaceThread(Surface *surface);
134 Surface(
const ComponentCallback &callback,
const Callback &renderCallback);
165 void Clear()
override;
Represent registry of Action objects.
Definition ActionRegistry.h:74
Represents a renderable identified object.
Definition Component.h:23
ComponentRegistry doesn't take over ownership of components.
Definition Component.h:135
Represents a set of pixels in array with size of terminal.
Definition Terminal.h:86
void RegisterComponent(const String &name, Component *component) override
Registers given component to given unique name.
Definition Surface.cpp:334
void UnregisterComponent(const String &name) override
Definition Surface.cpp:344
void Draw()
Sets m_ShouldRedraw to true.
Definition Surface.cpp:294
void OnComponentDestroy(Component *component)
Safely deletes given component.
Definition Surface.cpp:62
void UnlockForWrite()
Unlocks a surface rendering locker.
Definition Surface.cpp:285
void FinalizeThread()
Sets m_ShouldExit to true and waits until thread is finalized.
Definition Surface.cpp:60
void LockForWrite()
Locks a surface rendering locker.
Definition Surface.cpp:283
void SetTitle(const WideString &title)
Sets a title of window to render.
Definition Surface.cpp:287
void Clear() override
Deletes all components from list. It does not destroy objects.
Definition Surface.cpp:82
void HandleMouse(MouseButton button, const Int2 &position)
Handles given mouse action and passes it to ActionRegistry.
Definition Surface.cpp:262
void HandleKey(const int32 &key)
Handles given key and passes it to ActionRegistry.
Definition Surface.cpp:224
void SetRaycastMethod(RaycastMethod method)
Sets the raycast method.
Definition Surface.cpp:352
Represents a mutable sequence of characters, providing various member functions for string manipulati...
Definition String.h:16
Represents a mutable sequence of utf-16 characters, providing various member functions for string man...
Definition WideString.h:14
Represents a major terminal informations.
Definition Terminal.h:213
Represents a two component vector. Components are 32-bit and they are signed.
Definition Int2.h:11