From 58c54ef08555f847672466f99bacf4db9240d11c Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 9 Aug 2008 04:00:41 +0000 Subject: [PATCH] more tinybuffer tweaks --- panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx | 3 +-- panda/src/tinydisplay/tinyXGraphicsPipe.cxx | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx b/panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx index 8e87908b72..86fba2c8e4 100644 --- a/panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx @@ -239,8 +239,7 @@ make_output(const string &name, // Second thing to try: a TinyGraphicsBuffer if (retry == 1) { - if ((!support_render_texture)|| - ((flags&BF_require_parasite)!=0)|| + if (((flags&BF_require_parasite)!=0)|| ((flags&BF_require_window)!=0)) { return NULL; } diff --git a/panda/src/tinydisplay/tinyXGraphicsPipe.cxx b/panda/src/tinydisplay/tinyXGraphicsPipe.cxx index 7ff3a2e7cf..ed97336623 100644 --- a/panda/src/tinydisplay/tinyXGraphicsPipe.cxx +++ b/panda/src/tinydisplay/tinyXGraphicsPipe.cxx @@ -208,6 +208,9 @@ make_output(const string &name, // First thing to try: a TinyXGraphicsWindow + // We check _is_valid only in this case. The pipe will be invalid + // if it can't contact the X server, but that shouldn't prevent the + // creation of an offscreen buffer. if (retry == 0 && _is_valid) { if (((flags&BF_require_parasite)!=0)|| ((flags&BF_refuse_window)!=0)|| @@ -223,9 +226,11 @@ make_output(const string &name, } // Second thing to try: a TinyGraphicsBuffer + + // No need to check _is_valid here. We can create an offscreen + // buffer even if the pipe is not technically valid. if (retry == 1) { - if ((!support_render_texture)|| - ((flags&BF_require_parasite)!=0)|| + if (((flags&BF_require_parasite)!=0)|| ((flags&BF_require_window)!=0)) { return NULL; }