logo
#[derive(DeriveCoreOptions)]
{
    // Attributes available to this derive:
    #[options]
    #[categories]
}
Expand description

Used to define variables and core options for your [rust_libretro::Core] struct.

A struct that has been decorated with this attribute will have a Self::set_core_options function which should be called in [rust_libretro::Core::on_set_environment].

Example usage:

#[derive(CoreOptions)]
#[options({
    "foo_option_1",
    "Speed hack coprocessor X",
    "Provides increased performance at the expense of reduced accuracy",
    {
        { "false" },
        { "true" },
        { "unstable", "Turbo (Unstable)" },
    },
    "true"
}, {
    "foo_option_2",
    "Speed hack main processor Y",
    "Provides increased performance at the expense of reduced accuracy",
    {
        { "false" },
        { "true" },
        { "unstable", "Turbo (Unstable)" },
    },
})]
struct TestCore;

TODO: Support structs with generic parameters. TODO: Add V2 (category support) documentation