VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
venom::common::Context Class Referenceabstract
+ Inheritance diagram for venom::common::Context:

Public Types

enum class  ContextType { GLFW = 0 , Count }
 

Public Member Functions

vc::Error Init ()
 
bool ShouldClose () const
 
void PollEvents ()
 
void SetRunLoopFunction (Callback< vc::Error > func)
 
vc::Error Run ()
 
InputState GetKeyState (KeyboardInput key) const
 
bool IsKeyPressed (KeyboardInput key) const
 
bool IsKeyReleased (KeyboardInput key) const
 
bool IsKeyRepeat (KeyboardInput key) const
 
bool IsKeyModifierPressed (int modifier) const
 Checks if a specified keyboard modifier key is currently pressed.
 
vcm::Vec2 GetMousePosition () const
 
vcm::Vec2 GetMouseMove () const
 
const vc::Vector< Screen > & GetScreens () const
 
const ScreenGetCurrentScreen () const
 
const ScreenVideoModeGetCurrentVideoMode () const
 
int GetCurrentRefreshRate () const
 
vc::Error ChangeRefreshRate (int rate)
 
vc::Error ChangeVideoMode (int index)
 
vc::Error ChangeScreen (int index)
 
void SetWindowTitle (const char *title)
 
void * GetWindow ()
 
vc::Error SetFullscreen (bool fullscreen)
 
- Public Member Functions inherited from venom::common::PluginObjectImpl
template<class T>
T * As ()
 
template<class T>
const T * As () const
 
template<class T>
T * ConstAs () const
 
template<class T>
T * RAs ()
 
template<class T>
const T * RAs () const
 
void IncRefCount ()
 
void DecRefCount ()
 
- Public Member Functions inherited from venom::common::PluginObject
 PluginObject (const PluginType type)
 
virtual void Destroy () override
 /!\ THIS FUNCTION MUST BE CALLED FOR DESTRUCTION, DO NOT USE delete
 
PluginType GetType () const override
 
template<class T>
T * DAs ()
 
template<class T>
const T * DAs () const
 

Static Public Member Functions

static ContextGet ()
 
static int GetWindowWidth ()
 
static int GetWindowHeight ()
 

Protected Member Functions

virtual void _SetWindowTitle (const char *title)=0
 
virtual void * _GetWindow ()=0
 
virtual vc::Error _InitContext ()=0
 
virtual vc::Error _UpdateVideoMode ()=0
 
virtual vc::Error _UpdateRefreshRate ()=0
 
virtual vc::Error _UpdateScreen ()=0
 
virtual vc::Error _SetFullscreen ()=0
 
virtual bool _ShouldClose ()=0
 
virtual void _GetCursorPos (double *pos)=0
 
virtual void _PollEvents ()=0
 
void _SetKeyboardState (KeyboardInput key, InputState state)
 
void _SetMouseState (MouseButton button, InputState state)
 
void _AddKeyReleasedEvent (KeyboardInput key)
 
void _AddMouseReleasedEvent (MouseButton button)
 
void _SetKeyboardModifierState (bool shift, bool control, bool alt, bool super)
 

Protected Attributes

Callback< vc::Error > _runLoopFunction
 
int _currentScreenIndex
 
int _currentVideoModeIndex
 
int _currentRefreshRate
 
int _width
 
int _height
 
bool _fullscreen
 
vc::Vector< Screen_screens
 

Member Function Documentation

◆ IsKeyModifierPressed()

bool venom::common::Context::IsKeyModifierPressed ( int modifier) const
inline

Checks if a specified keyboard modifier key is currently pressed.

Parameters
modifierA bitmask of one or more KeyboardModifier values.
Returns
true if the specified modifier(s) is pressed; otherwise, false.

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