Added mlx_set_window_icon

This commit is contained in:
Daemo
2026-08-10 15:32:18 +02:00
parent 0491089463
commit 9800d2f78d
10 changed files with 77 additions and 9 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ namespace mlx
}
if (info->title == nullptr)
{
mlx::Error("invalid window title (NULL)");
Error("invalid window title (NULL)");
return nullptr;
}
+2
View File
@@ -3,6 +3,7 @@
#include <mlx.h>
#include <Maths/Vec2.h>
#include <Renderer/Image.h>
namespace mlx
{
@@ -26,6 +27,7 @@ namespace mlx
void SetWindowPosition(Handle window, int x, int y) const noexcept;
void SetWindowSize(Handle window, int x, int y) const noexcept;
void SetWindowTitle(Handle window, std::string_view title) const noexcept;
void SetWindowIcon(Handle window, NonOwningPtr<Texture> texture) const noexcept;
void SetWindowFullscreen(Handle window, bool enable) const noexcept;
void SetWindowMaxSize(Handle window, int x, int y) const noexcept;
void SetWindowMinSize(Handle window, int x, int y) const noexcept;
+2
View File
@@ -4,6 +4,7 @@
#include <mlx.h>
#include <Maths/Vec2.h>
#include <Core/SDLManager.h>
#include <Renderer/Image.h>
namespace mlx
{
@@ -24,6 +25,7 @@ namespace mlx
MLX_FORCEINLINE void SetPosition(int x, int y) { SDLManager::Get().SetWindowPosition(p_window, x, y); }
MLX_FORCEINLINE void SetSize(int x, int y) { SDLManager::Get().SetWindowSize(p_window, x, y); m_width = x; m_height = y; }
MLX_FORCEINLINE void SetTitle(std::string title) { SDLManager::Get().SetWindowTitle(p_window, title); m_name = std::move(title); }
MLX_FORCEINLINE void SetIcon(NonOwningPtr<Texture> texture) {SDLManager::Get().SetWindowIcon(p_window, texture); }
MLX_FORCEINLINE void SetFullscreen(bool enable) { SDLManager::Get().SetWindowFullscreen(p_window, enable); }
MLX_FORCEINLINE void SetMaxSize(int x, int y) { SDLManager::Get().SetWindowMaxSize(p_window, x, y); }
MLX_FORCEINLINE void SetMinSize(int x, int y) { SDLManager::Get().SetWindowMinSize(p_window, x, y); }
+2
View File
@@ -94,6 +94,8 @@ namespace mlx
void Swap(Texture& texture) noexcept;
mlx_color* GetBufferCopy() noexcept;
// If a valid cmd buffer is passed, this function takes ownership and makes it invalid after
void SyncCPUBuffer(VkCommandBuffer cmd = VK_NULL_HANDLE);
void Update(VkCommandBuffer cmd);
+2
View File
@@ -1,6 +1,8 @@
#ifndef __MLX_CPU_BUFFER__
#define __MLX_CPU_BUFFER__
#include <PreCompiled.h>
namespace mlx
{
class CPUBuffer