sculpto
vieport_resize_event.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file vieport_events.h
3 * \brief Viewport resize event implementation module.
4 *
5 * \author Sabitov Kirill
6 * \date 13 July 2022
7 *********************************************************************/
8
9#pragma once
10
12
13namespace scl
14{
17 {
18 SCL_MAKE_EVENT(ViewportResize);
19
20 private:
21 u32 Width, Height;
22 int ViewportId;
23
24 public:
25 /*!*
26 * Window resize vent constructor.
27 *
28 * \param Width - new width of window.
29 * \param Height - new height of window.
30 * \param ViewportId - id of resizeing viewport (zero viewport id is always window viewport).
31 */
32 viewport_resize_event(int Width, int Height, int ViewportId) :
33 Width(Width), Height(Height), ViewportId(ViewportId) {}
34
36 u32 GetWidth() const { return Width; }
38 u32 GetHeight() const { return Height; }
40 int GetViewportId() const { return ViewportId; }
41
42 /*!*
43 * Convert event to string (for debug).
44 *
45 * \param None.
46 * \return string representation of event.
47 */
48 inline std::string ToString() const override
49 {
50 std::stringstream ss;
51 ss << GetName() << ": " << Width << ", " << Height;
52 return ss.str();
53 }
54 };
55}
virtual const char * GetName() const =0
std::string ToString() const override
viewport_resize_event(int Width, int Height, int ViewportId)
Definition: base.h:33
uint32_t u32
Definition: math_common.h:21