From a34bec799479ea448b88ae7fdcc7b937eac23604 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 16 Aug 2001 15:50:32 +0000 Subject: [PATCH] be a little more verbose when creating X fonts --- panda/src/glxdisplay/glxGraphicsWindow.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 50872ea746..265b6df6b0 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -497,11 +497,19 @@ void glxGraphicsWindow::config( void ) // I /know/ there has to be a way to get a useful handle to the default // font, but I have to date been unable to find one foo = XLoadQueryFont(_display, "-*-*-*-*-*--12-*-*-*-*-*-*-*"); - glXUseXFont(foo->fid, 0, 128, FONT_BITMAP_OGLDISPLAYLISTNUM); - _start_time = ClockObject::get_global_clock()->get_real_time(); - _start_frame_count = 0; - _cur_frame_count = 0; - _current_fps = 0.; + if (foo == (XFontStruct *)NULL) { + glxdisplay_cat.warning() + << "Unable to load X display font for FPS meter\n"; + gl_show_fps_meter = false; + } else { + glxdisplay_cat.info() + << "Loaded X display font for FPS meter\n"; + glXUseXFont(foo->fid, 0, 128, FONT_BITMAP_OGLDISPLAYLISTNUM); + _start_time = ClockObject::get_global_clock()->get_real_time(); + _start_frame_count = 0; + _cur_frame_count = 0; + _current_fps = 0.; + } } }