diff options
author | David Robillard <d@drobilla.net> | 2021-01-02 21:09:27 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-02 21:09:27 +0100 |
commit | 1c365945ed2ebd5b9f54eb0c8c5c1c6d97cad712 (patch) | |
tree | 4b77266a9ce3e2a11b59bbd2754869c6ee1d172b /examples/pugl_print_events.c | |
parent | a92a194b4fc64e0cfa4a88a59e261f236414d61c (diff) | |
download | pugl-1c365945ed2ebd5b9f54eb0c8c5c1c6d97cad712.tar.gz pugl-1c365945ed2ebd5b9f54eb0c8c5c1c6d97cad712.tar.bz2 pugl-1c365945ed2ebd5b9f54eb0c8c5c1c6d97cad712.zip |
Simplify clang-format configuration and format all code
Diffstat (limited to 'examples/pugl_print_events.c')
-rw-r--r-- | examples/pugl_print_events.c | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/examples/pugl_print_events.c b/examples/pugl_print_events.c index 8f8874b..dfa217e 100644 --- a/examples/pugl_print_events.c +++ b/examples/pugl_print_events.c @@ -22,56 +22,58 @@ #include <stdbool.h> #include <stdio.h> -typedef struct -{ - PuglWorld* world; - PuglView* view; - int quit; +typedef struct { + PuglWorld* world; + PuglView* view; + int quit; } PuglPrintEventsApp; static PuglStatus onEvent(PuglView* view, const PuglEvent* event) { - PuglPrintEventsApp* app = (PuglPrintEventsApp*)puglGetHandle(view); + PuglPrintEventsApp* app = (PuglPrintEventsApp*)puglGetHandle(view); - printEvent(event, "Event: ", true); + printEvent(event, "Event: ", true); - switch (event->type) { - case PUGL_CLOSE: app->quit = 1; break; - default: break; - } + switch (event->type) { + case PUGL_CLOSE: + app->quit = 1; + break; + default: + break; + } - return PUGL_SUCCESS; + return PUGL_SUCCESS; } int main(void) { - PuglPrintEventsApp app = {NULL, NULL, 0}; + PuglPrintEventsApp app = {NULL, NULL, 0}; - app.world = puglNewWorld(PUGL_PROGRAM, 0); - app.view = puglNewView(app.world); + app.world = puglNewWorld(PUGL_PROGRAM, 0); + app.view = puglNewView(app.world); - puglSetClassName(app.world, "Pugl Print Events"); - puglSetWindowTitle(app.view, "Pugl Event Printer"); - puglSetDefaultSize(app.view, 512, 512); - puglSetBackend(app.view, puglStubBackend()); - puglSetHandle(app.view, &app); - puglSetEventFunc(app.view, onEvent); + puglSetClassName(app.world, "Pugl Print Events"); + puglSetWindowTitle(app.view, "Pugl Event Printer"); + puglSetDefaultSize(app.view, 512, 512); + puglSetBackend(app.view, puglStubBackend()); + puglSetHandle(app.view, &app); + puglSetEventFunc(app.view, onEvent); - PuglStatus st = puglRealize(app.view); - if (st) { - return logError("Failed to create window (%s)\n", puglStrerror(st)); - } + PuglStatus st = puglRealize(app.view); + if (st) { + return logError("Failed to create window (%s)\n", puglStrerror(st)); + } - puglShow(app.view); + puglShow(app.view); - while (!app.quit) { - puglUpdate(app.world, -1.0); - } + while (!app.quit) { + puglUpdate(app.world, -1.0); + } - puglFreeView(app.view); - puglFreeWorld(app.world); + puglFreeView(app.view); + puglFreeWorld(app.world); - return 0; + return 0; } |