-
Notifications
You must be signed in to change notification settings - Fork 8
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
Code & Build Cleanup & Enhancements #18
Open
mheller575
wants to merge
20
commits into
ParadoxZero:master
Choose a base branch
from
mheller575:main
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you so much for the PR. This looks like a lot of changes. I am currently traveling right now. Would love to review it once I am back. Thanks again for the effort! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello, I stumbled on your Snake and GameMenu projects while learning SFML and thought it was an excellent introduction and I wanted to contribute if possible.
I am happy to discuss and address any and all feedback you have for me. Thank you for putting these projects together!
Pull request includes changes for:
Fix to CmakeLists.txt that prevented build from running properly. Target under Win32 if statement in CmakeLists was targetting "CMakeSFMLProject" which is from the SFML CMake template file. Changing this to the "gamemenu" target fixed the build for WIndows. (Found this while attempting to build the Snake project.
Updated code formatting for a more typical 4 space tab indenting scheme. this makes the code easier to read in my opinion. (I understand if you don't agree with this spacing scheme. I can undo if you prefer.)
Removed the old style header guard #ifndef in favor of "#pragma once" which is the C++14 and later handling.
Removed any use of non-portable base types in favor of "cstdint" typedefs for portability.
Changed names of files for the types contained within.
Added missing internal impl header file to the build process for "cmakelists.txt". Header isn't built but for users using Visual Studio it adds the header to the project file.
Changed standalone C functions to a utilize a factory builder factory function that returns a shared pointer. Shared pointer is preferred as it automatically handles cleanup of the raw memory. It is also clearer to the client that the returned object is a pointer that requires management. The returned pointer is then an interface to the menu. This hides the internal implementation of the menu from the client and gives them explicit management/use functions they can call and reference on the pointer.
Updated internal implementation to simplify the creation of the menu. Also simplified the logic for layout and drawing.
Changed Example code to not use the struct initializer. The struct initializer required C++20 but no other C++20 features were being used in the core project. Removed the use so the Example and the core code can both use C++14. (Users of the project are welcome to use C++20 if they want, but it is not required.)
Added comments and documentation to public functions and the example.
Added mouse support to the menu.