Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUI.cpp
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | void CGUI::Initialize() | ||||
AddObjectType("list", &CList::ConstructObject); | AddObjectType("list", &CList::ConstructObject); | ||||
AddObjectType("olist", &COList::ConstructObject); | AddObjectType("olist", &COList::ConstructObject); | ||||
AddObjectType("dropdown", &CDropDown::ConstructObject); | AddObjectType("dropdown", &CDropDown::ConstructObject); | ||||
AddObjectType("tooltip", &CTooltip::ConstructObject); | AddObjectType("tooltip", &CTooltip::ConstructObject); | ||||
AddObjectType("chart", &CChart::ConstructObject); | AddObjectType("chart", &CChart::ConstructObject); | ||||
AddObjectType("slider", &CSlider::ConstructObject); | AddObjectType("slider", &CSlider::ConstructObject); | ||||
} | } | ||||
void CGUI::ActivatePage() | |||||
{ | |||||
for (const std::pair<CStr, IGUIObject*>& p : m_pAllObjects) | |||||
p.second->ActivatePage(); | |||||
elexis: This sounds like it could cost some performance / doing more work than necessary.
One can get… | |||||
} | |||||
void CGUI::Draw() | void CGUI::Draw() | ||||
{ | { | ||||
// Clear the depth buffer, so the GUI is | // Clear the depth buffer, so the GUI is | ||||
// drawn on top of everything else | // drawn on top of everything else | ||||
glClear(GL_DEPTH_BUFFER_BIT); | glClear(GL_DEPTH_BUFFER_BIT); | ||||
try | try | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,406 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
This sounds like it could cost some performance / doing more work than necessary.
One can get the focused object of a GUI page with a getter, the function only operates on that one.