diff options
author | Brian Paul <[email protected]> | 2001-01-23 23:45:05 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-01-23 23:45:05 +0000 |
commit | 125fddc31dc9959901d9f1ece693b09f04426d48 (patch) | |
tree | 1011e2c8c23c7d86b03b18c7685cfb7b03dd5a58 /progs | |
parent | 6140a8c65fc0ee23f8370bd41d52c79a77dbb156 (diff) |
added DestroyHeads() to test clean-up code
Diffstat (limited to 'progs')
-rw-r--r-- | progs/xdemos/manywin.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/progs/xdemos/manywin.c b/progs/xdemos/manywin.c index 797029cc4cb..f8ef80d426a 100644 --- a/progs/xdemos/manywin.c +++ b/progs/xdemos/manywin.c @@ -1,4 +1,4 @@ -/* $Id: manywin.c,v 1.2 2000/12/02 20:33:05 brianp Exp $ */ +/* $Id: manywin.c,v 1.3 2001/01/23 23:45:05 brianp Exp $ */ /* * Create N GLX windows/contexts and render to them in round-robin @@ -164,6 +164,18 @@ AddHead(const char *displayName, const char *name) static void +DestroyHeads(void) +{ + int i; + for (i = 0; i < NumHeads; i++) { + XDestroyWindow(Heads[i].Dpy, Heads[i].Win); + glXDestroyContext(Heads[i].Dpy, Heads[i].Context); + XCloseDisplay(Heads[i].Dpy); + } +} + + +static void Redraw(struct head *h) { if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) { @@ -311,7 +323,7 @@ main(int argc, char *argv[]) char name[100]; struct head *h; sprintf(name, "%d", i); - h = AddHead(":0", name); + h = AddHead(NULL, name); if (h) { PrintInfo(h); } @@ -319,5 +331,6 @@ main(int argc, char *argv[]) } EventLoop(); + DestroyHeads(); return 0; } |