N00b HELP! SDL_ttf problem (file placement)?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
thebigbad
Posts: 3
Joined: Tue Apr 01, 2008 2:24 am
Location: New York, NY

N00b HELP! SDL_ttf problem (file placement)?

Post by thebigbad »

Hi,

I'm having a problem with a simple program (my first for PSP) I'm working on which uses SDL_ttf. I've built the libraries, and everything seems to work fine, but text does not show up on the screen. Compiling the same code on Linux does display the text.

Is there a certain directory that files must be placed? I have the file (FreeSans.ttf) in the same directory as EBOOT.PBP.

Do I have to open the font specifying the path in a specific way? The line right now to open the font looks like:

Code: Select all

TTF_OpenFont("FreeSans.ttf", 18);
I've tried outputting any errors to a text file, but the file never gets created.

The Makefile is that of the logic sample with "-lSDL_ttf -lfreetype -lSDL..." and other appropriate SDL stuff added.

I've drawn images to the screen with no problem, so it is working, just not TTF.

I've tried outputting to std::cout and/or std::cerr, but while stdout.txt and stderr.txt are created, they are both empty.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Are you sure you use the SDL_Flip(screen); function.

It was my problem too and i found this solution.
thebigbad
Posts: 3
Joined: Tue Apr 01, 2008 2:24 am
Location: New York, NY

Post by thebigbad »

Thanx that was the first thing i checked as i've done that before. Like i said everything else like images show just not text. Works fine on linux.
thebigbad
Posts: 3
Joined: Tue Apr 01, 2008 2:24 am
Location: New York, NY

Post by thebigbad »

Well, I finally get PSPLink to work, although I have issues with it I'll leave that for later.

Now that I'm running under PSPLink, I get my debugging messages that I put in the code, woohoo!

TTF_GetError() returns "Can't seek in stream." A search on here reveals nothing, and Google no help either (all results snippets of SDL_ttf.c where it returns the error).

I see there is another project on PSP that uses SDL?SDL_ttf although I haven't the chance to try it yet.

A little info on the psplibraries build I'm using:

Revision 2354 of the psp toolchain.
Revision 2347 of the psplibraries chain, 12-12-07.

Older than I originally thought, I'll update these later, as compiling the toolchain/libs on this thing is S-L-O-W. Will the newer revisions even fix this problem? From what I can see, its somewhere in SDL_ttf, SDL_RWops, or maybe the standard fseek. Unfortunately I'm a casual developer and don't have the knowledge I need to fix this if I have to go too deep.

Built on Ubuntu 7.10, 2.6.22-14-ppc32 g++ 4.1.3, ld 2.18 (I guess this shouldn't matter unless 4.1.3 has bugs in regards to compiling the psp toolset).
Post Reply