My last question was on how to remove the DLLs and i could just static link them or whatever its called,
it was really simple... but now i want my game textures to be stored inside the executable too
i was thinking that this would be easy. so i looked it up and you need to use resource files for that.
i tried doing it but failed a lot.
i don't now how to load in the resource. can someone program a function like
sf::texture = loadResource("MyResource");
or give me a tutorial.
this is my current code
HRSRC resBlock = FindResource(NULL, "IDB_BITMAP1", RT_BITMAP);
HGLOBAL myGlobal = LoadResource(NULL, resBlock);
LPVOID firstByte = LockResource(myGlobal);
DWORD resSize = SizeofResource(NULL, resBlock);
sf::Image loadImg;
sf::Sprite tmpSpr;
sf::Texture text;
loadImg.loadFromMemory(firstByte, resSize);
text.loadFromImage(loadImg);
it does not work. at all.
oh and i copied it from someone else. (another post)
NOTE:
i'm using visual studio 2015
my English is horrible i know.
my last post was a bit unclear i hope this one is better.