Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ int main(int argc, char **argv)
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);

bool should_close = false;
uint64_t last_time = RGFW_getTimerValue();
while (RGFW_window_shouldClose(win) == RGFW_FALSE) {
if (should_close) break;

uint64_t now = RGFW_getTimerValue();
float dt = (float)(now - last_time)/RGFW_getTimerFreq();
last_time = now;
Expand All @@ -347,6 +350,14 @@ int main(int argc, char **argv)
}
} break;

// Stop on '^Q' or '^C' key
case RGFW_q:
case RGFW_c: {
if (RGFW_window_isKeyDown(win, RGFW_controlL) || RGFW_window_isKeyDown(win, RGFW_controlR)) {
should_close = true;
}
} break;

// TODO: add support for RGFW_kpPlus when RGFW 1.8.0 is released
// case RGFW_kpPlus:
case RGFW_equals: {
Expand Down