Initial UI implementation by AI
This commit is contained in:
1 parent
f2a3f59ab1
commit
908b52441f
29 files changed
+884
-186
No files matched your search
@@ -56,6 +56,10 @@ UIPass::~UIPass() {}
|
||||
void UIPass::beginFrame(const Component::Camera& cam, const Component::Transform& transform) {
|
||||
updateViewParameters(cam, transform);
|
||||
viewParamsSet = createViewParamsSet();
|
||||
// input first (hover transitions etc.), then style+layout, then gather render data
|
||||
system->processInput();
|
||||
system->beginFrame(UVector2(viewport->getWidth(), viewport->getHeight()));
|
||||
renderElements = system->render();
|
||||
glyphs.clear();
|
||||
usedTextures.clear();
|
||||
elements.clear();
|
||||
@@ -253,7 +257,4 @@ void UIPass::createRenderPass() {
|
||||
}},
|
||||
},
|
||||
});
|
||||
system->style();
|
||||
system->layout(UVector2(viewport->getWidth(), viewport->getHeight()));
|
||||
renderElements = system->render();
|
||||
}
|
||||
@@ -19,6 +19,14 @@ class UIPass : public RenderPass {
|
||||
virtual void publishOutputs() override;
|
||||
virtual void createRenderPass() override;
|
||||
|
||||
// input: the owning view forwards its window callbacks here (window-relative coords)
|
||||
void mouseMove(Vector2 position) { system->mouseMove(position); }
|
||||
void mouseButton(MouseButton button, InputAction action, KeyModifierFlags modifier, Vector2 position) {
|
||||
system->mouseButton(button, action, (KeyModifier)modifier, position);
|
||||
}
|
||||
void scroll(Vector2 delta) { system->scroll(delta); }
|
||||
void key(KeyCode code, InputAction action, KeyModifierFlags modifier, char text = 0) { system->key(code, action, (KeyModifier)modifier, text); }
|
||||
|
||||
private:
|
||||
struct GlyphData {
|
||||
Vector2 bearing;
|
||||
|
||||
Reference in new issue
Block a user