mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding depth buffer, ci skip
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define __MLX_SCENE__
|
||||
|
||||
#include <Graphics/Sprite.h>
|
||||
#include <Renderer/ViewerData.h>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
@@ -18,14 +19,20 @@ namespace mlx
|
||||
|
||||
Sprite& CreateSprite(std::shared_ptr<class Texture> texture) noexcept;
|
||||
|
||||
[[nodiscard]] inline const std::vector<std::shared_ptr<Sprite>>& GetSprites() const noexcept { return m_sprites; }
|
||||
[[nodiscard]] inline const SceneDescriptor& GetDescription() const noexcept { return m_descriptor; }
|
||||
inline void ResetSprites() { m_sprites.clear(); }
|
||||
|
||||
[[nodiscard]] MLX_FORCEINLINE const std::vector<std::shared_ptr<Sprite>>& GetSprites() const noexcept { return m_sprites; }
|
||||
[[nodiscard]] MLX_FORCEINLINE const SceneDescriptor& GetDescription() const noexcept { return m_descriptor; }
|
||||
[[nodiscard]] MLX_FORCEINLINE DepthImage& GetDepth() noexcept { return m_depth; }
|
||||
[[nodiscard]] MLX_FORCEINLINE ViewerData& GetViewerData() noexcept { return m_viewer_data; }
|
||||
|
||||
~Scene() = default;
|
||||
|
||||
private:
|
||||
SceneDescriptor m_descriptor;
|
||||
std::vector<std::shared_ptr<Sprite>> m_sprites;
|
||||
DepthImage m_depth;
|
||||
ViewerData m_viewer_data;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __MLX_SPRITE__
|
||||
#define __MLX_SPRITE__
|
||||
|
||||
#include <Maths/Vec2.h>
|
||||
#include <Maths/Vec3.h>
|
||||
#include <Maths/Vec4.h>
|
||||
#include <Graphics/Mesh.h>
|
||||
#include <Renderer/Descriptor.h>
|
||||
@@ -17,10 +17,10 @@ namespace mlx
|
||||
Sprite(std::shared_ptr<Texture> texture);
|
||||
|
||||
inline void SetColor(Vec4f color) noexcept { m_color = color; }
|
||||
inline void SetPosition(Vec2ui position) noexcept { m_position = position; }
|
||||
inline void SetPosition(Vec3f position) noexcept { m_position = position; }
|
||||
|
||||
[[nodiscard]] inline const Vec4f& GetColor() const noexcept { return m_color; }
|
||||
[[nodiscard]] inline const Vec2ui& GetPosition() const noexcept { return m_position; }
|
||||
[[nodiscard]] inline const Vec3f& GetPosition() const noexcept { return m_position; }
|
||||
[[nodiscard]] inline std::shared_ptr<Mesh> GetMesh() const { return p_mesh; }
|
||||
[[nodiscard]] inline std::shared_ptr<Texture> GetTexture() const { return p_texture; }
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace mlx
|
||||
std::shared_ptr<Texture> p_texture;
|
||||
std::shared_ptr<Mesh> p_mesh;
|
||||
Vec4f m_color = Vec4f{ 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
Vec2ui m_position = Vec2ui{ 0, 0 };
|
||||
Vec3f m_position = Vec4f{ 0.0f, 0.0f, 0.0f };
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user