Skip to content

Conversation

@RobLoach
Copy link
Member

@RobLoach RobLoach commented Sep 17, 2024

This is an example of using the RETRO_ENVIRONMENT_GET_CORE_DATA and RETRO_ENVIRONMENT_SET_CORE_DATA environment callback to allow avoiding having static/global core variables.

Depends on libretro/RetroArch#17012 .

@RobLoach RobLoach changed the title Add RETRO_ENVIRONMENT_GET_CORE_DATA example usage Add RETRO_ENVIRONMENT_GET_CORE_DATA example usage Sep 17, 2024
@RobLoach RobLoach marked this pull request as draft September 29, 2024 00:04
@RobLoach
Copy link
Member Author

Setting this as a draft, as it's just a demonstration of using the new environment callbacks.

#include "libretro.h"

static uint32_t *frame_buf;
typedef struct core_data_t {
Copy link

Choose a reason for hiding this comment

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

I think to really demonstrate this envcall, you'd need to move all currently-static state into it

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be awesome. I'll see how much can be moved. Some of the callbacks are called before the core is initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants