1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:27:43 +00:00

LibSoftGPU: Add device method for creating images

This commit is contained in:
Stephan Unverwerth 2021-12-19 00:02:32 +01:00 committed by Brian Gianforcaro
parent 91ccf9958f
commit b8bb72abbe
5 changed files with 192 additions and 0 deletions

View file

@ -801,4 +801,15 @@ float Device::get_depthbuffer_value(int x, int y)
return m_depth_buffer->scanline(y)[x];
}
NonnullRefPtr<Image> Device::create_image(ImageFormat format, unsigned width, unsigned height, unsigned depth, unsigned levels, unsigned layers)
{
VERIFY(width > 0);
VERIFY(height > 0);
VERIFY(depth > 0);
VERIFY(levels > 0);
VERIFY(layers > 0);
return adopt_ref(*new Image(format, width, height, depth, levels, layers));
}
}