76
Graphics / Re: Help! Regarding view and world drawing
« on: March 10, 2016, 09:11:16 am »I probably shouldn't point this out but it is, in fact, possible to update automatically in the draw method but it can get really messy (the draw method is const so it can't/shouldn't alter anything).Will do! I wanted to put it all in one draw() function, but i can appreciate keeping the logic separated in favor of code tidyness. This game is a relatively ambitious project (for me), so that's why i'm aiming for the best / most efficient approach.
I did do that for sw::Sprite3D so that it would work in the same way as a normal sf::Sprite - without needing an extra update method. Feel free to have a look through the code
1) vector of sf::Image for each tileset (as you said)Can't get any clearer than this :-). Awesome!
2) create a temporary sf::Image and use the vector to provide the pieces you want to copy, then update the sf::Texture from that image.
3) use the sf::Texture to draw the vertex array (no render texture needed?)
I'm not sure why you have a render texture although you can either use an sf::Image or an sf::RenderTexture in the place of the "temporary sf::Image" described above.The render Texture in the third step was more meant as drawing to the render object. It could/should have been RenderWindow, but i wrote renderTexture because it still feels strange to draw tile world directly to the window, instead of drawing it in the background and then display whole thing once.
It had nothing to do though with the process of selecting tiles and updating using the vertex :-)
This game is going to be amazing! Can't wait to put it all together!