SISSEGV is Segmentation Fault.
You get a Segmentation Fault usually when you access memory that you should not.
And looking in your code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
SpriteImage * fge_CreateTextSpriteImage(std::string text, Renderer * renderer, Font * font, Color color)
{
SpriteImage * tmp;
// where does this pointer point to?
// it has garbage value because it is not initialized!
if(!renderer)
fge_Logger("renderer can not be NULL");
else
{
tmp->surface = fge_CreateTextSurface(text.c_str(), renderer, font, color);
if(!tmp)
fge_Logger("failed to create spriteimage");
}
return tmp;
}
A pointer is a variable that holds a memory address.
You must ensure that it holds a valid memory address, by allocating memory with new.