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

Update Platform.h #375

Closed
wants to merge 1 commit into from
Closed

Conversation

ollobrains
Copy link

Below is a refined version of your header file. Key improvements include:

Use of #pragma once for modern header-guard style (you can keep the #ifndef__PLATFORM_H__ if you prefer). Consistent naming and style for macros.
Optional doc comments to explain the macros and conditions.

Explanation of Improvements
Modern Include Guard
Uses #pragma once which is widely supported and prevents multiple inclusion of the header. The classical #ifndef PLATFORM_H pattern is also there for maximum compatibility, or you could remove the latter if you want only #pragma once.

Macro Naming
Switched to uppercase macros (VK_BINDING / VK_LOCATION) to distinguish them from typical C++ code and to reflect their function as preprocessor definitions.

Doc Comments
Added short doc comments describing what the macros do and when they are used, helping new maintainers or users understand the file’s purpose.

Defines
Used defined(VULKAN) for clarity, though your original approach also worked if VULKAN is a single token. This small improvement clarifies the condition.

Below is a refined version of your header file. Key improvements include:

Use of #pragma once for modern header-guard style (you can keep the #ifndef__PLATFORM_H__ if you prefer).
Consistent naming and style for macros.
Optional doc comments to explain the macros and conditions.

Explanation of Improvements
Modern Include Guard
Uses #pragma once which is widely supported and prevents multiple inclusion of the header. The classical #ifndef PLATFORM_H pattern is also there for maximum compatibility, or you could remove the latter if you want only #pragma once.

Macro Naming
Switched to uppercase macros (VK_BINDING / VK_LOCATION) to distinguish them from typical C++ code and to reflect their function as preprocessor definitions.

Doc Comments
Added short doc comments describing what the macros do and when they are used, helping new maintainers or users understand the file’s purpose.

Defines
Used defined(VULKAN) for clarity, though your original approach also worked if VULKAN is a single token. This small improvement clarifies the condition.
@FlyAndNotDown
Copy link
Member

Seems we not need this 🙄 Platform.h is a shader header, #pragma once is not worked on some shader compiler, e.g. PlayStation AGC compiler, and if your want use #pragma once you should remove #ifndef at same time.

In the other hands, we have not yet start renderer development, the Platform.h is just a early test version file, we plan to make a better one latter.

About your macro naming suggestions, in our game engine, we think uppercase macros make programs hard to read and not beautiful, so we not plan to modify this.

Thanks for your suggestions, bu we not want to accept this PR now, if your want take part in something deeper, PR welcome.

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