sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
core
events
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
11
#include "
utilities/event/event.h
"
12
13
namespace
scl
14
{
16
class
viewport_resize_event
:
public
event
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
}
scl::event
Definition:
event.h:24
scl::event::GetName
virtual const char * GetName() const =0
scl::viewport_resize_event
Definition:
vieport_resize_event.h:17
scl::viewport_resize_event::ToString
std::string ToString() const override
Definition:
vieport_resize_event.h:48
scl::viewport_resize_event::GetViewportId
int GetViewportId() const
Definition:
vieport_resize_event.h:40
scl::viewport_resize_event::GetHeight
u32 GetHeight() const
Definition:
vieport_resize_event.h:38
scl::viewport_resize_event::viewport_resize_event
viewport_resize_event(int Width, int Height, int ViewportId)
Definition:
vieport_resize_event.h:32
scl::viewport_resize_event::GetWidth
u32 GetWidth() const
Definition:
vieport_resize_event.h:36
event.h
scl
Definition:
base.h:33
scl::u32
uint32_t u32
Definition:
math_common.h:21
Generated by
1.9.4