-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 maintenance #165
Code maintenance #165
Conversation
also fix all uses of these methods accordingly
- LayerStack - WindowCloseEvent - AppTickEvent - AppUpdateEvent - AppRenderEvent
So the engine has full control over when the application is closed.
When will this be merged? |
I think tomorrow, or after cherno's next vid/upload to github. However, I found some small things that still requires attention before I can merge it: #140 (comment) |
Should LovelySanta#47 be merged into this? |
Suggested in comment
I don't think it should be merged into this. |
The reason I did it lije this, only Window.cpp includes the WindowsWindow, so in that file we can add/remove the obsolete classes when they are not required. This could even work for the different renderAPI's, for example exclude DirectX in macOS... Any particular reason why you're against it @CleverSource ? I can see how it might require a seperate PR instead... |
It's a good PR, but it doesn't feel very maintenance like and seeing as this PR is meant for maintenance I don't see why a PR unrelated should be merged with this. While I do think the other PR should be implemented in some way, I don't think it should be added with this PR. |
Removed LovelySanta#47 from the TODO list. I'm waiting till cherno pushes his code before I'll update this and merge it. |
Will this be merged now? |
There are still some things to do, see #140, such as removing the OpenGL casting in the 3D renderer... |
Now everything is implemented. I want to have anther look in the weekend and I plan on merging it on monday if everything looks alright. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems mostly good to merge. Only some minor things that we should clear up.
One other thing that I can think of that we might want to include, seeing as we have the platform detection now, is the include guards for the API-specific files depending on platform. The Windows*
files would only be on Windows and the OpenGL*
files can probably work on both Windows and Linux. Do you think we should do that? And, if so, should it be part of this PR?
That is exactly what I asked some days ago: #165 (comment). The only place Windows* files are included are within the I agree with the reply from CleverSource #165 (comment) on the matter: It is a good PR, but not really maintenance, it should have its own PR into Hazel instead. So I think this is indeed a nice suggestion, but also outside the scope of this PR? |
It most likely is outside the scope of this PR to be quite honest. |
I know this is an old PR that was merged over a year ago, but Cherno mentioned in the Smart pointer episode (20 minutes in) that the spdlog::loggers should remain in std::shared_ptrs instead of Hazel Refs since spdlog::loggers aren't Hazel assets. Felt like I should just bring that up since the latest master still has them as Refs. |
I do remember that yes, but as long as it is just a wrapper around shared ptrs, this is equivalent. When we implement our own ref system, it has to change indeed. |
Describe the issue (if no issue has been made)
Code maintenance of things Cherno did start but not finish or mensioned before but did not do in the code maintenance video.
PR impact (Make sure to add closing keywords)
List of related issues/PRs this will solve:
Proposed fix (Make sure you've read on how to contribute to Hazel)
A more detailed list can be found in #140 (comment)
std::shared_ptr
->Hazel::Ref
andstd::make_shared
->Hazel::CreateRef
std::unique_ptr
->Hazel::Scope
andstd::make_unique
->Hazel::CreateScope
Removed all
HAZEL_API
macrosHazel/src
<>
instead of""
BIND_EVENT_FN
in applicationNow uses the generic
HZ_BIND_EVENT_FN
insteadAdditional context
Tested in debug and release, the rest of the code maintenace can be found in #140 (comment).