Skip to content

A GDExtension for libretro API to allow core loading in Godot 4

License

Notifications You must be signed in to change notification settings

humbertodias/libretro-godot4-frontend

 
 

Repository files navigation

CD

libretro-godot4-frontend

A GDExtension for libretro API to allow core loading in Godot 4.

gdretro-video-ok

Using the extension

After compiling the extension succesfully, you can now use the libretro API inside Godot

@onready var gdretro = GDRetro.new()

func _ready() -> void:
	gdretro.core_load("/usr/lib/libretro/gambatte_libretro.so")
	var system_info = gdretro.retro_get_system_info()
	print(system_info["library_name"])
	print(system_info["library_version"])

Versioning

This repository will be updated regularly to work with the latest beta release of the master (4.4) branch. If you can't compile the extension, please open an issue.

----> Most Recent Update: Godot 4.4 working

Contributing

If you can't compile the extension, please open an issue with the error log in your terminal and/or the error log in the editor (if you can't run the example scene).

PRs for improvements are very welcome!

Building the extension

To compile the extension you need to follow these steps:

  1. Clone the extension recursively from this repository
# --recursive to automatically load the submodule godot-cpp
# The git adress can be found under the green "Code" dropdown menu
git clone --recursive <github-repo-url>
  1. Go inside the repo fodler folder
cd libretro-godot4-frontend
  1. Make sure you are on the right commit of the godot-cpp repository
git status
# this show's you the commit. Make sure that it is released to a similar/the same time as the master branch (especially during the beta)

To make sure you have the right commit, here the link to the pinned updated issue with the commit hashes

  1. Go inside the godot-cpp folder
cd godot-cpp
  1. Compile godot-cpp and generate the bindings (only needed once when starting development or when there is an update of the submodule)
scons target=template_debug
# OR simpler (the above is the default configuration):
scons 
  1. Go back to the top level of the directory
cd ..
  1. Compile the extension
scons target=template_debug
# OR simpler (the above is the default configuration):
scons
  1. Documentation
godot --doctool .. --gdextensios-docs

About

A GDExtension for libretro API to allow core loading in Godot 4

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 78.1%
  • C++ 20.1%
  • Other 1.8%