mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 03:14:34 +01:00
UIScreen helper class, derive your newUI screens from this.
This commit is contained in:
1 parent
2b3e1355ad
commit
c87fe2f782
5 files changed
+70
No files matched your search
@@ -0,0 +1,37 @@
|
||||
|
||||
#include "ui/ui_screen.h"
|
||||
#include "ui/ui_context.h"
|
||||
#include "ui/screen.h"
|
||||
|
||||
void UIScreen::update(InputState &input) {
|
||||
if (!root_) {
|
||||
CreateViews();
|
||||
}
|
||||
|
||||
if (orientationChanged_) {
|
||||
delete root_;
|
||||
root_ = 0;
|
||||
CreateViews();
|
||||
}
|
||||
|
||||
UpdateViewHierarchy(input, root_);
|
||||
}
|
||||
|
||||
void UIScreen::render() {
|
||||
UI::LayoutViewHierarchy(*screenManager()->getUIContext(), root_);
|
||||
|
||||
screenManager()->getUIContext()->Begin();
|
||||
DrawBackground();
|
||||
root_->Draw(*screenManager()->getUIContext());
|
||||
screenManager()->getUIContext()->End();
|
||||
screenManager()->getUIContext()->Flush();
|
||||
}
|
||||
|
||||
void UIScreen::touch(const TouchInput &touch) {
|
||||
root_->Touch(touch);
|
||||
}
|
||||
|
||||
UI::EventReturn UIScreen::OnBack(UI::EventParams &e) {
|
||||
screenManager()->finishDialog(this, DR_OK);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
Reference in new issue
Block a user