Results 1 to 4 of 4

Thread: ClanLib 0.9 OpenGL Fonts

  1. #1
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default ClanLib 0.9 OpenGL Fonts

    Should the OpenGL fonts be moved from GL into Display ?

    Since window creation was moved into Display, this should now be possible.

    The reasoning for this is that the fonts do not access GL directly, they can go through the CL_GraphicContext interface.

    Also, this would be beneficial for the DirectX targets, a separate font class would not need writing.

    Any thoughts?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    This is a tricky issue.

    Strictly speaking fonts can be implemented completely generic outside the clanDisplay provider interface. So this votes in favor for your proposal to simply make all targets use the same font implementation.

    However, the reason I made it part of the implementation in the first place is actually the GDI target. With the pending revision of the clanDisplay API where we add a couple of 'Standard Shader Programs' powering our 2D engine, the idea that the GDI target will only support these programs and not any custom shader code. In principle this target will still be able to render generic fonts, since the font stuff would just use these shaders, but I fear the speed might not match native Win32 functions such as DrawText. So I chose at the time to simply make text rendering a special 'primitive' type for the display abstraction, thus allowing a software target to use a different method to render them.

    All that said, I really would prefer to have the fonts in 0.9 moved to clanDisplay for the sake of the D3D targets. I'm just not entirely sure if a GDI target will be good at text if we do this. It all depends on how fast that target can render the glyphs.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I have now moved fonts out of OpenGL and into Display.

    Also, i have implemented the fonts for DirectX9.

    For GDI, you can either use the standard implementation or a generic one.

    In CL_GraphicContextProvider::alloc_font(...)

    You add:
    return new CL_FontProvider_Native(this,...);
    or
    return new CL_FontProvider_GDI_Special_Font(this,...);

    The font implementation has moved into the directory: Sources/Display/Font

    I hope it is all okay.

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Excellent

Similar Threads

  1. OpenGL 3.0 and ClanLib 0.9
    By Judas in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-13-2008, 04:52 AM
  2. my fonts are really grainy
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-11-2008, 04:07 PM
  3. Little example ClanLib+OpenGL
    By rinsukaze in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 05-13-2008, 07:15 AM
  4. ClanLib gui and fonts
    By LonelyStar in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-28-2008, 07:52 AM
  5. Fonts & Graphics
    By AllenJB in forum Game development
    Replies: 1
    Last Post: 09-16-2006, 12:00 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •