Re: SDL roguelike example in C (or C++)



"Jeff Lait" <torespondisfutile@xxxxxxxxxxx> writes:

> Sherm Pendley wrote:
>>
>> Out of curiousity, why'd you do it that way? SDL_ttf has nice antialiased
>> text rendering, with transparency if you want it.
>
> I had already knew how to do the tile blitting from my POWDER code
> (which uses tiles) so it was the fastest path to success.

Not much difference between blitting a bitmap and blitting text. Instead
of calling an Image_Load*() function, you call one of the TTF_Render*()
functions, which returns an SDL_Surface*. There are functions to render
single glyphs or whole strings, at three different quality settings.

As is typical of SDL though, only the low-level functions are provided.
For instance, I had to write my own word-wrap function.

> Does ttf support bitmap fonts? For small text, like in roguelikes, I
> prefer bitmapped fonts...

No, no bitmapped fonts - although the fastest rendering functions don't
do antialiasing, which is the #1 gripe most people have with TTF or PS
fonts at small sizes.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
.



Relevant Pages

  • Re: SDL roguelike example in C (or C++)
    ... >>> text rendering, with transparency if you want it. ... >> I had already knew how to do the tile blitting from my POWDER code ... > Not much difference between blitting a bitmap and blitting text. ... >> Does ttf support bitmap fonts? ...
    (rec.games.roguelike.development)
  • Offscreen rendering with antialiasing
    ... I need offscreen rendering with antialiasing. ... I create a window that is not shown. ... In DirectX SDK Doc is mentioned that GetFrontBufferData method is the ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: [FreeType2] Disabling the antialiasing
    ... > Documentation for FreeType2 does not explain the procedure to disable TrueType ... > template places avatar images over some dark areas of the page. ... That's quite probably a web design issue, not an antialiasing issue. ... Are you rendering text to images? ...
    (freebsd-questions)
  • Re: Detecting MultiSampling override
    ... antialiasing without changing the applications which does the rendering. ... graphics drivers does the antialiasing without asking the program. ...
    (microsoft.public.win32.programmer.directx.graphics)