TGUI  0.8.9
Clipping.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2020 Bruno Van de Velde (vdv_b@tgui.eu)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25
26#ifndef TGUI_CLIPPING_HPP
27#define TGUI_CLIPPING_HPP
28
29#include <TGUI/Global.hpp>
30#include <TGUI/Vector2f.hpp>
31#include <SFML/Graphics/RenderTarget.hpp>
32#include <SFML/Graphics/View.hpp>
33
35
36namespace tgui
37{
39
40 class TGUI_API Clipping
41 {
42 public:
43
52 Clipping(sf::RenderTarget& target, const sf::RenderStates& states, Vector2f topLeft, Vector2f size);
53
54
55 // The clipping object cannot be copied
56 Clipping(const Clipping& copy) = delete;
57 Clipping& operator=(const Clipping& right) = delete;
58
59
60 // When the clipping object is destroyed, the old clipping is restored
61 ~Clipping();
62
63
66 // Sets the view used by the gui, which the calculations have to take into account when changing the view for clipping
68 static void setGuiView(const sf::View& view);
69
70
72 private:
73
74 sf::RenderTarget& m_target;
75 sf::View m_oldView;
76
77 static sf::View m_originalView;
78 };
79
81}
82
84
85#endif // TGUI_CLIPPING_HPP
Definition: Clipping.hpp:41
Clipping(sf::RenderTarget &target, const sf::RenderStates &states, Vector2f topLeft, Vector2f size)
Creates a clipping object which will define a clipping region until the object is destroyed.
Definition: Vector2f.hpp:39
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37