diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/window.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/window.c b/tests/window.c index 31447d8..7ce154c 100644 --- a/tests/window.c +++ b/tests/window.c @@ -62,14 +62,7 @@ static bool mouse_button_callback(void *userdata, u8 state, u8 button) (void)userdata; switch (button) { case STELA_MOUSE1: - switch (state) { - case STELA_BUTTON_PRESSED: - dragging = true; - break; - case STELA_BUTTON_RELEASED: - dragging = false; - break; - } + dragging = state == STELA_BUTTON_PRESSED; break; } return false; @@ -95,7 +88,7 @@ static bool key_callback(void *userdata, u8 state, u16 button) return false; } -static void key_immediate_callback(void *userdata, u8 state, u16 button) +static bool key_immediate_callback(void *userdata, u8 state, u16 button) { (void)userdata; switch (state) { @@ -103,10 +96,11 @@ static void key_immediate_callback(void *userdata, u8 state, u16 button) switch (button) { case STELA_KEY_F: window->toggle_fullscreen(window); - break; + return true; } break; } + return false; } static void should_close_callback(void *userdata) @@ -132,12 +126,19 @@ static GLfloat vertices[] = { ((c >> 8) & 0xff) / 255.f, \ (c & 0xff) / 255.f +// #EDEDF0 +static const u32 cw = 0xEDEDF0; +static const GLfloat winbg[3] = { EXPAND_RGB(cw) }; + +// #2F3C7A static const u32 c0 = 0x2F3C7A; static const GLfloat bg[3] = { EXPAND_RGB(c0) }; -static const u32 c1 = 0x0F1B26; +// #1F2947 +static const u32 c1 = 0x1F2947; static const GLfloat color1[3] = { EXPAND_RGB(c1) }; +// #C3A46F static const u32 c2 = 0xC3A46F; static const GLfloat color2[3] = { EXPAND_RGB(c2) }; @@ -179,7 +180,7 @@ s32 window_system_main(u32 argc, str *argv, void *extra) window->userdata = NULL; u32 flags = STELA_WINDOW_VSYNC; - if (!window->create_window(window, DEFAULT_WIDTH, DEFAULT_HEIGHT, "", "Stella", flags)) { + if (!window->create_window(window, DEFAULT_WIDTH, DEFAULT_HEIGHT, flags, "", "Stella", "stela")) { return EXIT_FAILURE; } @@ -197,7 +198,7 @@ s32 window_system_main(u32 argc, str *argv, void *extra) } glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); - glClearColor(1.f, 1.f, 1.f, 1.f); + glClearColor(winbg[0], winbg[1], winbg[2], 1.f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); window->gl_swap_buffers(window); if (argc > 1 && al_str_cmp(&argv[1], &al_str_c("w"), 0, 1) == 0) { @@ -227,9 +228,9 @@ s32 window_system_main(u32 argc, str *argv, void *extra) glScissor(x_offset, y_offset, (GLsizei)w, (GLsizei)h); glEnable(GL_SCISSOR_TEST); - glClearColor(bg[0], bg[1], bg[2], 1.f); + glClearColor(winbg[0], winbg[1], winbg[2], 1.f); glClear(GL_COLOR_BUFFER_BIT); - glClearColor(1.f, 1.f, 1.f, 1.f); + glClearColor(bg[0], bg[1], bg[2], 1.f); glDisable(GL_SCISSOR_TEST); glViewport(x_offset, y_offset, (GLsizei)w, (GLsizei)h); |