Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1b0bc67
Fix: Shadowed variable warning.
zorbathut May 22, 2025
4830c00
Fix: Accidentally introduced double-endif.
zorbathut May 22, 2025
3b9d331
Fix: Incorrect ref error-checking.
zorbathut May 22, 2025
12e7ddf
Fix: Missing virtual destructor on class with virtual functions.
zorbathut May 22, 2025
8b9c74f
Fix: Variable shadowing caused by new MethodInfo::hash.
zorbathut May 22, 2025
abfefcd
Fix: Missing headers in Windows.
zorbathut May 22, 2025
1ecd27d
Fix: Incorrect class name.
zorbathut May 25, 2025
48058f5
Fix: Incorrect #define boolean logic.
zorbathut May 23, 2025
51f4fc2
Fix: Missing registration for base class.
zorbathut May 23, 2025
c0ac53b
Update docs.
zorbathut May 23, 2025
e16eb64
Fix: Missing header in Android.
zorbathut May 23, 2025
4407d67
Fix: Windows surface teardown syntax.
zorbathut May 23, 2025
a4ae979
Revert added parameter to set_boot_image.
zorbathut May 23, 2025
52b9fd5
Fix: Missed variable name change.
zorbathut May 23, 2025
59cb90c
Fix: Ref nullification syntax.
zorbathut May 23, 2025
7e0300d
Fix: Incorrect function name.
zorbathut May 23, 2025
f0ec0d9
Fix: Incorrect class name.
zorbathut May 23, 2025
201807c
Fix: A few things that should have been function calls.
zorbathut May 23, 2025
1b00cb7
Add a default to fix a gcc warning.
zorbathut May 23, 2025
9ddc304
Fix: Windows headers polluting global defines and breaking RenderingD…
zorbathut May 23, 2025
a17d10a
Changes to get libgodot working on linux
nonameentername Jun 2, 2025
e3aad0f
Formatting fixes.
zorbathut Jun 4, 2025
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
2 changes: 2 additions & 0 deletions core/extension/godot_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class GodotInstanceCallbacks {
virtual void focus_in(GodotInstance *p_instance) {}
virtual void pause(GodotInstance *p_instance) {}
virtual void resume(GodotInstance *p_instance) {}

virtual ~GodotInstanceCallbacks() {}
};

