Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenXR: Allow GDExtensions to implement _on_pre_draw_viewport() and _on_post_draw_viewport() #98831

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/openxr/doc_classes/OpenXRExtensionWrapperExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@
Called right after the main swapchains are (re)created.
</description>
</method>
<method name="_on_post_draw_viewport" qualifiers="virtual">
<return type="void" />
<param index="0" name="viewport" type="RID" />
<description>
Called right after the given viewport is rendered.
[b]Note:[/b] The draw commands might only be queued at this point, not executed.
</description>
</method>
<method name="_on_pre_draw_viewport" qualifiers="virtual">
<return type="void" />
<param index="0" name="viewport" type="RID" />
<description>
Called right before the given viewport is rendered.
</description>
</method>
<method name="_on_pre_render" qualifiers="virtual">
<return type="void" />
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ void OpenXRExtensionWrapperExtension::_bind_methods() {
GDVIRTUAL_BIND(_on_process);
GDVIRTUAL_BIND(_on_pre_render);
GDVIRTUAL_BIND(_on_main_swapchains_created);
GDVIRTUAL_BIND(_on_pre_draw_viewport, "viewport");
GDVIRTUAL_BIND(_on_post_draw_viewport, "viewport");
GDVIRTUAL_BIND(_on_session_destroyed);
GDVIRTUAL_BIND(_on_state_idle);
GDVIRTUAL_BIND(_on_state_ready);
Expand Down Expand Up @@ -208,6 +210,14 @@ void OpenXRExtensionWrapperExtension::on_session_destroyed() {
GDVIRTUAL_CALL(_on_session_destroyed);
}

void OpenXRExtensionWrapperExtension::on_pre_draw_viewport(RID p_render_target) {
GDVIRTUAL_CALL(_on_pre_draw_viewport, p_render_target);
}

void OpenXRExtensionWrapperExtension::on_post_draw_viewport(RID p_render_target) {
GDVIRTUAL_CALL(_on_post_draw_viewport, p_render_target);
}

void OpenXRExtensionWrapperExtension::on_state_idle() {
GDVIRTUAL_CALL(_on_state_idle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class OpenXRExtensionWrapperExtension : public Object, public OpenXRExtensionWra
virtual void on_pre_render() override;
virtual void on_main_swapchains_created() override;
virtual void on_session_destroyed() override;
virtual void on_pre_draw_viewport(RID p_render_target) override;
virtual void on_post_draw_viewport(RID p_render_target) override;

GDVIRTUAL0(_on_register_metadata);
GDVIRTUAL0(_on_before_instance_created);
Expand All @@ -98,6 +100,8 @@ class OpenXRExtensionWrapperExtension : public Object, public OpenXRExtensionWra
GDVIRTUAL0(_on_pre_render);
GDVIRTUAL0(_on_main_swapchains_created);
GDVIRTUAL0(_on_session_destroyed);
GDVIRTUAL1(_on_pre_draw_viewport, RID);
GDVIRTUAL1(_on_post_draw_viewport, RID);

virtual void on_state_idle() override;
virtual void on_state_ready() override;
Expand Down
Loading