From 89af2b1e3910196c4cad47c3748c1a2920b3faf9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Aug 2019 20:28:28 +0200 Subject: Rename remaining init functions This finishes the removal of the init/set split. While these ones are superficial, the general idea here is to provide general functions that work before or after window creation where possible. This prevents the situation where ever more dynamic counterparts to existing init functions get added over time. --- test/pugl_cairo_test.c | 6 +++--- test/pugl_test.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'test') diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c index 52cbbbd..278a74d 100644 --- a/test/pugl_cairo_test.c +++ b/test/pugl_cairo_test.c @@ -212,10 +212,10 @@ main(int argc, char** argv) PuglView* view = puglNewView(world); puglSetFrame(view, frame); puglSetMinSize(view, 256, 256); - puglInitWindowHint(view, PUGL_RESIZABLE, resizable); - puglInitBackend(view, puglCairoBackend()); + puglSetViewHint(view, PUGL_RESIZABLE, resizable); + puglSetBackend(view, puglCairoBackend()); - puglInitWindowHint(view, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); + puglSetViewHint(view, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); puglSetEventFunc(view, onEvent); if (puglCreateWindow(view, "Pugl Test")) { diff --git a/test/pugl_test.c b/test/pugl_test.c index e291df7..6c4e3e8 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -320,13 +320,13 @@ main(int argc, char** argv) puglSetFrame(app.parent, parentFrame); puglSetMinSize(app.parent, borderWidth * 3, borderWidth * 3); puglSetAspectRatio(app.parent, 1, 1, 16, 9); - puglInitBackend(app.parent, puglGlBackend()); + puglSetBackend(app.parent, puglGlBackend()); - puglInitWindowHint(app.parent, PUGL_RESIZABLE, resizable); - puglInitWindowHint(app.parent, PUGL_SAMPLES, samples); - puglInitWindowHint(app.parent, PUGL_DOUBLE_BUFFER, doubleBuffer); - puglInitWindowHint(app.parent, PUGL_SWAP_INTERVAL, doubleBuffer); - puglInitWindowHint(app.parent, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); + puglSetViewHint(app.parent, PUGL_RESIZABLE, resizable); + puglSetViewHint(app.parent, PUGL_SAMPLES, samples); + puglSetViewHint(app.parent, PUGL_DOUBLE_BUFFER, doubleBuffer); + puglSetViewHint(app.parent, PUGL_SWAP_INTERVAL, doubleBuffer); + puglSetViewHint(app.parent, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); puglSetHandle(app.parent, &app); puglSetEventFunc(app.parent, onParentEvent); @@ -338,13 +338,13 @@ main(int argc, char** argv) } puglSetFrame(app.child, getChildFrame(parentFrame)); - puglInitWindowParent(app.child, puglGetNativeWindow(app.parent)); + puglSetParentWindow(app.child, puglGetNativeWindow(app.parent)); - puglInitWindowHint(app.child, PUGL_SAMPLES, samples); - puglInitWindowHint(app.child, PUGL_DOUBLE_BUFFER, doubleBuffer); - puglInitWindowHint(app.child, PUGL_SWAP_INTERVAL, 0); - puglInitBackend(app.child, puglGlBackend()); - puglInitWindowHint(app.child, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); + puglSetViewHint(app.child, PUGL_SAMPLES, samples); + puglSetViewHint(app.child, PUGL_DOUBLE_BUFFER, doubleBuffer); + puglSetViewHint(app.child, PUGL_SWAP_INTERVAL, 0); + puglSetBackend(app.child, puglGlBackend()); + puglSetViewHint(app.child, PUGL_IGNORE_KEY_REPEAT, ignoreKeyRepeat); puglSetHandle(app.child, &app); puglSetEventFunc(app.child, onEvent); -- cgit v1.2.1