mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
minor refactor
This commit is contained in:
parent
69779f0cc0
commit
04b6b6b546
29 changed files with 130 additions and 91 deletions
|
|
@ -197,18 +197,18 @@ void GUI::act(float delta, const Viewport& vp) {
|
|||
}
|
||||
}
|
||||
|
||||
void GUI::draw(const DrawContext* pctx, Assets* assets) {
|
||||
auto& viewport = pctx->getViewport();
|
||||
void GUI::draw(const DrawContext& pctx, const Assets& assets) {
|
||||
auto& viewport = pctx.getViewport();
|
||||
glm::vec2 wsize = viewport.size();
|
||||
|
||||
menu->setPos((wsize - menu->getSize()) / 2.0f);
|
||||
uicamera->setFov(wsize.y);
|
||||
|
||||
auto uishader = assets->get<Shader>("ui");
|
||||
auto uishader = assets.get<Shader>("ui");
|
||||
uishader->use();
|
||||
uishader->uniformMatrix("u_projview", uicamera->getProjView());
|
||||
|
||||
pctx->getBatch2D()->begin();
|
||||
pctx.getBatch2D()->begin();
|
||||
container->draw(pctx, assets);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue