I'm working on my game framework. It compiles fine, but when I run the executable (which is eventually going to be a working game), I get this message from gdb:
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b73152 in Survive::Game::TwoD::Entity2D::draw (this=0x91a, display=0x640f20) at libsurvive/src/game/2d/Entity2D.cpp:26 26 spr.draw(display, x, y);
This is the definition of Entity2D::draw:
void Entity2D::draw(SDL_Surface *display) {
spr.draw(display, x, y);
}
display is a pointer to the screen, I know it is valid.
spr is the entity's underlying sprite. I know it has been constructed correctly, because the entity initialized fine.
x and y are the coordinates to draw the sprite at. They have both been instantiated.
What might be causing this then?
I'm working in Ubuntu, using makefiles generated by premake to build.
Thanks in advance!


Find content
Male