-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
updates for window events #453
base: v0.5
Are you sure you want to change the base?
Conversation
@@ -193,6 +193,14 @@ namespace obe::system | |||
std::string title = "ObEngine"; | |||
if (configuration.contains("title")) | |||
m_title = configuration.at("title"); | |||
|
|||
event::EventNamespace event_namespace = event::EventNamespace("obe::system"); |
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.
Check out :
ObEngine/src/Core/Engine/Engine.cpp
Line 82 in 6ad6985
m_event_namespace = &m_events->create_namespace("Event"); |
for how to create a EventNamespace
, although that made me realize that the constructor should be private, I'll fix this :)
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.
Ok I see this, do let me know when you have your changes in place for the constructor.
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.
Should be good, rebase your branch on latest v0.5 commit :)
struct Moved | ||
{ | ||
static constexpr std::string_view id = "Moved"; | ||
Position new_pos; |
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.
As in
ObEngine/include/Core/System/Cursor.hpp
Line 20 in 6ad6985
int x; |
A position
and previous_position
naming scheme would be more appropriate imo
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.
@symei I have a Position new_pos and then Position previous_pos, Position is a struct that has unsigned int values for x,y. Are you saying remove the Position struct, and just have unsigned int x,y values vs a struct called Position, that contains x,y?
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.
You can keep the Position
struct, just rename new_pos
to position
and previous_pos
to previous_position
and we're good to go :)
@@ -202,6 +210,10 @@ namespace obe::system | |||
m_window.setKeyRepeatEnabled(false); | |||
|
|||
this->apply_view(); | |||
events::Window::Size new_size { m_width, m_height }; | |||
events::Window::Size previous_size { 0, 0 }; | |||
e_window->trigger( |
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.
Not sure we should trigger Resized
here, eventually, we could add a Created
or Opened
event for this
The general structure looks good, I added a few comments :) |
No description provided.