[Lxdream-dev] OSD work in progress

Jon Ring jonnyring at gmail.com
Thu Jul 9 20:15:38 PDT 2009


I have attached a patch that demonstrates the OSD functionality at this
point.  Here are some things to note and/or discuss, in no particular order:

1.  I used the FTGL library to do the drawing.  It is cross platform and
should be lightweight enough.

2.  I am currently using fontconfig to get the path to a font.  I'm pretty
sure it's X-specific, so that part won't work on OSX.  We'd need to find a
different way to get the path to an appropriate font there.  OSX, I believe,
comes with a default set of fonts that will always be there, so perhaps
getting a path to a well-known font won't be so bad on that platform.
Possible alternatives to trying to automatically find a font (on any
platform) are making the user pick a font (not the best idea in the world)
and including a font with lxdream.  Including a font also has the advantage
of being guaranteed to look the same on every platform.

3.  Do we want the OSD to be a main feature, or something that can be
optionally compiled in?

4.  To put a message on the OSD, I currently have it so you use
display_driver->display_show_osd(...).  This function could also be global
or a member of something else if this isn't the best location for it.

5.  Do you think we need to go as far as to have some sort of messaging
class?  It could push messages to the OSD, status bar, and/or log depending
on a setting.  This might be a "something else" of #4.

6.  The saved and loaded OSD messages in there now are more or less
placeholders until we answer #4 and #5.  I think the final version should
say which file/slot was saved or loaded, and also have a message when you
switch quick save slots.

7.  I'm guessing not everyone will want to see on screen messages.  I think
it would be good to have GUI options to toggle the speed from showing up,
and maybe options regarding whether the OSD messages show when you are in
windowed mode, fullscreen, or both (since there is the less obtrusive status
bar when you are in windowed mode.  Perhaps this is a good reason to keep
the status bar messages around?)  An OSD configuration GUI could be the
start of the currently grayed out Settings->Video menu item.

8.  Timers.  The OSD messages, if any exist, get rendered every frame, so I
update the remaining display time every frame.  This is also used to
smoothly fade out the OSD when its display time is up.  Is this OK or should
it be a g_timeout?  The status message timer would be best switched to a
g_timeout, but it will also need a special case to keep the speed update
from clobbering it while another message is being displayed.

9.  I'm an opengl noob.  Let me know if I did anything stupid in my drawing
code or hooked up osd_render() to the rest of the code in a horrible way
:-)  Something's still not perfect, as I get a little flickering in the text
on my mythtv box.

I think that's all for now.  Please let me know any thoughts you might have
on the above.

Jon


More information about the Lxdream-dev mailing list