Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RETRO_ENVIRONMENT_GET_CORE_DATA example usage #30

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@@ -8,9 +8,19 @@

#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