Hi!
So I tried to draw a simple sprite but I can't get it to work. Why ? I don't think I have done any mistakes but it just shows a black screen when running the code. What's the problem ?
Here is my code:
#include "include/SFML/Graphics.hpp"
#pragma region Variables
sf::RenderWindow window(sf::VideoMode(750, 750), "Title");
#pragma endregion Variables
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
sf::Texture texture;
texture.loadFromFile(".\\Resources\\Level\\Textures\\dirt.jpg");
sf::Sprite sprite;
sprite.setTexture(texture);
window.draw(sprite);
window.display();
}
}
I'm using Visual Studio under Windows 10 if some you wanted these infos.
Thanks in advance