Lecrapouille / gdcef

[Plugin][Version 0.10.0][Functional] Chromium Embedded Framework Webview for Godot 3 and 4
https://discord.gg/EckEwy7S5U
MIT License
222 stars 26 forks source link

Please add support for Godot-4.0 #30

Closed abetafish closed 8 months ago

abetafish commented 1 year ago

I modified MODULE_TARGET = "release" and GODOT_CPP_TARGET = "release" to MODULE_TARGET = "template_release" and GODOT_CPP_TARGET = "template_release" (It won't even work if I don't) ,After that it outputs many errors errors

Lecrapouille commented 1 year ago

@abetafish yes, as said Godot 4, is not (yet) supported. Because of my new job, I've no more time for my personal projects. I guess we have just to add some #ifdef in the c++ code, but the Godot doc is sometimes very unclear.

In your case you have just a missing lib: maybe sudo apt-get install libxcb-dri3-dev

Lecrapouille commented 1 year ago

I added a quick and dirty commit and have commented some of my code. As good devs, the Godot devs broke all API, compilation, lib name, but with some #ifdef this module can be compatible with Godot 4 and 3. Currently they make me lost compatibility with my hack to display CEF in a texture. I'm not sure to loose time making compatible, but feel free to fix my commit in the https://github.com/Lecrapouille/gdcef/tree/dev-godot-4 branch and do some pull requests.

sanath-narasimhan commented 1 year ago

I am trying to run it with Godot Engine v4.0.2.stable.mono.official.7a0977ce2 - https://godotengine.org Vulkan API 1.3.205 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1060.

Was able to get the build folder but the demo projects don't load.

WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported. at: _editor_init (modules/gltf/register_types.cpp:70) ERROR: No loader found for resource: res://gdcef.gdns. at: (core/io/resource_loader.cpp:230) ERROR: res://Control.tscn:33 - Parse Error: [ext_resource] referenced non-loaded resource at: res://gdcef.gdns at: _parse_ext_resource (scene/resources/resource_format_text.cpp:174) ERROR: Index p_idx = 1 is out of bounds (edited_scene.size() = 1). at: remove_scene (editor/editor_data.cpp:574)

Lecrapouille commented 1 year ago

@sanath-narasimhan for the moment this plugin is only for Godot 3.4 or 3.5. The patch I made on the dev-godot-4 branch will not work because I commented a lot of code (broken API between Godot 3 and 4) and I do not have time for this project (since the main project using it aborted), but I saw (spied) that @eProgD is trying to implement it https://github.com/eProgD/gdcef :) Maybe he will give a pull request :)

Lecrapouille commented 8 months ago

Thanks to @BlayTheNinth a huge step on making CEF working for Godot 4.2. I have fixed demos 2D and helloCEF, but there is still an issue with keyboard. The demo3D is not compiling due to API change in the script with the initial project https://godotengine.org/asset-library/asset/127 I also cherry picked commits from the master (doc, build script, reshape of the windows ...) @raphipod @daniel-sanche if you are interested in changes. I'll see to swap master and godot-4 branch and create a godot-3.5 branch instead.

Lecrapouille commented 8 months ago

I changed branches:

@BlayTheNinth if I may ask you if you understand why my Windows CI does not work with Godot-4. Have you got these before ? https://github.com/Lecrapouille/gdcef/actions/runs/7496785463/job/20409569013

BlayTheNinth commented 8 months ago

I believe that's what the CMakeLists patch was working around. I also ran into those linking errors again when doing a clean build.

For my local build I've since just made the build script rename the tests folder inside CEF which will make it skip building those, since all we need from the CEF build is the dll wrapper.

Lecrapouille commented 8 months ago

@BlayTheNinth I restored the patch and the CI passed :) I know the patch is to force compiling with static lib (.lib) instead of dll. My friend spent hard time before reaching to this solution.

Lecrapouille commented 8 months ago

I fixed the keyboard and remade the 3D demos. I'll tag a release and create a ticket for the Godot assets lib