1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

LibGL: Implement glScissor()

This commit is contained in:
Jelle Raaijmakers 2021-11-27 19:00:16 +01:00 committed by Brian Gianforcaro
parent 6dd2ebfe8e
commit bb58f6ccab
9 changed files with 83 additions and 10 deletions

View file

@ -33,4 +33,12 @@ void DepthBuffer::clear(float depth)
}
}
void DepthBuffer::clear(Gfx::IntRect bounds, float depth)
{
bounds.intersect({ 0, 0, m_size.width(), m_size.height() });
for (int y = bounds.top(); y <= bounds.bottom(); ++y)
for (int x = bounds.left(); x <= bounds.right(); ++x)
m_data[y * m_size.width() + x] = depth;
}
}