23 display_mode(
unsigned int w = 1024,
unsigned int h = 768,
unsigned int bd = 32,
unsigned int rr = 60)
28extern CGV_API std::ostream& operator << (std::ostream& os,
const display_mode& dm);
42extern CGV_API std::ostream& operator << (std::ostream& os,
const display_position& dp);
57extern CGV_API std::ostream& operator << (std::ostream& os,
const display_configuration& dc);
81 static void scan_displays(DisplayScanMode mode = DSM_ALL);
83 static const std::vector<display*>& get_displays();
85 static void clear_displays();
87 static bool activate_all();
89 static bool check_activate_all();
91 static void show_all_displays(DisplayScanMode scan_mode = DSM_ALL);
100 virtual void enumerate_display_modes(std::vector<display_mode>& display_modes,
bool compatible_with_attached_monitor =
true) = 0;
220extern CGV_API std::ostream& operator << (std::ostream& os,
const display& disp);
225#include <cgv/config/lib_end.h>
the display class gives access to the display modes of all available displays.
virtual bool register_resolution(unsigned int w, unsigned int h)=0
register new resolution of the display, which is activated in the next activate() or activate_all() c...
virtual unsigned int get_height() const =0
return the current height (only defined if display is active)
virtual display_mode get_registered_mode() const =0
return the display mode registered in the registry
virtual bool check_position(unsigned int x, unsigned int y) const =0
check given position
virtual display_configuration get_configuration() const =0
return the current display configuration
virtual unsigned int get_registered_width() const =0
return the registered width (this is changed by prepare_resolution)
virtual bool set_refresh_rate(unsigned int hz)=0
set new refresh rate of the display immediately, return whether this was successful....
virtual bool register_bit_depth(unsigned int bits)=0
register new bit depth of the display, which is activated in the next activate() or activate_all() ca...
virtual bool make_primary()=0
make this display the primary display
static std::string last_error
if one of the methods return false, this static member gives textual information about the reason
virtual unsigned int get_width() const =0
return the current width (only defined if display is active)
virtual unsigned int get_registered_refresh_rate() const =0
return the registered refresh rate in Hz (this is changed by prepare_refresh_rate)
virtual bool set_bit_depth(unsigned int bits)=0
set new bit depth of the display immediately, return whether this was successful. Only bit depths tha...
virtual bool is_removable() const =0
return whether display is removable
virtual bool deactivate()=0
deactivate the display, return whether deactivation was successful
virtual int get_y() const =0
return the current current y coordinate within the virtual screen spanned by the desktop (only define...
virtual bool is_mirror() const =0
return whether display is a mirrored display
virtual bool register_position(const display_position &dp)=0
register new position immediately, which is activated in the next activate() or activate_all() call
virtual bool register_refresh_rate(unsigned int hz)=0
register new refresh rate of the display, which is activated in the next activate() or activate_all()...
virtual display_mode get_mode() const =0
return the currently set display mode
virtual std::string get_name() const =0
return the name of the display
virtual bool set_configuration(const display_configuration &dc)=0
set the display configuration immediately, return whether this was successful.
virtual void enumerate_display_modes(std::vector< display_mode > &display_modes, bool compatible_with_attached_monitor=true)=0
enumerate all available display modes. If the display is active only the display modes supported by t...
virtual bool can_be_primary() const =0
check if this display can be made primary
virtual ~display()
virtual destructor frees all platform specifically allocated memory
virtual bool is_primary() const =0
return whether display is the primary display
virtual bool register_mode(const display_mode &dm)=0
register new display mode, which is activated in the next activate() or activate_all() call
virtual bool check_activate() const =0
check if activation of the registered settings will work
virtual bool check_configuration(const display_configuration &dc) const =0
check given display configuration
virtual bool activate()=0
activate the display based on the registered settings or change the current display settings to the r...
virtual unsigned int get_registered_bit_depth() const =0
return the registered bit depth of a display pixel (this is changed by prepare_bit_depth)
virtual bool set_position(unsigned int x, unsigned int y)=0
set new position of the display within the virtual screen immediately, return whether this was succes...
virtual bool check_mode(const display_mode &dm) const =0
check given display mode
virtual bool register_position(unsigned int x, unsigned int y)=0
register new position of the display, which is activated in the next activate() or activate_all() cal...
virtual std::string get_ID() const =0
return the unique ID string of the display
virtual unsigned int get_bit_depth() const =0
return the current bit depth of the display pixels (only defined if display is active)
virtual int get_x() const =0
return the current current x coordinate within the virtual screen spanned by the desktop (only define...
virtual bool check_refresh_rate(unsigned int hz) const =0
check given refresh rate
virtual bool check_position(const display_position &dp) const =0
check given position
virtual bool check_bit_depth(unsigned int bits) const =0
check given bit depth
virtual bool set_position(const display_position &dp)=0
set the display position immediately, return whether this was successful. Only positions that result ...
virtual bool check_resolution(unsigned int w, unsigned int h) const =0
check given resolution
virtual unsigned int get_registered_height() const =0
return the registered height (this is changed by prepare_resolution)
virtual display_position get_position() const =0
return the current display position
virtual void show_display_modes(bool compatible_with_attached_monitor=true)=0
print out all available display modes
virtual bool set_mode(const display_mode &dm)=0
set the given display mode immediately, return whether this was successful. Only valid display modes ...
virtual bool is_active() const =0
return whether display is active
virtual bool set_resolution(unsigned int w, unsigned int h)=0
set new resolution of the display immediately, return whether this was successful....
virtual std::string get_description() const =0
return the description string of the display
virtual unsigned int get_refresh_rate() const =0
return the current refresh rate in Hz (only defined if display is active)
virtual bool register_configuration(const display_configuration &dc)=0
register new display configuration, which is activated in the next activate() or activate_all() call
the display configuration combines a display mode and the position of the display on the virtual scre...
display_configuration(const display_mode &dm=display_mode(), const display_position &dp=display_position())
constructor
display_mode mode
display mode
display_position position
display position
a display mode describes a valid setting of the display parameters
display_mode(unsigned int w=1024, unsigned int h=768, unsigned int bd=32, unsigned int rr=60)
constructor
unsigned int height
height in pixel
unsigned int refresh_rate
refresh rate in Hz
unsigned int width
width in pixel
unsigned int bit_depth
number of bits per pixel
the display position gives the signed x and y coordinates on the virtual screen
int y
signed y position on virtual screen
int x
signed x position on virtual screen
display_position(int _x=0, int _y=0)
constructor