mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding clear window
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/25 11:59:07 by maldavid #+# #+# */
|
||||
/* Updated: 2023/03/31 12:26:08 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/01 16:05:03 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace mlx
|
||||
return format;
|
||||
}
|
||||
core::error::report(e_kind::fatal_error, "Vulkan : failed to find image format");
|
||||
return VK_FORMAT_R8G8B8A8_UNORM; // to avoid warning;
|
||||
}
|
||||
|
||||
void Image::create(uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties)
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/31 13:18:50 by maldavid #+# #+# */
|
||||
/* Updated: 2023/04/01 15:32:06 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/01 17:26:46 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace mlx
|
||||
void render(class Renderer& renderer) noexcept;
|
||||
VkDescriptorSet getDescriptorSet() noexcept;
|
||||
|
||||
void clear();
|
||||
|
||||
void destroy() noexcept;
|
||||
|
||||
~PixelPutPipeline();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/18 17:25:16 by maldavid #+# #+# */
|
||||
/* Updated: 2023/03/31 18:54:23 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/01 17:50:28 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user