diff --git a/glonkers.c b/glonkers.c index 93ed68b..f8f5f79 100644 --- a/glonkers.c +++ b/glonkers.c @@ -27,9 +27,7 @@ double time_since_start() { (now.tv_nsec - program_start.tv_nsec) / 1e9; } -int -main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { char *shader_path = NULL; if (argc >= 2) { shader_path = argv[1]; diff --git a/wayland.c b/wayland.c index 0040130..df2078f 100644 --- a/wayland.c +++ b/wayland.c @@ -29,9 +29,7 @@ static const struct xdg_surface_listener xdg_surface_listener = { static void xdg_wm_base_ping(void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial) { - xdg_wm_base_pong(xdg_wm_base, serial); -} - + xdg_wm_base_pong(xdg_wm_base, serial); } static const struct xdg_wm_base_listener xdg_wm_base_listener = { .ping = xdg_wm_base_ping, }; @@ -72,9 +70,6 @@ wl_registry_listener = { }; static void egl_init(struct client_state *state) { - EGLint major, minor, count, n, size; - EGLConfig *configs; - int i; EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, @@ -98,21 +93,26 @@ static void egl_init(struct client_state *state) { fprintf(stderr, "Created egl display\n"); } + EGLint major, minor; if (eglInitialize(state->egl_display, &major, &minor) != EGL_TRUE) { fprintf(stderr, "Can't initialise egl display\n"); exit(1); } printf("EGL major: %d, minor %d\n", major, minor); + EGLint count; eglGetConfigs(state->egl_display, NULL, 0, &count); printf("EGL has %d configs\n", count); - configs = calloc(count, sizeof *configs); + + EGLConfig *configs = calloc(count, sizeof *configs); + EGLint n; eglChooseConfig(state->egl_display, config_attribs, configs, count, &n); - for (i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { + EGLint size; eglGetConfigAttrib(state->egl_display, configs[i], EGL_BUFFER_SIZE, &size); printf("Buffer size for config %d is %d\n", i, size); @@ -132,7 +132,6 @@ static void egl_init(struct client_state *state) { state->egl_config, EGL_NO_CONTEXT, context_attribs); - // EGL window state->egl_window = wl_egl_window_create(state->wl_surface, state->width, state->height);