You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Effective DisplayServer separation, rename X11 -> LinuxBSD
This commit is contained in:
committed by
Juan Linietsky
parent
4396e98834
commit
f8a79a97c7
@@ -51,6 +51,7 @@
|
||||
#include "scene/main/timer.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
#include "servers/display_server.h"
|
||||
#include "servers/physics_2d_server.h"
|
||||
|
||||
void ViewportTexture::setup_local_to_scene() {
|
||||
@@ -732,7 +733,7 @@ Rect2 Viewport::get_visible_rect() const {
|
||||
Rect2 r;
|
||||
|
||||
if (size == Size2()) {
|
||||
r = Rect2(Point2(), OS::get_singleton()->get_window_size());
|
||||
r = Rect2(Point2(), DisplayServer::get_singleton()->window_get_size());
|
||||
} else {
|
||||
r = Rect2(Point2(), size);
|
||||
}
|
||||
@@ -2172,7 +2173,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
||||
}
|
||||
|
||||
if (!over) {
|
||||
OS::get_singleton()->set_cursor_shape((OS::CursorShape)Input::get_singleton()->get_default_cursor_shape());
|
||||
DisplayServer::get_singleton()->cursor_set_shape((DisplayServer::CursorShape)Input::get_singleton()->get_default_cursor_shape());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2245,7 +2246,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
||||
}
|
||||
}
|
||||
|
||||
OS::get_singleton()->set_cursor_shape((OS::CursorShape)cursor_shape);
|
||||
DisplayServer::get_singleton()->cursor_set_shape((DisplayServer::CursorShape)cursor_shape);
|
||||
|
||||
if (over && over->can_process()) {
|
||||
_gui_call_input(over, mm);
|
||||
@@ -2258,9 +2259,9 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
||||
bool can_drop = _gui_drop(over, pos, true);
|
||||
|
||||
if (!can_drop) {
|
||||
OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN);
|
||||
DisplayServer::get_singleton()->cursor_set_shape(DisplayServer::CURSOR_FORBIDDEN);
|
||||
} else {
|
||||
OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP);
|
||||
DisplayServer::get_singleton()->cursor_set_shape(DisplayServer::CURSOR_CAN_DROP);
|
||||
}
|
||||
//change mouse accordingly i guess
|
||||
}
|
||||
@@ -3086,6 +3087,10 @@ void Viewport::_propagate_update_default_repeat(Node *p_node) {
|
||||
}
|
||||
}
|
||||
|
||||
DisplayServer::WindowID Viewport::get_window_id() const {
|
||||
return DisplayServer::MAIN_WINDOW_ID;
|
||||
}
|
||||
|
||||
void Viewport::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_use_arvr", "use"), &Viewport::set_use_arvr);
|
||||
|
||||
Reference in New Issue
Block a user