Nebula
Loading...
Searching...
No Matches
CoreGraphics::DisplayEvent Class Reference

#include <displayevent.h>

Detailed Description

Display events are sent by the display device to registered display event handlers.

Public Types

enum  Code {
  InvalidCode , WindowOpen , WindowClose , WindowReopen ,
  CloseRequested , WindowMinimized , WindowRestored , ToggleFullscreenWindowed ,
  WindowResized , SetCursor , Paint , SetFocus ,
  KillFocus , KeyDown , KeyUp , Character ,
  MouseMove , MouseButtonDown , MouseButtonUp , MouseButtonDoubleClick ,
  MouseWheelForward , MouseWheelBackward
}
 event codes More...
 

Public Member Functions

 DisplayEvent ()
 default constructor
 
 DisplayEvent (Code c)
 constructor with event code
 
 DisplayEvent (Code c, CoreGraphics::WindowId wnd)
 constructor with event code and window id
 
 DisplayEvent (Code c, const Math::vec2 &absPos, const Math::vec2 &normPos)
 constructor with event code and mouse pos
 
 DisplayEvent (Code c, Input::Key::Code k)
 constructor with key code
 
 DisplayEvent (Code c, Input::Char chr)
 constructor with character
 
 DisplayEvent (Code c, Input::MouseButton::Code b, const Math::vec2 &absPos, const Math::vec2 &normPos)
 constructor with mouse button and mouse pos
 
Code GetEventCode () const
 get event code
 
CoreGraphics::WindowId GetWindowId () const
 get window id
 
const Math::vec2GetAbsMousePos () const
 get absolute mouse pos (in pixels)
 
const Math::vec2GetNormMousePos () const
 get normalized mouse pos (from 0.0 to 1.0)
 
Input::Key::Code GetKey () const
 get key code
 
Input::Char GetChar () const
 get character code
 
Input::MouseButton::Code GetMouseButton () const
 get mouse button code
 

Private Attributes

Code code
 
CoreGraphics::WindowId windowId
 
Math::vec2 absMousePos
 
Math::vec2 normMousePos
 
Input::Key::Code keyCode
 
Input::Char charCode
 
Input::MouseButton::Code mouseButtonCode
 

Member Enumeration Documentation

◆ Code

event codes

Enumerator
InvalidCode 
WindowOpen 
WindowClose 
WindowReopen 
CloseRequested 
WindowMinimized 
WindowRestored 
ToggleFullscreenWindowed 
WindowResized 
SetCursor 
Paint 
SetFocus 
KillFocus 
KeyDown 
KeyUp 
Character 
MouseMove 
MouseButtonDown 
MouseButtonUp 
MouseButtonDoubleClick 
MouseWheelForward 
MouseWheelBackward 

Constructor & Destructor Documentation

◆ DisplayEvent() [1/7]

CoreGraphics::DisplayEvent::DisplayEvent ( )
inline

default constructor

◆ DisplayEvent() [2/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c)
inline

constructor with event code

◆ DisplayEvent() [3/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c,
CoreGraphics::WindowId wnd )
inline

constructor with event code and window id

◆ DisplayEvent() [4/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c,
const Math::vec2 & absPos,
const Math::vec2 & normPos )
inline

constructor with event code and mouse pos

◆ DisplayEvent() [5/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c,
Input::Key::Code k )
inline

constructor with key code

◆ DisplayEvent() [6/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c,
Input::Char chr )
inline

constructor with character

◆ DisplayEvent() [7/7]

CoreGraphics::DisplayEvent::DisplayEvent ( Code c,
Input::MouseButton::Code b,
const Math::vec2 & absPos,
const Math::vec2 & normPos )
inline

constructor with mouse button and mouse pos

Member Function Documentation

◆ GetAbsMousePos()

const Math::vec2 & CoreGraphics::DisplayEvent::GetAbsMousePos ( ) const
inline

get absolute mouse pos (in pixels)

◆ GetChar()

Input::Char CoreGraphics::DisplayEvent::GetChar ( ) const
inline

get character code

◆ GetEventCode()

DisplayEvent::Code CoreGraphics::DisplayEvent::GetEventCode ( ) const
inline

get event code

◆ GetKey()

Input::Key::Code CoreGraphics::DisplayEvent::GetKey ( ) const
inline

get key code

◆ GetMouseButton()

Input::MouseButton::Code CoreGraphics::DisplayEvent::GetMouseButton ( ) const
inline

get mouse button code

◆ GetNormMousePos()

const Math::vec2 & CoreGraphics::DisplayEvent::GetNormMousePos ( ) const
inline

get normalized mouse pos (from 0.0 to 1.0)

◆ GetWindowId()

CoreGraphics::WindowId CoreGraphics::DisplayEvent::GetWindowId ( ) const
inline

get window id

Member Data Documentation

◆ absMousePos

Math::vec2 CoreGraphics::DisplayEvent::absMousePos
private

◆ charCode

Input::Char CoreGraphics::DisplayEvent::charCode
private

◆ code

Code CoreGraphics::DisplayEvent::code
private

◆ keyCode

Input::Key::Code CoreGraphics::DisplayEvent::keyCode
private

◆ mouseButtonCode

Input::MouseButton::Code CoreGraphics::DisplayEvent::mouseButtonCode
private

◆ normMousePos

Math::vec2 CoreGraphics::DisplayEvent::normMousePos
private

◆ windowId

CoreGraphics::WindowId CoreGraphics::DisplayEvent::windowId
private

The documentation for this class was generated from the following file: