godot/scene/main/viewport.cpp

/**************************************************************************/
/*  viewport.cpp                                                          */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "viewport.h"

#include "core/config/project_settings.h"
#include "core/debugger/engine_debugger.h"
#include "core/string/translation.h"
#include "core/templates/pair.h"
#include "core/templates/sort_array.h"
#include "scene/2d/audio_listener_2d.h"
#include "scene/2d/camera_2d.h"
#include "scene/2d/physics/collision_object_2d.h"
#ifndef _3D_DISABLED
#include "scene/3d/audio_listener_3d.h"
#include "scene/3d/camera_3d.h"
#include "scene/3d/physics/collision_object_3d.h"
#include "scene/3d/world_environment.h"
#endif // _3D_DISABLED
#include "scene/gui/control.h"
#include "scene/gui/label.h"
#include "scene/gui/popup.h"
#include "scene/gui/popup_menu.h"
#include "scene/gui/subviewport_container.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
#include "scene/resources/mesh.h"
#include "scene/resources/text_line.h"
#include "scene/resources/world_2d.h"
#include "servers/audio_server.h"
#include "servers/rendering/rendering_server_globals.h"

void ViewportTexture::setup_local_to_scene() {}

void ViewportTexture::reset_local_to_scene() {}

void ViewportTexture::set_viewport_path_in_scene(const NodePath &p_path) {}

NodePath ViewportTexture::get_viewport_path_in_scene() const {}

int ViewportTexture::get_width() const {}

int ViewportTexture::get_height() const {}

Size2 ViewportTexture::get_size() const {}

RID ViewportTexture::get_rid() const {}

bool ViewportTexture::has_alpha() const {}

Ref<Image> ViewportTexture::get_image() const {}

void ViewportTexture::_err_print_viewport_not_set() const {}

void ViewportTexture::_setup_local_to_scene(const Node *p_loc_scene) {}

void ViewportTexture::_bind_methods() {}

ViewportTexture::ViewportTexture() {}

ViewportTexture::~ViewportTexture() {}

void Viewport::_process_dirty_canvas_parent_orders() {}

void Viewport::_sub_window_update_order() {}

void Viewport::_sub_window_register(Window *p_window) {}

void Viewport::_sub_window_update(Window *p_window) {}

void Viewport::_sub_window_grab_focus(Window *p_window) {}

void Viewport::_sub_window_remove(Window *p_window) {}

int Viewport::_sub_window_find(Window *p_window) const {}

void Viewport::_update_viewport_path() {}

void Viewport::_notification(int p_what) {}

void Viewport::_process_picking() {}

RID Viewport::get_viewport_rid() const {}

void Viewport::update_canvas_items() {}

bool Viewport::_set_size(const Size2i &p_size, const Size2i &p_size_2d_override, bool p_allocated) {}

Size2i Viewport::_get_size() const {}

Size2i Viewport::_get_size_2d_override() const {}

bool Viewport::_is_size_allocated() const {}

Rect2 Viewport::get_visible_rect() const {}

void Viewport::canvas_parent_mark_dirty(Node *p_node) {}

void Viewport::enable_canvas_transform_override(bool p_enable) {}

bool Viewport::is_canvas_transform_override_enabled() const {}

void Viewport::set_canvas_transform_override(const Transform2D &p_transform) {}

Transform2D Viewport::get_canvas_transform_override() const {}

void Viewport::set_canvas_transform(const Transform2D &p_transform) {}

Transform2D Viewport::get_canvas_transform() const {}

void Viewport::_update_global_transform() {}

void Viewport::set_global_canvas_transform(const Transform2D &p_transform) {}

Transform2D Viewport::get_global_canvas_transform() const {}

void Viewport::_canvas_layer_add(CanvasLayer *p_canvas_layer) {}

void Viewport::_canvas_layer_remove(CanvasLayer *p_canvas_layer) {}

void Viewport::set_transparent_background(bool p_enable) {}

bool Viewport::has_transparent_background() const {}

void Viewport::set_use_hdr_2d(bool p_enable) {}

bool Viewport::is_using_hdr_2d() const {}

void Viewport::set_world_2d(const Ref<World2D> &p_world_2d) {}

Ref<World2D> Viewport::find_world_2d() const {}

void Viewport::_propagate_drag_notification(Node *p_node, int p_what) {}

Ref<World2D> Viewport::get_world_2d() const {}

Transform2D Viewport::get_stretch_transform() const {}

Transform2D Viewport::get_final_transform() const {}

void Viewport::_update_canvas_items(Node *p_node) {}

Ref<ViewportTexture> Viewport::get_texture() const {}

void Viewport::set_positional_shadow_atlas_size(int p_size) {}

int Viewport::get_positional_shadow_atlas_size() const {}

void Viewport::set_positional_shadow_atlas_16_bits(bool p_16_bits) {}

bool Viewport::get_positional_shadow_atlas_16_bits() const {}
void Viewport::set_positional_shadow_atlas_quadrant_subdiv(int p_quadrant, PositionalShadowAtlasQuadrantSubdiv p_subdiv) {}

Viewport::PositionalShadowAtlasQuadrantSubdiv Viewport::get_positional_shadow_atlas_quadrant_subdiv(int p_quadrant) const {}

Ref<InputEvent> Viewport::_make_input_local(const Ref<InputEvent> &ev) {}

Vector2 Viewport::get_mouse_position() const {}

void Viewport::warp_mouse(const Vector2 &p_position) {}

void Viewport::_gui_sort_roots() {}

void Viewport::_gui_cancel_tooltip() {}

String Viewport::_gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Control **r_tooltip_owner) {}

void Viewport::_gui_show_tooltip() {}

void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_input) {}

void Viewport::_gui_call_notification(Control *p_control, int p_what) {}

Control *Viewport::gui_find_control(const Point2 &p_global) {}

Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform) {}

bool Viewport::_gui_drop(Control *p_at_control, Point2 p_at_pos, bool p_just_check) {}

void Viewport::_gui_input_event(Ref<InputEvent> p_event) {}

void Viewport::_perform_drop(Control *p_control) {}

void Viewport::_gui_cleanup_internal_state(Ref<InputEvent> p_event) {}

List<Control *>::Element *Viewport::_gui_add_root_control(Control *p_control) {}

void Viewport::gui_set_root_order_dirty() {}

void Viewport::_gui_force_drag(Control *p_base, const Variant &p_data, Control *p_control) {}

void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) {}

Control *Viewport::_gui_get_drag_preview() {}

void Viewport::_gui_remove_root_control(List<Control *>::Element *RI) {}

void Viewport::_gui_unfocus_control(Control *p_control) {}

void Viewport::_gui_hide_control(Control *p_control) {}

void Viewport::_gui_remove_control(Control *p_control) {}

void Viewport::canvas_item_top_level_changed() {}

void Viewport::_gui_update_mouse_over() {}

Window *Viewport::get_base_window() {}

void Viewport::_gui_remove_focus_for_window(Node *p_window) {}

bool Viewport::_gui_control_has_focus(const Control *p_control) {}

void Viewport::_gui_control_grab_focus(Control *p_control) {}

void Viewport::_gui_accept_event() {}

void Viewport::_drop_mouse_focus() {}

void Viewport::_drop_physics_mouseover(bool p_paused_only) {}

void Viewport::_gui_grab_click_focus(Control *p_control) {}

void Viewport::_post_gui_grab_click_focus() {}

///////////////////////////////

void Viewport::push_text_input(const String &p_text) {}

Viewport::SubWindowResize Viewport::_sub_window_get_resize_margin(Window *p_subwindow, const Point2 &p_point) {}

bool Viewport::_sub_windows_forward_input(const Ref<InputEvent> &p_event) {}

void Viewport::_update_mouse_over() {}

void Viewport::_update_mouse_over(Vector2 p_pos) {}

void Viewport::_mouse_leave_viewport() {}

void Viewport::_drop_mouse_over(Control *p_until_control) {}

void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) {}

#ifndef DISABLE_DEPRECATED
void Viewport::push_unhandled_input(const Ref<InputEvent> &p_event, bool p_local_coords) {}
#endif // DISABLE_DEPRECATED

void Viewport::_push_unhandled_input_internal(const Ref<InputEvent> &p_event) {}

void Viewport::set_physics_object_picking(bool p_enable) {}

bool Viewport::get_physics_object_picking() {}

void Viewport::set_physics_object_picking_sort(bool p_enable) {}

bool Viewport::get_physics_object_picking_sort() {}

void Viewport::set_physics_object_picking_first_only(bool p_enable) {}

bool Viewport::get_physics_object_picking_first_only() {}

Vector2 Viewport::get_camera_coords(const Vector2 &p_viewport_coords) const {}

Vector2 Viewport::get_camera_rect_size() const {}

void Viewport::set_disable_input(bool p_disable) {}

bool Viewport::is_input_disabled() const {}

void Viewport::set_disable_input_override(bool p_disable) {}

Variant Viewport::gui_get_drag_data() const {}

PackedStringArray Viewport::get_configuration_warnings() const {}

void Viewport::gui_reset_canvas_sort_index() {}

int Viewport::gui_get_canvas_sort_index() {}

void Viewport::gui_release_focus() {}

Control *Viewport::gui_get_focus_owner() const {}

Control *Viewport::gui_get_hovered_control() const {}

void Viewport::set_msaa_2d(MSAA p_msaa) {}

Viewport::MSAA Viewport::get_msaa_2d() const {}

void Viewport::set_msaa_3d(MSAA p_msaa) {}

Viewport::MSAA Viewport::get_msaa_3d() const {}

void Viewport::set_screen_space_aa(ScreenSpaceAA p_screen_space_aa) {}

Viewport::ScreenSpaceAA Viewport::get_screen_space_aa() const {}

void Viewport::set_use_taa(bool p_use_taa) {}

bool Viewport::is_using_taa() const {}

void Viewport::set_use_debanding(bool p_use_debanding) {}

bool Viewport::is_using_debanding() const {}

void Viewport::set_mesh_lod_threshold(float p_pixels) {}

float Viewport::get_mesh_lod_threshold() const {}

void Viewport::set_use_occlusion_culling(bool p_use_occlusion_culling) {}

bool Viewport::is_using_occlusion_culling() const {}

void Viewport::set_debug_draw(DebugDraw p_debug_draw) {}

Viewport::DebugDraw Viewport::get_debug_draw() const {}

int Viewport::get_render_info(RenderInfoType p_type, RenderInfo p_info) {}

void Viewport::set_snap_controls_to_pixels(bool p_enable) {}

bool Viewport::is_snap_controls_to_pixels_enabled() const {}

void Viewport::set_snap_2d_transforms_to_pixel(bool p_enable) {}

bool Viewport::is_snap_2d_transforms_to_pixel_enabled() const {}

void Viewport::set_snap_2d_vertices_to_pixel(bool p_enable) {}

bool Viewport::is_snap_2d_vertices_to_pixel_enabled() const {}

bool Viewport::gui_is_dragging() const {}

bool Viewport::gui_is_drag_successful() const {}

void Viewport::gui_cancel_drag() {}

void Viewport::set_input_as_handled() {}

bool Viewport::is_input_handled() const {}

void Viewport::set_handle_input_locally(bool p_enable) {}

bool Viewport::is_handling_input_locally() const {}

void Viewport::set_default_canvas_item_texture_filter(DefaultCanvasItemTextureFilter p_filter) {}

Viewport::DefaultCanvasItemTextureFilter Viewport::get_default_canvas_item_texture_filter() const {}

void Viewport::set_default_canvas_item_texture_repeat(DefaultCanvasItemTextureRepeat p_repeat) {}

Viewport::DefaultCanvasItemTextureRepeat Viewport::get_default_canvas_item_texture_repeat() const {}

