Monitor - Horizon-NTH/HorizonGUI GitHub Wiki
Monitor
Overview
The Monitor
class in the hgui::kernel
namespace provides essential functionality for retrieving
information about a monitor. It encapsulates properties such as monitor size, position, and name.
The class can be found in the header file Monitor.h
and uses GLFW.
Constructors
explicit Monitor(GLFWmonitor* monitorPTR)
: Constructs aMonitor
object using a pointer to a GLFW monitor.
Member Functions
-
GLFWmonitor* get_monitor_ptr() const
: Retrieves the GLFW monitor pointer associated with thisMonitor
object. -
const size& get_size() const
: Retrieves the size of the monitor. -
std::string get_name() const
: Retrieves the name of the monitor. -
const point& get_position() const
: Retrieves the position of the monitor.
Example Usage
#include <hgui/header/Monitor.h>
// Example Usage of Monitor class
GLFWmonitor* monitorPTR = /* obtain monitor pointer */;
hgui::kernel::Monitor monitor(monitorPTR);
// Retrieve monitor properties
GLFWmonitor* retrievedMonitor = monitor.get_monitorPTR();
const size& monitorSize = monitor.get_size();
std::string monitorName = monitor.get_name();
const point& monitorPosition = monitor.get_position();
// Make use of retrieved monitor properties
Note: In the "Example Usage" section, ensure to replace
/* obtain monitor pointer */
with the actual code to obtain a pointer to the GLFW monitor you want to create aMonitor
object for.