Hello guys im not able to load any image or texture to my game.
i always get this error:"Failed to load image ".jpg 羴 ". Reason: Unable to open file" (it`srare not full name only .jpg display error"
My code:
#include <SFML/Graphics.hpp>
#include "../include/head.h"
#include "../include/mainfuctions.h"
//
SystemT* main_system=nullptr;
//
int main()
{
sf::RenderWindow window(sf::VideoMode(224, 256), "SpaceInvader");
sf::Texture texture;
texture.loadFromFile("logo.jpg");
window.setFramerateLimit(60);
main_system=SystemTInit();
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.display();
}
return 0;
}
SystemT * SystemTInit()
{
SystemT *pointer=NULL;
pointer=(SystemT*)calloc(1,sizeof(SystemT));
return pointer;
}
my dir where im running the program and also where i have the logo.jpg file:
23/09/2018 10:51 <DIR> .
23/09/2018 10:51 <DIR> ..
22/09/2018 12:46 526 compilacion.old.bat
21/09/2018 02:15 5.273 logo.jpg
23/09/2018 10:51 39.936 main.exe
23/09/2018 10:51 397.148 main.ilk
23/09/2018 10:51 102.833 main.obj
23/09/2018 10:51 1.282.048 main.pdb
22/09/2018 00:13 1.869 monsterbat-full.bat
08/05/2018 22:40 630.784 openal32.dll
22/09/2018 06:46 810 README.md
08/05/2018 22:43 1.383.424 sfml-audio-d-2.dll
08/05/2018 22:43 1.434.112 sfml-graphics-d-2.dll
08/05/2018 22:43 338.944 sfml-network-d-2.dll
08/05/2018 22:42 188.416 sfml-system-d-2.dll
08/05/2018 22:43 339.968 sfml-window-d-2.dll
23/09/2018 10:51 757.760 vc140.pdb
15 archivos 6.903.851 bytes
2 dirs 128.710.004.736 bytes libres
im using 32 bits library, anyway here is my compile code:
cl /nologo /Zi /GR- /EHs /MD %2 -I %1\%base_route%\include %1\%base_route%\lib\sfml-window-d.lib %1\%base_route%\lib\sfml-main.lib %1\%base_route%\lib\sfml-system-d.lib %1\%base_route%\lib\sfml-graphics-d.lib opengl32.lib user32.lib gdi32.lib shell32.lib Ws2_32.lib
what im doing wrong?
Thanks for any help