mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
GL-related refactor
This commit is contained in:
parent
f8e02e1b3b
commit
87edb1d45e
16 changed files with 224 additions and 111 deletions
|
|
@ -204,7 +204,7 @@ void Image::draw(const GfxContext* pctx, Assets* assets) {
|
|||
|
||||
auto texture = assets->getTexture(this->texture);
|
||||
if (texture && autoresize) {
|
||||
setSize(glm::vec2(texture->width, texture->height));
|
||||
setSize(glm::vec2(texture->getWidth(), texture->getHeight()));
|
||||
}
|
||||
batch->texture(texture);
|
||||
batch->setColor(color);
|
||||
|
|
@ -383,7 +383,7 @@ void TextBox::draw(const GfxContext* pctx, Assets* assets) {
|
|||
glm::vec2 size = getSize();
|
||||
|
||||
auto subctx = pctx->sub();
|
||||
subctx.scissors(glm::vec4(pos.x, pos.y, size.x, size.y));
|
||||
subctx.setScissors(glm::vec4(pos.x, pos.y, size.x, size.y));
|
||||
|
||||
const int lineHeight = font->getLineHeight() * label->getLineInterval();
|
||||
glm::vec2 lcoord = label->calcPos();
|
||||
|
|
@ -418,7 +418,6 @@ void TextBox::draw(const GfxContext* pctx, Assets* assets) {
|
|||
batch->rect(lcoord.x, lcoord.y+label->getLineYOffset(endLine), end, lineHeight);
|
||||
}
|
||||
}
|
||||
batch->flush();
|
||||
}
|
||||
|
||||
void TextBox::drawBackground(const GfxContext* pctx, Assets* assets) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue