fixing compilation issues

This commit is contained in:
2024-09-05 00:41:52 +02:00
parent 8ad6d84bd2
commit 8888bd03d8
23 changed files with 140 additions and 59 deletions

View File

@@ -5,6 +5,7 @@
#include <Renderer/Renderer.h>
#include <Graphics/Scene.h>
#include <Graphics/Sprite.h>
#include <Graphics/PutPixelManager.h>
#include <Renderer/ScenesRenderer.h>
#include <Maths/Mat4.h>
@@ -39,6 +40,7 @@ namespace mlx
private:
Renderer m_renderer;
SceneRenderer m_scene_renderer;
PutPixelManager m_put_pixel_manager;
std::shared_ptr<Window> p_window;
std::unique_ptr<Scene> p_scene;

View File

@@ -7,12 +7,19 @@ namespace mlx
{
MLX_PROFILE_FUNCTION();
p_scene->ResetSprites();
m_put_pixel_manager.ResetRenderData();
m_current_depth = 0;
}
void GraphicsSupport::PixelPut(int x, int y, std::uint32_t color) noexcept
{
MLX_PROFILE_FUNCTION();
NonOwningPtr<Texture> texture = m_put_pixel_manager.DrawPixel(x, y, m_current_depth, color);
if(texture)
{
Sprite& new_sprite = p_scene->CreateSprite(texture);
new_sprite.SetPosition(Vec3f{ 0.0f, 0.0f, static_cast<float>(m_current_depth) });
}
}
void GraphicsSupport::StringPut(int x, int y, std::uint32_t color, std::string str)

View File

@@ -48,7 +48,7 @@ namespace mlx
namespace mlx
{
#undef DebugLog
#define DebugLog(...) DebugLog(__LINE__, __FILE__, AK_FUNC_SIG, __VA_ARGS__)
#define DebugLog(...) DebugLog(__LINE__, __FILE__, __func__, __VA_ARGS__)
#undef Message
#define Message(...) Message(__LINE__, __FILE__, __func__, __VA_ARGS__)

View File

@@ -1,8 +1,6 @@
#ifndef __MLX_MEMORY__
#define __MLX_MEMORY__
#include <Utils/Singleton.h>
namespace mlx
{
class MemManager : public Singleton<MemManager>

View File

@@ -20,7 +20,7 @@ namespace mlx
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;
Vec2ui GetVulkanDrawableSize(Handle window) const noexcept;
inline void SetEventCallback(func::function<void(mlx_event_type, int, void*)> functor, void* userdata) { f_callback = std::move(functor); p_callback_data = userdata; }
inline void SetEventCallback(func::function<void(mlx_event_type, int, int, void*)> functor, void* userdata) { f_callback = std::move(functor); p_callback_data = userdata; }
private:
SDLManager() = default;
@@ -28,7 +28,7 @@ namespace mlx
private:
std::unordered_set<Handle> m_windows_registry;
func::function<void(mlx_event_type, int, void*)> f_callback;
func::function<void(mlx_event_type, int, int, void*)> f_callback;
void* p_callback_data = nullptr;
std::int32_t m_x;
std::int32_t m_y;