void Viewport::set_vrs_mode(Viewport::VRSMode p_vrs_mode) {}

Viewport::VRSMode Viewport::get_vrs_mode() const {}

void Viewport::set_vrs_update_mode(VRSUpdateMode p_vrs_update_mode) {}

Viewport::VRSUpdateMode Viewport::get_vrs_update_mode() const {}

void Viewport::set_vrs_texture(Ref<Texture2D> p_texture) {}

Ref<Texture2D> Viewport::get_vrs_texture() const {}

DisplayServer::WindowID Viewport::get_window_id() const {}

Viewport *Viewport::get_parent_viewport() const {}

void Viewport::set_embedding_subwindows(bool p_embed) {}

bool Viewport::is_embedding_subwindows() const {}

TypedArray<Window> Viewport::get_embedded_subwindows() const {}

void Viewport::subwindow_set_popup_safe_rect(Window *p_window, const Rect2i &p_rect) {}

Rect2i Viewport::subwindow_get_popup_safe_rect(Window *p_window) const {}

void Viewport::set_sdf_oversize(SDFOversize p_sdf_oversize) {}

Viewport::SDFOversize Viewport::get_sdf_oversize() const {}

void Viewport::set_sdf_scale(SDFScale p_sdf_scale) {}

Viewport::SDFScale Viewport::get_sdf_scale() const {}

Transform2D Viewport::get_screen_transform() const {}

Transform2D Viewport::get_screen_transform_internal(bool p_absolute_position) const {}

void Viewport::update_mouse_cursor_state() {}

void Viewport::set_canvas_cull_mask(uint32_t p_canvas_cull_mask) {}

uint32_t Viewport::get_canvas_cull_mask() const {}

void Viewport::set_canvas_cull_mask_bit(uint32_t p_layer, bool p_enable) {}

bool Viewport::get_canvas_cull_mask_bit(uint32_t p_layer) const {}

void Viewport::_update_audio_listener_2d() {}

void Viewport::_audio_listener_2d_set(AudioListener2D *p_audio_listener) {}

void Viewport::_audio_listener_2d_remove(AudioListener2D *p_audio_listener) {}

void Viewport::_camera_2d_set(Camera2D *p_camera_2d) {}

void Viewport::_cleanup_mouseover_colliders(bool p_clean_all_frames, bool p_paused_only, uint64_t p_frame_reference) {}

AudioListener2D *Viewport::get_audio_listener_2d() const {}

void Viewport::set_as_audio_listener_2d(bool p_enable) {}

bool Viewport::is_audio_listener_2d() const {}

Camera2D *Viewport::get_camera_2d() const {}

void Viewport::assign_next_enabled_camera_2d(const StringName &p_camera_group) {}

#ifndef _3D_DISABLED
AudioListener3D *Viewport::get_audio_listener_3d() const {}

void Viewport::set_as_audio_listener_3d(bool p_enable) {}

bool Viewport::is_audio_listener_3d() const {}

void Viewport::_update_audio_listener_3d() {}

void Viewport::_listener_transform_3d_changed_notify() {}

void Viewport::_audio_listener_3d_set(AudioListener3D *p_listener) {}

bool Viewport::_audio_listener_3d_add(AudioListener3D *p_listener) {}

void Viewport::_audio_listener_3d_remove(AudioListener3D *p_listener) {}

void Viewport::_audio_listener_3d_make_next_current(AudioListener3D *p_exclude) {}

void Viewport::_collision_object_3d_input_event(CollisionObject3D *p_object, Camera3D *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) {}

Camera3D *Viewport::get_camera_3d() const {}

void Viewport::_camera_3d_transform_changed_notify() {}

void Viewport::_camera_3d_set(Camera3D *p_camera) {}

bool Viewport::_camera_3d_add(Camera3D *p_camera) {}

void Viewport::_camera_3d_remove(Camera3D *p_camera) {}

void Viewport::_camera_3d_make_next_current(Camera3D *p_exclude) {}

void Viewport::enable_camera_3d_override(bool p_enable) {}

void Viewport::set_camera_3d_override_perspective(real_t p_fovy_degrees, real_t p_z_near, real_t p_z_far) {}

void Viewport::set_camera_3d_override_orthogonal(real_t p_size, real_t p_z_near, real_t p_z_far) {}

HashMap<StringName, real_t> Viewport::get_camera_3d_override_properties() const {}

void Viewport::set_disable_3d(bool p_disable) {}

bool Viewport::is_3d_disabled() const {}

bool Viewport::is_camera_3d_override_enabled() const {}

void Viewport::set_camera_3d_override_transform(const Transform3D &p_transform) {}

Transform3D Viewport::get_camera_3d_override_transform() const {}

Vector3 Viewport::camera_3d_override_project_ray_normal(const Point2 &p_pos) const {}

Vector3 Viewport::camera_3d_override_project_local_ray_normal(const Point2 &p_pos) const {}

Vector3 Viewport::camera_3d_override_project_ray_origin(const Point2 &p_pos) const {}

Ref<World3D> Viewport::get_world_3d() const {}

Ref<World3D> Viewport::find_world_3d() const {}

void Viewport::set_world_3d(const Ref<World3D> &p_world_3d) {}

void Viewport::_own_world_3d_changed() {}

void Viewport::set_use_own_world_3d(bool p_use_own_world_3d) {}

bool Viewport::is_using_own_world_3d() const {}

void Viewport::_propagate_enter_world_3d(Node *p_node) {}

void Viewport::_propagate_exit_world_3d(Node *p_node) {}

void Viewport::set_use_xr(bool p_use_xr) {}

bool Viewport::is_using_xr() {}

void Viewport::set_scaling_3d_mode(Scaling3DMode p_scaling_3d_mode) {}

Viewport::Scaling3DMode Viewport::get_scaling_3d_mode() const {}

void Viewport::set_scaling_3d_scale(float p_scaling_3d_scale) {}

float Viewport::get_scaling_3d_scale() const {}

void Viewport::set_fsr_sharpness(float p_fsr_sharpness) {}

float Viewport::get_fsr_sharpness() const {}

void Viewport::set_texture_mipmap_bias(float p_texture_mipmap_bias) {}

float Viewport::get_texture_mipmap_bias() const {}

#endif // _3D_DISABLED

void Viewport::_propagate_world_2d_changed(Node *p_node) {}

void Viewport::_bind_methods() {}

void Viewport::_validate_property(PropertyInfo &p_property) const {}

Viewport::Viewport() {}

Viewport::~Viewport() {}

/////////////////////////////////

void SubViewport::set_size(const Size2i &p_size) {}

void SubViewport::set_size_force(const Size2i &p_size) {}

void SubViewport::_internal_set_size(const Size2i &p_size, bool p_force) {}

Size2i SubViewport::get_size() const {}

void SubViewport::set_size_2d_override(const Size2i &p_size) {}

Size2i SubViewport::get_size_2d_override() const {}

void SubViewport::set_size_2d_override_stretch(bool p_enable) {}

bool SubViewport::is_size_2d_override_stretch_enabled() const {}

void SubViewport::set_update_mode(UpdateMode p_mode) {}

SubViewport::UpdateMode SubViewport::get_update_mode() const {}

void SubViewport::set_clear_mode(ClearMode p_mode) {}

SubViewport::ClearMode SubViewport::get_clear_mode() const {}

DisplayServer::WindowID SubViewport::get_window_id() const {}

Transform2D SubViewport::get_screen_transform_internal(bool p_absolute_position) const {}

Transform2D SubViewport::get_popup_base_transform() const {}

Viewport *SubViewport::get_section_root_viewport() const {}

bool SubViewport::is_attached_in_viewport() const {}

void SubViewport::_notification(int p_what) {}

void SubViewport::_bind_methods() {}

void SubViewport::_validate_property(PropertyInfo &p_property) const {}

SubViewport::SubViewport() {}

SubViewport::~SubViewport() {}