SFML community forums

Help => Graphics => Topic started by: mart++ on June 04, 2020, 04:24:43 am

Title: [SOLVED] Unable to load textures in SFML.net
Post by: mart++ on June 04, 2020, 04:24:43 am
I can create a window, draw shapes and lines etc to it, but haven't been able to load textures. I'm using C#, .net framework 4.6.2 with Visual Studio 2017.
When I create a texture, I can't call texture.loadFromFile(path) as it's shown in the tutorials.

If there's something I missed in the documentation or tutorials, please direct me to it. Thank you in advance.

Edit: Got it thanks to user Laurent.
Texture texture = new Texture(path);

Title: Re: Unable to load textures in SFML.net
Post by: Laurent on June 04, 2020, 07:35:02 am
Don't hesitate to have a look at the source code (https://github.com/SFML/SFML.Net/blob/master/src/SFML.Graphics/Texture.cs#L41).


Texture texture = new Texture(path);