get_screen_count() added
This commit is contained in:
parent
466e251abe
commit
3c8b047b11
5 changed files with 15 additions and 0 deletions
|
@ -176,6 +176,10 @@ bool _OS::is_video_mode_fullscreen(int p_screen) const {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int _OS::get_screen_count() const {
|
||||||
|
return OS::get_singleton()->get_screen_count();
|
||||||
|
}
|
||||||
|
|
||||||
Point2 _OS::get_window_position() const {
|
Point2 _OS::get_window_position() const {
|
||||||
return OS::get_singleton()->get_window_position();
|
return OS::get_singleton()->get_window_position();
|
||||||
}
|
}
|
||||||
|
@ -656,6 +660,7 @@ void _OS::_bind_methods() {
|
||||||
ObjectTypeDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0));
|
ObjectTypeDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0));
|
||||||
ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0));
|
ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0));
|
||||||
|
|
||||||
|
ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count);
|
||||||
ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position);
|
ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position);
|
||||||
ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position);
|
ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position);
|
||||||
ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size);
|
ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size);
|
||||||
|
|
|
@ -108,6 +108,7 @@ public:
|
||||||
bool is_video_mode_resizable(int p_screen=0) const;
|
bool is_video_mode_resizable(int p_screen=0) const;
|
||||||
Array get_fullscreen_mode_list(int p_screen=0) const;
|
Array get_fullscreen_mode_list(int p_screen=0) const;
|
||||||
|
|
||||||
|
virtual int get_screen_count() const;
|
||||||
virtual Point2 get_window_position() const;
|
virtual Point2 get_window_position() const;
|
||||||
virtual void set_window_position(const Point2& p_position);
|
virtual void set_window_position(const Point2& p_position);
|
||||||
virtual Size2 get_window_size() const;
|
virtual Size2 get_window_size() const;
|
||||||
|
|
|
@ -150,6 +150,7 @@ public:
|
||||||
virtual VideoMode get_video_mode(int p_screen=0) const=0;
|
virtual VideoMode get_video_mode(int p_screen=0) const=0;
|
||||||
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const=0;
|
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const=0;
|
||||||
|
|
||||||
|
virtual int get_screen_count() const=0;
|
||||||
virtual Point2 get_window_position() const=0;
|
virtual Point2 get_window_position() const=0;
|
||||||
virtual void set_window_position(const Point2& p_position)=0;
|
virtual void set_window_position(const Point2& p_position)=0;
|
||||||
virtual Size2 get_window_size() const=0;
|
virtual Size2 get_window_size() const=0;
|
||||||
|
|
|
@ -526,6 +526,10 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) {
|
||||||
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
|
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int OS_X11::get_screen_count() const {
|
||||||
|
return XScreenCount(x11_display);
|
||||||
|
}
|
||||||
|
|
||||||
Point2 OS_X11::get_window_position() const {
|
Point2 OS_X11::get_window_position() const {
|
||||||
int x,y;
|
int x,y;
|
||||||
XWindowAttributes xwa;
|
XWindowAttributes xwa;
|
||||||
|
@ -597,6 +601,9 @@ void OS_X11::set_window_size(const Size2 p_size) {
|
||||||
|
|
||||||
void OS_X11::set_fullscreen(bool p_enabled,int p_screen) {
|
void OS_X11::set_fullscreen(bool p_enabled,int p_screen) {
|
||||||
|
|
||||||
|
if(p_enabled && current_videomode.fullscreen)
|
||||||
|
return;
|
||||||
|
|
||||||
if(p_enabled) {
|
if(p_enabled) {
|
||||||
pre_videomode = current_videomode;
|
pre_videomode = current_videomode;
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,7 @@ public:
|
||||||
virtual VideoMode get_video_mode(int p_screen=0) const;
|
virtual VideoMode get_video_mode(int p_screen=0) const;
|
||||||
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const;
|
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const;
|
||||||
|
|
||||||
|
virtual int get_screen_count() const;
|
||||||
virtual Point2 get_window_position() const;
|
virtual Point2 get_window_position() const;
|
||||||
virtual void set_window_position(const Point2& p_position);
|
virtual void set_window_position(const Point2& p_position);
|
||||||
virtual Size2 get_window_size() const;
|
virtual Size2 get_window_size() const;
|
||||||
|
|
Loading…
Reference in a new issue