mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
adding clear color in mlx_clear_window
This commit is contained in:
@@ -17,7 +17,7 @@ int update(void* param)
|
|||||||
mlx_t* mlx = (mlx_t*)param;
|
mlx_t* mlx = (mlx_t*)param;
|
||||||
|
|
||||||
if(i == 200)
|
if(i == 200)
|
||||||
mlx_clear_window(mlx->mlx, mlx->win);
|
mlx_clear_window(mlx->mlx, mlx->win, 0xFF334D4D);
|
||||||
|
|
||||||
if(i >= 250)
|
if(i >= 250)
|
||||||
mlx_set_font_scale(mlx->mlx, "default", 16.f);
|
mlx_set_font_scale(mlx->mlx, "default", 16.f);
|
||||||
@@ -96,7 +96,7 @@ int key_hook(int key, void* param)
|
|||||||
mlx_mouse_hide();
|
mlx_mouse_hide();
|
||||||
break;
|
break;
|
||||||
case 6 : // (C)lear
|
case 6 : // (C)lear
|
||||||
mlx_clear_window(mlx->mlx, mlx->win);
|
mlx_clear_window(mlx->mlx, mlx->win, 0xFF334D4D);
|
||||||
break;
|
break;
|
||||||
case 79 : // RIGHT KEY
|
case 79 : // RIGHT KEY
|
||||||
mlx_mouse_move(mlx->mlx, mlx->win, x + 10, y);
|
mlx_mouse_move(mlx->mlx, mlx->win, x + 10, y);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
||||||
/* Updated: 2024/10/31 16:21:35 by maldavid ### ########.fr */
|
/* Updated: 2024/11/04 21:09:59 by maldavid ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ MLX_API void mlx_set_font_scale(void* mlx, char* filepath, float scale);
|
|||||||
*
|
*
|
||||||
* @return (void)
|
* @return (void)
|
||||||
*/
|
*/
|
||||||
MLX_API void mlx_clear_window(void* mlx, void* win);
|
MLX_API void mlx_clear_window(void* mlx, void* win, int color);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroys internal window
|
* @brief Destroys internal window
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace mlx
|
|||||||
inline void SetFPSCap(std::uint32_t fps) noexcept;
|
inline void SetFPSCap(std::uint32_t fps) noexcept;
|
||||||
|
|
||||||
inline Handle NewGraphicsSuport(std::size_t w, std::size_t h, const char* title, bool is_resizable);
|
inline Handle NewGraphicsSuport(std::size_t w, std::size_t h, const char* title, bool is_resizable);
|
||||||
inline void ClearGraphicsSupport(Handle win);
|
inline void ClearGraphicsSupport(Handle win, int color);
|
||||||
inline void DestroyGraphicsSupport(Handle win);
|
inline void DestroyGraphicsSupport(Handle win);
|
||||||
inline void SetGraphicsSupportPosition(Handle win, int x, int y);
|
inline void SetGraphicsSupportPosition(Handle win, int x, int y);
|
||||||
|
|
||||||
|
|||||||
@@ -101,11 +101,11 @@ namespace mlx
|
|||||||
return static_cast<void*>(&m_graphics.back()->GetID());
|
return static_cast<void*>(&m_graphics.back()->GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::ClearGraphicsSupport(Handle win)
|
void Application::ClearGraphicsSupport(Handle win, int color)
|
||||||
{
|
{
|
||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
CHECK_WINDOW_PTR(win);
|
CHECK_WINDOW_PTR(win);
|
||||||
m_graphics[*static_cast<int*>(win)]->ResetRenderData();
|
m_graphics[*static_cast<int*>(win)]->ResetRenderData(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::DestroyGraphicsSupport(Handle win)
|
void Application::DestroyGraphicsSupport(Handle win)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace mlx
|
|||||||
|
|
||||||
void Render() noexcept;
|
void Render() noexcept;
|
||||||
|
|
||||||
inline void ResetRenderData() noexcept;
|
inline void ResetRenderData(int color) noexcept;
|
||||||
|
|
||||||
inline void PixelPut(int x, int y, std::uint32_t color) noexcept;
|
inline void PixelPut(int x, int y, std::uint32_t color) noexcept;
|
||||||
inline void StringPut(int x, int y, std::uint32_t color, std::string str);
|
inline void StringPut(int x, int y, std::uint32_t color, std::string str);
|
||||||
|
|||||||
@@ -3,10 +3,16 @@
|
|||||||
|
|
||||||
namespace mlx
|
namespace mlx
|
||||||
{
|
{
|
||||||
void GraphicsSupport::ResetRenderData() noexcept
|
void GraphicsSupport::ResetRenderData(int color) noexcept
|
||||||
{
|
{
|
||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
p_scene->ResetScene();
|
Vec4f vec_color = {
|
||||||
|
static_cast<float>((color & 0x000000FF)) / 255.0f,
|
||||||
|
static_cast<float>((color & 0x0000FF00) >> 8) / 255.0f,
|
||||||
|
static_cast<float>((color & 0x00FF0000) >> 16) / 255.0f,
|
||||||
|
static_cast<float>((color & 0xFF000000) >> 24) / 255.0f
|
||||||
|
};
|
||||||
|
p_scene->ResetScene(std::move(vec_color));
|
||||||
m_put_pixel_manager.ResetRenderData();
|
m_put_pixel_manager.ResetRenderData();
|
||||||
m_draw_layer = 0;
|
m_draw_layer = 0;
|
||||||
m_pixelput_called = false;
|
m_pixelput_called = false;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <Graphics/Sprite.h>
|
#include <Graphics/Sprite.h>
|
||||||
#include <Graphics/Drawable.h>
|
#include <Graphics/Drawable.h>
|
||||||
#include <Renderer/ViewerData.h>
|
#include <Renderer/ViewerData.h>
|
||||||
|
#include <Maths/Vec4.h>
|
||||||
|
|
||||||
namespace mlx
|
namespace mlx
|
||||||
{
|
{
|
||||||
@@ -29,7 +30,8 @@ namespace mlx
|
|||||||
void BringToFront(NonOwningPtr<Drawable> drawable);
|
void BringToFront(NonOwningPtr<Drawable> drawable);
|
||||||
void BringToDrawLayer(NonOwningPtr<Drawable> drawable, std::uint64_t draw_layer);
|
void BringToDrawLayer(NonOwningPtr<Drawable> drawable, std::uint64_t draw_layer);
|
||||||
|
|
||||||
inline void ResetScene() { m_drawables.clear(); }
|
inline void ResetScene(Vec4f clear) { m_drawables.clear(); m_clear_color = std::move(clear); }
|
||||||
|
inline const Vec4f& GetClearColor() const noexcept { return m_clear_color; }
|
||||||
|
|
||||||
[[nodiscard]] MLX_FORCEINLINE const std::vector<std::shared_ptr<Drawable>>& GetDrawables() const noexcept { return m_drawables; }
|
[[nodiscard]] MLX_FORCEINLINE const std::vector<std::shared_ptr<Drawable>>& GetDrawables() const noexcept { return m_drawables; }
|
||||||
[[nodiscard]] MLX_FORCEINLINE ViewerData& GetViewerData() noexcept { return m_viewer_data; }
|
[[nodiscard]] MLX_FORCEINLINE ViewerData& GetViewerData() noexcept { return m_viewer_data; }
|
||||||
@@ -40,6 +42,7 @@ namespace mlx
|
|||||||
std::vector<std::shared_ptr<Drawable>> m_drawables;
|
std::vector<std::shared_ptr<Drawable>> m_drawables;
|
||||||
ViewerData m_viewer_data;
|
ViewerData m_viewer_data;
|
||||||
std::shared_ptr<Font> p_bound_font;
|
std::shared_ptr<Font> p_bound_font;
|
||||||
|
Vec4f m_clear_color = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace mlx
|
|||||||
RenderPasses() = default;
|
RenderPasses() = default;
|
||||||
|
|
||||||
void Init(class Renderer& renderer);
|
void Init(class Renderer& renderer);
|
||||||
void Pass(class Scene& scene, class Renderer& renderer);
|
void Pass(class Scene& scene, class Renderer& renderer, const Vec4f& clear_color);
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
~RenderPasses() = default;
|
~RenderPasses() = default;
|
||||||
|
|||||||
@@ -264,10 +264,15 @@ extern "C"
|
|||||||
static_cast<mlx::Application*>(mlx)->LoadFont(file, scale);
|
static_cast<mlx::Application*>(mlx)->LoadFont(file, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlx_clear_window(void* mlx, void* win)
|
void mlx_clear_window(void* mlx, void* win, int color)
|
||||||
{
|
{
|
||||||
MLX_CHECK_APPLICATION_POINTER(mlx);
|
MLX_CHECK_APPLICATION_POINTER(mlx);
|
||||||
static_cast<mlx::Application*>(mlx)->ClearGraphicsSupport(win);
|
unsigned char color_bits[4];
|
||||||
|
color_bits[0] = (color & 0x00FF0000) >> 16;
|
||||||
|
color_bits[1] = (color & 0x0000FF00) >> 8;
|
||||||
|
color_bits[2] = (color & 0x000000FF);
|
||||||
|
color_bits[3] = (color & 0xFF000000) >> 24;
|
||||||
|
static_cast<mlx::Application*>(mlx)->ClearGraphicsSupport(win, *reinterpret_cast<unsigned int*>(color_bits));
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlx_destroy_window(void* mlx, void* win)
|
void mlx_destroy_window(void* mlx, void* win)
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
#include <Graphics/Font.h>
|
#include <Graphics/Font.h>
|
||||||
#include <Core/Memory.h>
|
#include <Core/Memory.h>
|
||||||
|
|
||||||
#define STBRP_ASSERT(x) mlx::Assert(x, "internal stb assertion")
|
#define STBRP_ASSERT(x) mlx::Assert(x, "internal stb assertion " #x)
|
||||||
#define STB_RECT_PACK_IMPLEMENTATION
|
#define STB_RECT_PACK_IMPLEMENTATION
|
||||||
#include <stb_rect_pack.h>
|
#include <stb_rect_pack.h>
|
||||||
|
|
||||||
#define STB_TRUETYPE_IMPLEMENTATION
|
#define STB_TRUETYPE_IMPLEMENTATION
|
||||||
#define STB_malloc(x, u) ((void)(u), MemManager::Get().Malloc(x))
|
#define STB_malloc(x, u) ((void)(u), mlx::MemManager::Get().Malloc(x))
|
||||||
#define STB_free(x, u) ((void)(u), MemManager::Get().Free(x))
|
#define STB_free(x, u) ((void)(u), mlx::MemManager::Get().Free(x))
|
||||||
#include <stb_truetype.h>
|
#include <stb_truetype.h>
|
||||||
|
|
||||||
namespace mlx
|
namespace mlx
|
||||||
@@ -43,7 +43,7 @@ namespace mlx
|
|||||||
stbtt_PackFontRange(&pc, std::get<std::vector<std::uint8_t>>(m_build_data).data(), 0, m_scale, 32, 96, m_cdata.data());
|
stbtt_PackFontRange(&pc, std::get<std::vector<std::uint8_t>>(m_build_data).data(), 0, m_scale, 32, 96, m_cdata.data());
|
||||||
stbtt_PackEnd(&pc);
|
stbtt_PackEnd(&pc);
|
||||||
|
|
||||||
// TODO : find better solution
|
// TODO : find better solution; No, using VK_FORMAT_R8_SRGB does not work
|
||||||
CPUBuffer vulkan_bitmap(RANGE * RANGE * 4);
|
CPUBuffer vulkan_bitmap(RANGE * RANGE * 4);
|
||||||
for(int i = 0, j = 0; i < RANGE * RANGE; i++, j += 4)
|
for(int i = 0, j = 0; i < RANGE * RANGE; i++, j += 4)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
#include <PreCompiled.h>
|
#include <PreCompiled.h>
|
||||||
#include <Renderer/Image.h>
|
#include <Renderer/Image.h>
|
||||||
#include <Maths/Vec4.h>
|
#include <Maths/Vec4.h>
|
||||||
|
#include <Maths/Vec2.h>
|
||||||
#include <Renderer/RenderCore.h>
|
#include <Renderer/RenderCore.h>
|
||||||
#include <Utils/CallOnExit.h>
|
#include <Utils/CallOnExit.h>
|
||||||
|
#include <Core/Memory.h>
|
||||||
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
|
||||||
|
#define STBI_ASSERT(x) mlx::Assert(x, "internal stb assertion " #x)
|
||||||
|
#define STBI_MALLOC(x) (mlx::MemManager::Get().Malloc(x))
|
||||||
|
#define STBI_REALLOC(p, x) (mlx::MemManager::Get().Realloc(p, x))
|
||||||
|
#define STBI_FREE(x) (mlx::MemManager::Get().Free(x))
|
||||||
|
|
||||||
#ifdef MLX_COMPILER_GCC
|
#ifdef MLX_COMPILER_GCC
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
@@ -264,7 +272,7 @@ namespace mlx
|
|||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
std::string filename = file.string();
|
std::string filename = file.string();
|
||||||
|
|
||||||
if(file.stem() == "banana")
|
if(file.stem() == "terracotta.pie")
|
||||||
Message("banana, banana, banana, banana, terracotta banana terracotta, terracotta pie");
|
Message("banana, banana, banana, banana, terracotta banana terracotta, terracotta pie");
|
||||||
|
|
||||||
if(!std::filesystem::exists(file))
|
if(!std::filesystem::exists(file))
|
||||||
@@ -274,21 +282,28 @@ namespace mlx
|
|||||||
}
|
}
|
||||||
if(stbi_is_hdr(filename.c_str()))
|
if(stbi_is_hdr(filename.c_str()))
|
||||||
{
|
{
|
||||||
Error("Texture: unsupported image format % (HDR image)", file);
|
Error("Texture: unsupported image format from % (HDR image)", file);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
int dummy_w;
|
|
||||||
int dummy_h;
|
|
||||||
int channels;
|
|
||||||
std::uint8_t* data = stbi_load(filename.c_str(), (w == nullptr ? &dummy_w : w), (h == nullptr ? &dummy_h : h), &channels, 4);
|
|
||||||
|
|
||||||
|
Vec2i size;
|
||||||
|
int channels;
|
||||||
|
|
||||||
|
std::uint8_t* data = stbi_load(filename.c_str(), &size.x, &size.y, &channels, STBI_rgb_alpha);
|
||||||
CallOnExit defer([=]() { stbi_image_free(data); });
|
CallOnExit defer([=]() { stbi_image_free(data); });
|
||||||
|
|
||||||
CPUBuffer buffer((w == nullptr ? dummy_w : *w) * (h == nullptr ? dummy_h : *h) * 4);
|
Verify(channels == 4, "invalid channels number in image loaded (should be 4, was %)", channels);
|
||||||
|
|
||||||
|
CPUBuffer buffer(size.x * size.y * 4);
|
||||||
std::memcpy(buffer.GetData(), data, buffer.GetSize());
|
std::memcpy(buffer.GetData(), data, buffer.GetSize());
|
||||||
|
|
||||||
|
if(w != nullptr)
|
||||||
|
*w = size.x;
|
||||||
|
if(h != nullptr)
|
||||||
|
*h = size.y;
|
||||||
|
|
||||||
Texture* texture;
|
Texture* texture;
|
||||||
try { texture = new Texture(std::move(buffer), (w == nullptr ? dummy_w : *w), (h == nullptr ? dummy_h : *h), VK_FORMAT_R8G8B8A8_SRGB, false, std::move(filename)); }
|
try { texture = new Texture(std::move(buffer), size.x, size.y, VK_FORMAT_R8G8B8A8_SRGB, false, std::move(filename)); }
|
||||||
catch(...) { return nullptr; }
|
catch(...) { return nullptr; }
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace mlx
|
|||||||
{
|
{
|
||||||
m_2Dpass.Init();
|
m_2Dpass.Init();
|
||||||
m_final.Init();
|
m_final.Init();
|
||||||
func::function<void(const EventBase&)> functor = [this, renderer](const EventBase& event)
|
func::function<void(const EventBase&)> functor = [this, &renderer](const EventBase& event)
|
||||||
{
|
{
|
||||||
if(event.What() == Event::ResizeEventCode)
|
if(event.What() == Event::ResizeEventCode)
|
||||||
{
|
{
|
||||||
@@ -34,9 +34,9 @@ namespace mlx
|
|||||||
m_main_render_texture.TransitionLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
m_main_render_texture.TransitionLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPasses::Pass(Scene& scene, Renderer& renderer)
|
void RenderPasses::Pass(Scene& scene, Renderer& renderer, const Vec4f& clear_color)
|
||||||
{
|
{
|
||||||
m_main_render_texture.Clear(renderer.GetActiveCommandBuffer(), Vec4f{ 0.0f, 0.0f, 0.0f, 1.0f });
|
m_main_render_texture.Clear(renderer.GetActiveCommandBuffer(), clear_color);
|
||||||
|
|
||||||
m_2Dpass.Pass(scene, renderer, m_main_render_texture);
|
m_2Dpass.Pass(scene, renderer, m_main_render_texture);
|
||||||
m_final.Pass(scene, renderer, m_main_render_texture);
|
m_final.Pass(scene, renderer, m_main_render_texture);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace mlx
|
|||||||
void SceneRenderer::Render(Scene& scene, Renderer& renderer)
|
void SceneRenderer::Render(Scene& scene, Renderer& renderer)
|
||||||
{
|
{
|
||||||
MLX_PROFILE_FUNCTION();
|
MLX_PROFILE_FUNCTION();
|
||||||
m_passes.Pass(scene, renderer);
|
m_passes.Pass(scene, renderer, scene.GetClearColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneRenderer::Destroy()
|
void SceneRenderer::Destroy()
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace mlx
|
|||||||
|
|
||||||
for(Image& img : m_swapchain_images)
|
for(Image& img : m_swapchain_images)
|
||||||
img.DestroyImageView();
|
img.DestroyImageView();
|
||||||
// kvfDestroySwapchainKHR(RenderCore::Get().GetDevice(), m_swapchain);
|
kvfDestroySwapchainKHR(RenderCore::Get().GetDevice(), m_swapchain);
|
||||||
|
|
||||||
RenderCore::Get().vkDestroySurfaceKHR(RenderCore::Get().GetInstance(), m_surface, nullptr);
|
RenderCore::Get().vkDestroySurfaceKHR(RenderCore::Get().GetInstance(), m_surface, nullptr);
|
||||||
m_surface = VK_NULL_HANDLE;
|
m_surface = VK_NULL_HANDLE;
|
||||||
@@ -79,8 +79,8 @@ namespace mlx
|
|||||||
|
|
||||||
VkSwapchainKHR old_swapchain = m_swapchain;
|
VkSwapchainKHR old_swapchain = m_swapchain;
|
||||||
m_swapchain = kvfCreateSwapchainKHR(RenderCore::Get().GetDevice(), RenderCore::Get().GetPhysicalDevice(), m_surface, extent, VK_NULL_HANDLE, true);
|
m_swapchain = kvfCreateSwapchainKHR(RenderCore::Get().GetDevice(), RenderCore::Get().GetPhysicalDevice(), m_surface, extent, VK_NULL_HANDLE, true);
|
||||||
// if(old_swapchain != VK_NULL_HANDLE)
|
if(old_swapchain != VK_NULL_HANDLE)
|
||||||
// kvfDestroySwapchainKHR(RenderCore::Get().GetDevice(), old_swapchain);
|
kvfDestroySwapchainKHR(RenderCore::Get().GetDevice(), old_swapchain);
|
||||||
|
|
||||||
m_images_count = kvfGetSwapchainImagesCount(m_swapchain);
|
m_images_count = kvfGetSwapchainImagesCount(m_swapchain);
|
||||||
m_min_images_count = kvfGetSwapchainMinImagesCount(m_swapchain);
|
m_min_images_count = kvfGetSwapchainMinImagesCount(m_swapchain);
|
||||||
|
|||||||
4
third_party/kvf.h
vendored
4
third_party/kvf.h
vendored
@@ -679,7 +679,6 @@ __KvfDevice* __kvfGetKvfDeviceFromVkCommandBuffer(VkCommandBuffer cmd)
|
|||||||
__kvf_internal_swapchains[__kvf_internal_swapchains_size].images_count = images_count;
|
__kvf_internal_swapchains[__kvf_internal_swapchains_size].images_count = images_count;
|
||||||
__kvf_internal_swapchains[__kvf_internal_swapchains_size].images_extent = extent;
|
__kvf_internal_swapchains[__kvf_internal_swapchains_size].images_extent = extent;
|
||||||
__kvf_internal_swapchains_size++;
|
__kvf_internal_swapchains_size++;
|
||||||
printf("new size updated %zu, capacity %zu\n", __kvf_internal_swapchains_size, __kvf_internal_swapchains_capacity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __kvfDestroySwapchain(VkDevice device, VkSwapchainKHR swapchain)
|
void __kvfDestroySwapchain(VkDevice device, VkSwapchainKHR swapchain)
|
||||||
@@ -701,7 +700,6 @@ __KvfDevice* __kvfGetKvfDeviceFromVkCommandBuffer(VkCommandBuffer cmd)
|
|||||||
for(size_t j = i; j < __kvf_internal_swapchains_size - 1; j++)
|
for(size_t j = i; j < __kvf_internal_swapchains_size - 1; j++)
|
||||||
__kvf_internal_swapchains[j] = __kvf_internal_swapchains[j + 1];
|
__kvf_internal_swapchains[j] = __kvf_internal_swapchains[j + 1];
|
||||||
__kvf_internal_swapchains_size--;
|
__kvf_internal_swapchains_size--;
|
||||||
printf("new size delete %zu, capacity %zu\n", __kvf_internal_swapchains_size, __kvf_internal_swapchains_capacity);
|
|
||||||
if(__kvf_internal_swapchains_size == 0)
|
if(__kvf_internal_swapchains_size == 0)
|
||||||
{
|
{
|
||||||
KVF_FREE(__kvf_internal_swapchains);
|
KVF_FREE(__kvf_internal_swapchains);
|
||||||
@@ -711,12 +709,10 @@ __KvfDevice* __kvfGetKvfDeviceFromVkCommandBuffer(VkCommandBuffer cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
__KvfSwapchain* __kvfGetKvfSwapchainFromVkSwapchainKHR(VkSwapchainKHR swapchain)
|
__KvfSwapchain* __kvfGetKvfSwapchainFromVkSwapchainKHR(VkSwapchainKHR swapchain)
|
||||||
{
|
{
|
||||||
KVF_ASSERT(swapchain != VK_NULL_HANDLE);
|
KVF_ASSERT(swapchain != VK_NULL_HANDLE);
|
||||||
printf("size %zu, capacity %zu\n", __kvf_internal_swapchains_size, __kvf_internal_swapchains_capacity);
|
|
||||||
for(size_t i = 0; i < __kvf_internal_swapchains_size; i++)
|
for(size_t i = 0; i < __kvf_internal_swapchains_size; i++)
|
||||||
{
|
{
|
||||||
if(__kvf_internal_swapchains[i].swapchain == swapchain)
|
if(__kvf_internal_swapchains[i].swapchain == swapchain)
|
||||||
|
|||||||
Reference in New Issue
Block a user