PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
ui_frame_owner.h
1#pragma once
2
3#include "pixelbullet/application/layer.h"
5
6namespace pixelbullet::application_internal
7{
8inline void RegisterUiFrameLayer(UiFrameLayer*& owner, Layer& layer)
9{
10 auto* candidate = dynamic_cast<UiFrameLayer*>(&layer);
11 if (!candidate)
12 {
13 return;
14 }
15
16 DEBUG_ASSERT(owner == nullptr || owner == candidate, "Only one UiFrameLayer may be registered per application");
17 if (owner == nullptr)
18 {
19 owner = candidate;
20 }
21}
22} // namespace pixelbullet::application_internal
Provides assertion and panic mechanisms with optional custom formatting.
#define DEBUG_ASSERT(condition,...)
Debug-only assertion.
Definition assert.h:183