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

Public Types

enum class  ContextType { GLFW = 0 , Count }
 

Public Member Functions

vc::Error Init ()
 
bool ShouldClose () const
 
void PollEvents ()
 
void SetPreRunLoopFunction (Callback< vc::Error > func)
 
void SetRunLoopFunction (Callback< vc::Error > func)
 
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)
 
virtual vc::Error Run (int argc, const char *argv[])
 

Static Public Member Functions

static ContextCreateContext ()
 
static ContextGet ()
 
static int GetWindowWidth ()
 
static int GetWindowHeight ()
 
static float GetWindowScale ()
 

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
 
Callback< vc::Error > _preRunLoopFunction
 
int _currentScreenIndex
 
int _currentVideoModeIndex
 
int _currentRefreshRate
 
int _width
 
int _height
 
float _scale
 
bool _fullscreen
 
vc::Vector< Screen_screens
 

Static Protected Attributes

static Contexts_context = nullptr
 

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: