Afficher une image avec SFML
Bonjour,
J'utilise Visual Studio 2017 ainsi que la librairie SFML.
Le problème et que je n'arrive pas à afficher une image dans une simple fenêtre.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(900, 614), "VAUDOO");
sf::Texture texture;
if (!texture.loadFromFile("Images/imprimante.png"))
{
std::cout <<"Le fichier n'est pas charge" << std::endl;
}
sf::Sprite sprite;
sprite.setTexture(texture);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(sprite);
window.display();
}
return 0;
} |
Le chemin n'est certainement pas bon. Pourtant j'ai essayé une plusieurs chemins différents et toujours pas d'image.
Ou va piocher texture.loadFromFile ?
Le chemin de mon projet est C:\Users\Drimwell\source\repos\Vaudoo c'est à dire là ou il y a mon fichier.sln
Le chemin des mes images est : C:\Users\Drimwell\source\repos\Vaudoo\Vaudoo\Images
Après le débogage la fenêtre s'ouvre sans l'image et me r'envoie forcement le message d'erreur de loadFromFile.
En fermant la fenêtre vous trouverez ci-dessous la liste d'erreur :
Voici les erreurs générés lors de la fermeture du programme :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| 'Vaudoo.exe' (Win32)*: Chargé 'C:\Users\Drimwell\source\repos\Vaudoo\x64\Debug\Vaudoo.exe'. Les symboles ont été chargés.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ntdll.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\kernel32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\KernelBase.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\SFML-2.5.1\bin\sfml-graphics-2.dll'. Le module a été généré sans symboles.
'Vaudoo.exe' (Win32)*: Chargé 'C:\SFML-2.5.1\bin\sfml-window-2.dll'. Le module a été généré sans symboles.
'Vaudoo.exe' (Win32)*: Chargé 'C:\SFML-2.5.1\bin\sfml-system-2.dll'. Le module a été généré sans symboles.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\winmm.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\msvcrt.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\user32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\gdi32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\lpk.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\usp10.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\msvcp140.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\vcruntime140.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ucrtbase.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-timezone-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-file-l2-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-localization-l1-2-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-synch-l1-2-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-processthreads-l1-1-1.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-core-file-l1-2-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-heap-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-string-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-stdio-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-convert-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-locale-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-math-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-filesystem-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-time-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-environment-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\api-ms-win-crt-utility-l1-1-0.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\opengl32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\advapi32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\sechost.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\rpcrt4.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\glu32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ddraw.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\dciman32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\setupapi.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\cfgmgr32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\oleaut32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ole32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\devobj.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\dwmapi.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\msvcp140d.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\vcruntime140d.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ucrtbased.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\imm32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\msctf.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\nvinitx.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\version.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Program Files\NVIDIA Corporation\coprocmanager\_etoured.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Program Files\NVIDIA Corporation\coprocmanager\nvd3d9wrapx.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Program Files\NVIDIA Corporation\coprocmanager\nvdxgiwrapx.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\uxtheme.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\wintrust.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\crypt32.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\msasn1.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\ig4icd64.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\dinput8.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\hid.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
'Vaudoo.exe' (Win32)*: Chargé 'C:\Windows\System32\cryptbase.dll'. Impossible de trouver ou d'ouvrir le fichier PDB.
Le thread 0x143c s'est arrêté avec le code -1073741510 (0xc000013a).
Le programme '[5508] Vaudoo.exe' s'est arrêté avec le code -1073741510 (0xc000013a). |