I am coding a game , and just started some of the graphical part so I just started to try using SFML for it , but I had a bug where a sprite would not show on screen, so I tought that ther was bugs deep into my code , and so I made a fresh project with what could be considered like the most basic code to show a Sprite , but it is doing the same thing , and I can't understand why...
Here is the basic code(even if you could guess it x) ):
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main(){
RenderWindow window(VideoMode(500,500),"Test");
Texture lavaFlow;
lavaFlow.loadFromFile("lavaFlow.png");
Sprite lavaFlowSprite;
lavaFlowSprite.setTexture(lavaFlow);
while(window.isOpen()){
Event event;
while(window.pollEvent(event)){
if(event.type == Event::Closed){
window.close();
}
window.clear();
window.draw(lavaFlowSprite);
window.display();
}
}
return 0;
}
And few things to know , since I am compiling on Debug , some of the error shows , so I know that the Image has been loaded , and the image was firts in jpeg so I thank that it was maybe a type problem , so I converted it into png
Thanks to anyone who could help me !