SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
Scissor.h
1#pragma once
2
3#include "spark/render/Export.h"
4
5#include "spark/math/Rectangle.h"
6
7#include <memory>
8
9namespace spark::render
10{
14 class SPARK_RENDER_EXPORT IScissor
15 {
16 public:
17 virtual ~IScissor() noexcept = default;
18
23 [[nodiscard]] virtual math::Rectangle<float> rectangle() const noexcept = 0;
24
29 virtual void setRectangle(const math::Rectangle<float>& rectangle) noexcept = 0;
30 };
31
35 class SPARK_RENDER_EXPORT Scissor final : public IScissor
36 {
37 public:
42 explicit Scissor(const math::Rectangle<float>& rectangle = {}) noexcept;
43 ~Scissor() noexcept override;
44
45 Scissor(const Scissor& other) = delete;
46 Scissor(Scissor&& other) noexcept = delete;
47 Scissor& operator=(const Scissor& other) = delete;
48 Scissor& operator=(Scissor&& other) noexcept = delete;
49
51 [[nodiscard]] math::Rectangle<float> rectangle() const noexcept override;
52
54 void setRectangle(const math::Rectangle<float>& rectangle) noexcept override;
55
56 private:
57 struct Impl;
58 std::unique_ptr<Impl> m_impl;
59 };
60}
Represents a rectangle in 2D space.
Definition Rectangle.h:15
Interface representing a scissor.
Definition Scissor.h:15
virtual math::Rectangle< float > rectangle() const noexcept=0
Get the rectangle defining the scissor region.
Implementation of IScissor.
Definition Scissor.h:36
Definition Scissor.cpp:6