Author Topic: Does SDL_TTF work in OD?  (Read 2119 times)

DiegoSLTS (OP)

  • *
  • Posts: 363
Does SDL_TTF work in OD?
« on: October 08, 2012, 12:50:09 am »
I'm trying to use SDL_TTF but it's not working.

First of all, the code works perfect on my Ubuntu, then I build it for OD (with the same flags for the compiler) and the text doesn't show on screen.

They're used in a menu, there's also a cursor that shows OK, but it's made with SDL functions.

The SDL_TTF library isn't giving me any errors, the font I'm using is FreeMono.ttf, on a /res folder. Should I use OD fonts from a system folder? Where are they? I've searched through the folders but found nothing.

If noone knows that, can you name an opensource emulator/game for OD that uses them so I can check it?

DiegoSLTS (OP)

  • *
  • Posts: 363
Re: Does SDL_TTF work in OD?
« Reply #1 on: October 08, 2012, 05:08:57 am »
Nevermind, it had nothing to do with SDL_TTF. It looks like SDL_BlitSurface can't be used on a locked surface in OD, everything works fine now.

pcercuei

  • ***
  • Posts: 1397
    • GitHub
Re: Does SDL_TTF work in OD?
« Reply #2 on: October 08, 2012, 05:20:39 am »
Locking the surface is useful only when you make explicit use of its "pixel" pointer. To perform other operations, you should have it unlocked.

clach04

Re: Does SDL_TTF work in OD?
« Reply #3 on: October 13, 2012, 06:30:27 am »
...
If noone knows that, can you name an opensource emulator/game for OD that uses them so I can check it?

I know I'm late to this but just in case anyone else wants a demo check out https://bitbucket.org/clach04/sdl_keycodes (OhBoy also has the option to use TTF or bitmap fonts).

 

Post a new topic
Post a new topic