mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing compilation issues
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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__)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef __MLX_MEMORY__
|
||||
#define __MLX_MEMORY__
|
||||
|
||||
#include <Utils/Singleton.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
class MemManager : public Singleton<MemManager>
|
||||
|
||||
@@ -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;
|
||||
|
||||
25
runtime/Includes/Graphics/PutPixelManager.h
git.filemode.normal_file
25
runtime/Includes/Graphics/PutPixelManager.h
git.filemode.normal_file
@@ -0,0 +1,25 @@
|
||||
#ifndef __MLX_PUT_PIXEL_MANAGER__
|
||||
#define __MLX_PUT_PIXEL_MANAGER__
|
||||
|
||||
#include <Renderer/Image.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
class PutPixelManager
|
||||
{
|
||||
public:
|
||||
PutPixelManager(NonOwningPtr<class Renderer> renderer) : p_renderer(renderer) {}
|
||||
|
||||
// Return a valid pointer when a new texture has been created
|
||||
NonOwningPtr<Texture> DrawPixel(int x, int y, std::uint64_t z, std::uint32_t color);
|
||||
void ResetRenderData();
|
||||
|
||||
~PutPixelManager();
|
||||
|
||||
private:
|
||||
std::map<std::uint64_t, Texture> m_textures;
|
||||
NonOwningPtr<class Renderer> p_renderer;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef __MLX_SCENE__
|
||||
#define __MLX_SCENE__
|
||||
|
||||
#include <Renderer/Renderer.h>
|
||||
#include <Graphics/Sprite.h>
|
||||
#include <Renderer/ViewerData.h>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace mlx
|
||||
};
|
||||
|
||||
public:
|
||||
Inputs() = default;
|
||||
Inputs();
|
||||
|
||||
void RegisterWindow(std::shared_ptr<Window> window);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace mlx
|
||||
|
||||
~Inputs() = default;
|
||||
|
||||
protected:
|
||||
private:
|
||||
std::unordered_map<std::uint32_t, std::shared_ptr<Window>> m_windows;
|
||||
std::unordered_map<std::uint32_t, std::array<Hook, 6>> m_events_hooks;
|
||||
bool m_run = false;
|
||||
|
||||
Reference in New Issue
Block a user