class TaskExecutor {
Expand Down
22 changes: 11 additions & 11 deletions core/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,32 +170,32 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
uint32_t MethodInfo::get_compatibility_hash() const {
bool has_return = (return_val.type != Variant::NIL) || (return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT);

uint32_t hash = hash_murmur3_one_32(has_return);
hash = hash_murmur3_one_32(arguments.size(), hash);
uint32_t compat_hash = hash_murmur3_one_32(has_return);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine to avoid name collision.

compat_hash = hash_murmur3_one_32(arguments.size(), compat_hash);

if (has_return) {
hash = hash_murmur3_one_32(return_val.type, hash);
compat_hash = hash_murmur3_one_32(return_val.type, compat_hash);
if (return_val.class_name != StringName()) {
hash = hash_murmur3_one_32(return_val.class_name.hash(), hash);
compat_hash = hash_murmur3_one_32(return_val.class_name.hash(), compat_hash);
}
}

for (const PropertyInfo &arg : arguments) {
hash = hash_murmur3_one_32(arg.type, hash);
compat_hash = hash_murmur3_one_32(arg.type, compat_hash);
if (arg.class_name != StringName()) {
hash = hash_murmur3_one_32(arg.class_name.hash(), hash);
compat_hash = hash_murmur3_one_32(arg.class_name.hash(), compat_hash);
}
}

hash = hash_murmur3_one_32(default_arguments.size(), hash);
compat_hash = hash_murmur3_one_32(default_arguments.size(), compat_hash);
for (const Variant &v : default_arguments) {
hash = hash_murmur3_one_32(v.hash(), hash);
compat_hash = hash_murmur3_one_32(v.hash(), compat_hash);
}

hash = hash_murmur3_one_32(flags & METHOD_FLAG_CONST ? 1 : 0, hash);
hash = hash_murmur3_one_32(flags & METHOD_FLAG_VARARG ? 1 : 0, hash);
compat_hash = hash_murmur3_one_32(flags & METHOD_FLAG_CONST ? 1 : 0, compat_hash);
compat_hash = hash_murmur3_one_32(flags & METHOD_FLAG_VARARG ? 1 : 0, compat_hash);

return hash_fmix32(hash);
return hash_fmix32(compat_hash);
}

Object::Connection::operator Variant() const {
Expand Down
1 change: 1 addition & 0 deletions core/os/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define MINGW_STDTHREAD_REDUNDANCY_WARNING
#include "thirdparty/mingw-std-threads/mingw.mutex.h"
#define THREADING_NAMESPACE mingw_stdthread
#undef MemoryBarrier // override from Windows SDK, clashes with RenderingDeviceDriver::MemoryBarrier
#else
#include <mutex>
#define THREADING_NAMESPACE std
Expand Down
2 changes: 1 addition & 1 deletion core/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static_assert(__cplusplus >= 201703L);
#undef Error
#undef OK
#undef CONNECT_DEFERRED // override from Windows SDK, clashes with Object enum
#undef MemoryBarrier
#undef MemoryBarrier // override from Windows SDK, clashes with RenderingDeviceDriver::MemoryBarrier
#undef MONO_FONT
#endif

Expand Down
78 changes: 78 additions & 0 deletions doc/classes/DisplayServerEmbedded.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DisplayServerEmbedded" inherits="DisplayServer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_singleton" qualifiers="static">
<return type="DisplayServerEmbedded" />
<description>
</description>
</method>
<method name="key">
<return type="void" />
<param index="0" name="key" type="int" enum="Key" />
<param index="1" name="char" type="int" />
<param index="2" name="unshifted" type="int" enum="Key" />
<param index="3" name="physical" type="int" enum="Key" />
<param index="4" name="modifiers" type="int" enum="KeyModifierMask" is_bitfield="true" />
<param index="5" name="pressed" type="bool" />
<param index="6" name="window" type="int" default="0" />
<description>
</description>
</method>
<method name="resize_window">
<return type="void" />
<param index="0" name="size" type="Vector2i" />
<param index="1" name="id" type="int" />
<description>
</description>
</method>
<method name="set_content_scale">
<return type="void" />
<param index="0" name="content_scale" type="float" />
<description>
</description>
</method>
<method name="set_native_surface" qualifiers="static">
<return type="void" />
<param index="0" name="native_surface" type="RenderingNativeSurface" />
<description>
</description>
</method>
<method name="touch_drag">
<return type="void" />
<param index="0" name="idx" type="int" />
<param index="1" name="prev_x" type="int" />
<param index="2" name="prev_y" type="int" />
<param index="3" name="x" type="int" />
<param index="4" name="y" type="int" />
<param index="5" name="pressure" type="float" />
<param index="6" name="tilt" type="Vector2" />
<param index="7" name="window" type="int" />
<description>
</description>
</method>
<method name="touch_press">
<return type="void" />
<param index="0" name="idx" type="int" />
<param index="1" name="x" type="int" />
<param index="2" name="y" type="int" />
<param index="3" name="pressed" type="bool" />
<param index="4" name="double_click" type="bool" />
<param index="5" name="window" type="int" />
<description>
</description>
</method>
<method name="touches_canceled">
<return type="void" />
<param index="0" name="idx" type="int" />
<param index="1" name="window" type="int" />
<description>
</description>
</method>
</methods>
</class>
7 changes: 7 additions & 0 deletions doc/classes/GDExtensionManager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
Loads an extension by absolute file path. The [param path] needs to point to a valid [GDExtension]. Returns [constant LOAD_STATUS_OK] if successful.
</description>
</method>
<method name="load_function_extension">
<return type="int" enum="GDExtensionManager.LoadStatus" />
<param index="0" name="path" type="String" />
<param index="1" name="init_func" type="const GDExtensionInitializationFunction*" />
<description>
</description>
</method>
<method name="reload_extension">
<return type="int" enum="GDExtensionManager.LoadStatus" />
<param index="0" name="path" type="String" />
Expand Down
53 changes: 53 additions & 0 deletions doc/classes/GodotInstance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GodotInstance" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="execute">
<return type="void" />
<param index="0" name="callback" type="Callable" />
<param index="1" name="async" type="bool" />
<description>
</description>
</method>
<method name="focus_in">
<return type="void" />
<description>
</description>
</method>
<method name="focus_out">
<return type="void" />
<description>
</description>
</method>
<method name="is_started">
<return type="bool" />
<description>
</description>
</method>
<method name="iteration">
<return type="bool" />
<description>
</description>
</method>
<method name="pause">
<return type="void" />
<description>
</description>
</method>
<method name="resume">
<return type="void" />
<description>
</description>
</method>
<method name="start">
<return type="bool" />
<description>
</description>
</method>
</methods>
</class>
9 changes: 9 additions & 0 deletions doc/classes/RenderingNativeSurface.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RenderingNativeSurface" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
</class>
17 changes: 17 additions & 0 deletions doc/classes/RenderingNativeSurfaceVulkan.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RenderingNativeSurfaceVulkan" inherits="RenderingNativeSurface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="create" qualifiers="static">
<return type="RenderingNativeSurfaceVulkan" />
<param index="0" name="vulkan_surface" type="const void*" />
<description>
</description>
</method>
</methods>
</class>
18 changes: 18 additions & 0 deletions doc/classes/RenderingNativeSurfaceWayland.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RenderingNativeSurfaceWayland" inherits="RenderingNativeSurface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="create" qualifiers="static">
<return type="RenderingNativeSurfaceWayland" />
<param index="0" name="window" type="const void*" />
<param index="1" name="display" type="const void*" />
<description>
</description>
</method>
</methods>
</class>
18 changes: 18 additions & 0 deletions doc/classes/RenderingNativeSurfaceX11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="RenderingNativeSurfaceX11" inherits="RenderingNativeSurface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="create" qualifiers="static">
<return type="RenderingNativeSurfaceX11" />
<param index="0" name="window" type="const void*" />
<param index="1" name="display" type="const void*" />
<description>
</description>
</method>
</methods>
</class>
11 changes: 11 additions & 0 deletions doc/classes/Window.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@
Returns layout direction and text writing direction.
</description>
</method>
<method name="get_native_surface">
<return type="RenderingNativeSurface" />
<description>
</description>
</method>
<method name="get_position_with_decorations" qualifiers="const">
<return type="Vector2i" />
<description>
Expand Down Expand Up @@ -536,6 +541,12 @@
Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
</description>
</method>
<method name="set_native_surface">
<return type="void" />
<param index="0" name="native_surface" type="RenderingNativeSurface" />
<description>
</description>
</method>
<method name="set_unparent_when_invisible">
<return type="void" />
<param index="0" name="unparent" type="bool" />
Expand Down
1 change: 1 addition & 0 deletions drivers/d3d12/rendering_context_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/string/ustring.h"
#include "core/templates/local_vector.h"
#include "core/version.h"
#include "platform/windows/rendering_native_surface_windows.h"
#include "servers/rendering/rendering_device.h"

#if defined(__GNUC__) && !defined(__clang__)
Expand Down
5 changes: 1 addition & 4 deletions drivers/d3d12/rendering_device_driver_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@

#include <wrl/client.h>

#if defined(_MSC_VER) && defined(MemoryBarrier)
// Annoying define from winnt.h. Reintroduced by some of the headers above.
#undef MemoryBarrier
#endif
#undef MemoryBarrier // override from Windows SDK, clashes with RenderingDeviceDriver::MemoryBarrier

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
Expand Down
8 changes: 4 additions & 4 deletions drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,19 @@ void RasterizerGLES3::blit_render_targets_to_screen(DisplayServer::WindowID p_sc
}
}

void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, DisplayServer::WindowID p_screen, bool p_use_filter) {
void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) {
if (p_image.is_null() || p_image->is_empty()) {
return;
}

Size2i win_size = DisplayServer::get_singleton()->window_get_size(p_screen);
Size2i win_size = DisplayServer::get_singleton()->window_get_size();

if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
// This is currently needed for GLES to keep the current window being rendered to up to date
DisplayServer::get_singleton()->gl_window_make_current(p_screen);
DisplayServer::get_singleton()->gl_window_make_current(DisplayServer::MAIN_WINDOW_ID);
}

glBindFramebuffer(GL_FRAMEBUFFER, DisplayServer::get_singleton()->window_get_native_handle(DisplayServer::OPENGL_FBO, p_screen));
glBindFramebuffer(GL_FRAMEBUFFER, DisplayServer::get_singleton()->window_get_native_handle(DisplayServer::OPENGL_FBO));
glViewport(0, 0, win_size.width, win_size.height);
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class RasterizerGLES3 : public RendererCompositor {
RendererCanvasRender *get_canvas() { return canvas; }
RendererSceneRender *get_scene() { return scene; }

void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, DisplayServer::WindowID p_screen, bool p_use_filter = true);
void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter = true);

void initialize();
void begin_frame(double frame_step);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/storage/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class FramebufferBinding {

FramebufferBinding(GLenum p_target, GLuint p_framebuffer, bool p_bind) {
target = p_target;
GLenum binding_target;
GLenum binding_target = 0;
switch (p_target) {
case GL_FRAMEBUFFER:
binding_target = GL_FRAMEBUFFER_BINDING;
Expand Down
2 changes: 2 additions & 0 deletions drivers/register_driver_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ static Ref<ImageLoaderPNG> image_loader_png;
static Ref<ResourceSaverPNG> resource_saver_png;

void register_core_driver_types() {
GDREGISTER_ABSTRACT_CLASS(RenderingNativeSurface)

#ifdef VULKAN_ENABLED
GDREGISTER_ABSTRACT_CLASS(RenderingNativeSurfaceVulkan)
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/vulkan/rendering_context_driver_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ void RenderingContextDriverVulkan::driver_free(RenderingDeviceDriver *p_driver)

RenderingContextDriver::SurfaceID RenderingContextDriverVulkan::surface_create(Ref<RenderingNativeSurface> p_native_surface) {
Ref<RenderingNativeSurfaceVulkan> vulkan_native_surface = Object::cast_to<RenderingNativeSurfaceVulkan>(*p_native_surface);
ERR_FAIL_COND_V(vulkan_native_surface == nullptr, SurfaceID());
ERR_FAIL_COND_V(vulkan_native_surface.is_null(), SurfaceID());

Surface *surface = memnew(Surface);
surface->vk_surface = vulkan_native_surface->get_vulkan_surface();
Expand Down
1 change: 1 addition & 0 deletions platform/android/display_server_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "java_godot_io_wrapper.h"
#include "java_godot_wrapper.h"
#include "os_android.h"
#include "rendering_native_surface_android.h"
#include "tts_android.h"

#include "core/config/project_settings.h"
Expand Down
Loading