Question/Problem with SDL_ttf program I made...
I want to integrate SDL_ttf into my little game of mine, but am having difficutly having a test program work so it displays onto the screen.. here is the code that I have...
Code:
#include <iostream> When I run this program all I get is the following: Code:
george@georgescomp1:~/cfiles/George Lair/030506/032906/041506/041706TEST$ ./TTFTest042206_105 |
You should not free a surface which has been created via setvideomode. see docs
Quote:
Your main function is incorrect, it should be Code:
int main (int argc, char *argv[]) also check the return value when you intailise sdl and try compling with -pthread. If these fixes don't get it running just post back. |
I did what you said dmail and I'm not too sure where to go for all I get is the following as an error message...
Fatal signal: Segmentation Fault (SDL Parachute Deployed) Here is my code now: Code:
#include <iostream> |
I've never used SDL_ttf, but I now see your problem. Have a look at this page
http://jcatki.no-ip.org/SDL_ttf/SDL_ttf.html#SEC21 the func takes a TTF_Font* as a param and your passing it a "0x00"(TTF_STYLE_NORMAL) which the func assumes is an address and this is the seg fault. [edit] in fact the above in not true, you are infact passing null Quote:
|
I'm back, it took sometime to get everything working without any immediatly apparent problems, (I mean compile errors) here is my problem now. I can compile my code fine and I can execute without a segfault, but I can't see my text no matter what color, or position I put them in. I'm at a loss, what do I do?
Code:
#include <iostream> |
I'm not sure .. maybe I missed something .. But shouldn't you do a SDL_Flip() or SDL_UpdateRects() after blitting?
My SDL knowledge is a little old :) Cheers |
Your knowledge is not too old, or at all! It works now, here is the code so anyone try out:
Code:
#include <iostream> Thank you dmail and cupubboy |
All times are GMT -5. The time now is 07:17 PM. |