This repository has been archived by the owner on May 13, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed solution to Windows 32-bit build crash.
The crash is caused by a calling convention mismatch. The default calling convention is cdecl, but the OpenGL functions returned by getProcAddress() are stdcall. This causes stack corruption unless function pointers are annotated with __stdcall.
For reference, this is how SDL3 determines the calling convention:
https://github.com/libsdl-org/SDL/blob/72b7acfe8ac26498dac57d751e1b3485d30a62e3/include/SDL3/SDL_opengl.h#L92-L103
This is how KHRONOS_APIENTRY is determined:
irrlicht/source/Irrlicht/KHR/khrplatform.h
Lines 122 to 127 in 9b52d6f