1
Graphics / Re: Black window after clear/draw/display when draw called from within an object.
« on: May 16, 2013, 02:50:13 pm »
Apologies, like this:
To be more specific, the code from before is slightly inaccurate because I forgot it was an older version I had saved on my laptop. It's actually:
And with this I realize my mistake - you can't call a constructor from another in C++, can you? I tried just now and just calling the one with the filename parameter works as intended.
Damn. Thank you for your time, I don't think I'd have caught this by myself.
MainGameScreen::MainGameScreen(void) : map()
{
}
{
}
To be more specific, the code from before is slightly inaccurate because I forgot it was an older version I had saved on my laptop. It's actually:
GameMap::GameMap() {
GameMap::GameMap("resources\\art\\map_tiles_generic.png");
}
GameMap::GameMap(std::string filename)
{
textureMapTiles.loadFromFile(filename);
/*snip*/
}
GameMap::GameMap("resources\\art\\map_tiles_generic.png");
}
GameMap::GameMap(std::string filename)
{
textureMapTiles.loadFromFile(filename);
/*snip*/
}
And with this I realize my mistake - you can't call a constructor from another in C++, can you? I tried just now and just calling the one with the filename parameter works as intended.
Damn. Thank you for your time, I don't think I'd have caught this by myself.