[Lxdream-dev] OSD work in progress

Nathan Keynes nkeynes at lxdream.org
Thu Jul 30 21:12:21 PDT 2009


On Jul 29, 2009 1:31pm, Jon Ring <jonnyring at gmail.com> wrote:
> Here is a new patch with some changes.  This is what's changed (and what
hasn't):
>
> 1.  Fonts are now rendered with Freetype 2.  Hopefully this works out
better as a cross-platform high-quality option.  It automatically
anti-aliases the text which makes it look nicer than the X/GLX version.
Both ways generate display lists, so I could use your X code as a fallback
if necessary.  Even if we don't do this, I may refactor the
freetype-specific code to a separate file just to make it easier to read.

Hey... that looks really awesome. I like the approach of constructing a font
texture too, hadn't thought of doing it that way, but makes sense and is
even portable :). I don't have any problem with a freetype dependency since
it's practically always installed anyway.

> 2.  The code still uses fontconfig at the moment, but I plan to bundle a
font so that fontconfig doesn't get a chance to make any weird font choices
for anyone.

Ok. For now though fontconfig isn't a problem.

> 3.  I added the GTK configuration dialog for video settings (nothing is
hooked up to configuration values yet). I added an option for font size
because on a PC a smaller font would be readable, whereas on a TV you'd want
a bigger font.

If you're going to do that, I'm thinking you might as well go all the way
and use a GtkFontSelectionDialog, let the user pick any (truetype) font -
probably actually about the same amount of work or less.

> 4.  I didn't realize just how many INFO messages there were until I
started showing them on the OSD!  These and probably the warnings as well
are going to need to be cleaned up, many should probably be switched to
DEBUG.

I've just pushed a patch to nuke those - most of them are pretty old and
have just hung around through inertia.

> 5.  The OSD functions are now top-level and initialized in main.c, instead
of tied to the driver.

Nice. I'd probably move it out of the driver directory too since it seems to
be generic and stick it in the (increasingly inaccurately named) pvr2
directory where all the other generic GL code lives.

> 6.  I still need to look at the flickering/double buffering.  I also need
to make sure my opengl code doesn't cause any bad side-effects in the rest
of the opengl drawing functions.

Seems to be behaving itself so far. The other rendering functions are pretty
paranoid anyway and reset all the state at the start. I might reorg the code
to do proper double-buffering and see if there's any actual performance hit
(I expect probably not actually).

Nits:
* log_message should ignore the global log level for errors + osd/status
messages (ie log level only applies to actual logging output)
* messages don't disappear if the emu is stopped (I tend to think they
should)

Suggestions:
* in the OSD setup, it might be a little simpler/more efficient to use a
single texture with the full alphabet on it, rather than separate textures
per character.
* It's probably also easier if you use GL_TEXTURE_RECTANGLE_ARB instead of
GL_TEXTURE_2D. Rectangle textures have two useful features - they're
arbitrary sized (don't have to be power of 2), and the tex coords aren't
normalized (ie they're 0..size of texture rather than 0..1)
* Could probably also get away with a pure alpha texture in this case since
you're just setting the luminance to 1.0 anyway.

* It would be really nice if you could stack messages, so that when you get
multiple messages at the bottom they're pushed up the screen, and then wink
off in order as well (data structure might need some rethinking though).

Cheers,
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lxdream.org/pipermail/lxdream-dev-lxdream.org/attachments/20090731/7e55bd30/attachment-0001.htm>


More information about the Lxdream-dev mailing list