adding clear window

This commit is contained in:
2023-04-01 17:51:29 +02:00
parent 28850a6cb8
commit 7eea6ea1d5
13 changed files with 62 additions and 26 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/31 15:14:50 by maldavid #+# #+# */
/* Updated: 2023/04/01 15:32:23 by maldavid ### ########.fr */
/* Updated: 2023/04/01 17:30:54 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -53,6 +53,14 @@ namespace mlx
*reinterpret_cast<uint32_t*>(mem) = color;
}
void PixelPutPipeline::clear()
{
if(!_impl->buffer.isMapped())
_impl->buffer.mapMem(&_impl->map);
unsigned char* mem = static_cast<unsigned char*>(_impl->map);
std::memset(mem, 0, sizeof(uint32_t) * (_impl->width * _impl->height));
}
void PixelPutPipeline::present() noexcept
{
if(_impl->buffer.isMapped())