Skip to content

Commit

Permalink
Reverting unrelated changes. Keeping input changes to platform specific.
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Marais committed Jun 1, 2022
1 parent 11dddc9 commit 1efc273
Show file tree
Hide file tree
Showing 4 changed files with 645 additions and 317 deletions.
28 changes: 0 additions & 28 deletions engine/src/core/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ static application_state* app_state;
b8 application_on_event(u16 code, void* sender, void* listener_inst, event_context context);
b8 application_on_key(u16 code, void* sender, void* listener_inst, event_context context);
b8 application_on_resized(u16 code, void* sender, void* listener_inst, event_context context);
b8 application_on_minimized(u16 code, void *sender, void *listener_inst, event_context context);
b8 application_on_raised(u16 code, void *sender, void *listener_inst, event_context context);

b8 application_create(game* game_inst) {
if (game_inst->application_state) {
Expand Down Expand Up @@ -97,8 +95,6 @@ b8 application_create(game* game_inst) {
event_register(EVENT_CODE_KEY_PRESSED, 0, application_on_key);
event_register(EVENT_CODE_KEY_RELEASED, 0, application_on_key);
event_register(EVENT_CODE_RESIZED, 0, application_on_resized);
event_register(EVENT_CODE_MINIZED, 0, application_on_minimized);
event_register(EVENT_CODE_RAISED, 0, application_on_raised);

// Platform
platform_system_startup(&app_state->platform_system_memory_requirement, 0, 0, 0, 0, 0, 0);
Expand Down Expand Up @@ -211,8 +207,6 @@ b8 application_run() {
event_unregister(EVENT_CODE_KEY_PRESSED, 0, application_on_key);
event_unregister(EVENT_CODE_KEY_RELEASED, 0, application_on_key);
event_unregister(EVENT_CODE_RESIZED, 0, application_on_resized);
event_unregister(EVENT_CODE_MINIZED, 0, application_on_minimized);
event_unregister(EVENT_CODE_RAISED, 0, application_on_raised);

input_system_shutdown(app_state->input_system_state);

Expand Down Expand Up @@ -303,25 +297,3 @@ b8 application_on_resized(u16 code, void* sender, void* listener_inst, event_con
// Event purposely not handled to allow other listeners to get this.
return false;
}

b8 application_on_minimized(u16 code, void *sender, void *listener_inst, event_context context) {
if (code == EVENT_CODE_MINIZED) {
if (!app_state->is_suspended) {
KDEBUG("Application was minimized and suspended.");
app_state->is_suspended = true;
}
}

return true;
}

b8 application_on_raised(u16 code, void *sender, void *listener_inst, event_context context) {
if (code == EVENT_CODE_RAISED) {
if (app_state->is_suspended) {
KDEBUG("Application was raised and unsuspended.");
app_state->is_suspended = false;
}
}

return true;
}
6 changes: 0 additions & 6 deletions engine/src/core/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,5 @@ typedef enum system_event_code {
*/
EVENT_CODE_RESIZED = 0x08,

// Window was minimized
EVENT_CODE_MINIZED = 0x09,

// Window was raised from minimized
EVENT_CODE_RAISED = 0x0a,

MAX_EVENT_CODE = 0xFF
} system_event_code;
Loading

0 comments on commit 1efc273

Please sign in to comment.