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

[rcore] Manage access to CORE.Window through a macro to make multi-window branch easier to update #3976

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JeffM2501
Copy link
Sponsor Contributor

This PR makes a subtle but pervasive change to the platform system. It routes access to the Core.Window structure through a new macro named CORE_WINDOW.
The reason for this is to help out the multi-window branch in raylib-extras.
To make this branch work, it needs a window structure per window. Right now I have to manually replace all calls to CORE.Window with CORE.Window[GetActiveWindow()], and everytime raylib updates things break. With this change, the branch can simply replace the CORE_WINDOW macro in one place and not have to hit all the places in the code and all platforms.

This change has ZERO benefit to regular raylib, and thus I understand if it's too pervasive, It would just make multi-window easier to keep in sync with main raylib.

src/platforms/rcore_android.c Outdated Show resolved Hide resolved
src/platforms/rcore_desktop.c Outdated Show resolved Hide resolved
src/platforms/rcore_desktop_rgfw.c Outdated Show resolved Hide resolved
src/platforms/rcore_drm.c Outdated Show resolved Hide resolved
src/platforms/rcore_desktop_sdl.c Outdated Show resolved Hide resolved
src/platforms/rcore_template.c Outdated Show resolved Hide resolved
src/platforms/rcore_web.c Outdated Show resolved Hide resolved
@raysan5 raysan5 changed the title [CORE] Manage access to CORE.Window through a macro to make multi-window branch easier to update [rcore] Manage access to CORE.Window through a macro to make multi-window branch easier to update May 12, 2024
@@ -302,6 +302,76 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\platforms\rcore_android.c">
Copy link
Owner

Choose a reason for hiding this comment

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

Why are those files required? I don't need them on my VS2022 project solution...

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

They are not required. Having them in the solution and marked as non buildable simply makes them easy to find and edit from within the IDE, instead of having to go find the files. It's purely a convenience feature for working in visual studio.
I can remove them if desired.

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Owner

Choose a reason for hiding this comment

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

Why are those files required? I don't need them on my VS2022 project solution...

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.

None yet

3 participants