@thePyro_13
@Laurent
Thanks for pointing me in the right direction! If anyone is interested in a solution, here's what I've setup:
test.hpp
#ifndef TEST_HPP
#define TEST_HPP
char test_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
0x08, 0x02, 0x00, 0x00, 0x00, 0xfc, 0x18, 0xed, 0xa3, 0x00, 0x00, 0x00,
0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00,
0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74,
0x49, 0x4d, 0x45, 0x07, 0xdb, 0x0a, 0x1a, 0x06, 0x2d, 0x30, 0xc3, 0x47,
0xff, 0xe7, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f,
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57,
0x81, 0x0e, 0x17, 0x00, 0x00, 0x02, 0x9f, 0x49, 0x44, 0x41, 0x54, 0x48,
0xc7, 0x8d, 0x56, 0x49, 0x72, 0xe4, 0x30, 0x0c, 0x03, 0xaa, 0xf4, 0xff,
0x4f, 0xe4, 0x3e, 0x2f, 0x24, 0x83, 0x39, 0x70, 0x11, 0xe5, 0xa5, 0x3b,
0x3e, 0x74, 0x62, 0x49, 0xe6, 0x02, 0x90, 0xa0, 0xf8, 0xef, 0xe7, 0x47,
0x02, 0x20, 0x90, 0x14, 0x04, 0x11, 0x14, 0x84, 0x78, 0x08, 0x8a, 0xa2,
0x20, 0x02, 0x22, 0x00, 0x42, 0x22, 0x08, 0x42, 0x12, 0x80, 0x5c, 0x17,
0xf2, 0x3b, 0x02, 0x22, 0x51, 0x7b, 0xcb, 0xcc, 0xc2, 0x94, 0x00, 0xa6,
0x55, 0x08, 0x20, 0x11, 0x5e, 0x04, 0x10, 0x69, 0x21, 0x0f, 0xe9, 0x38,
0x80, 0x8e, 0x25, 0xde, 0xf3, 0x40, 0x3a, 0x5e, 0x66, 0x1e, 0x06, 0x20,
0x88, 0xca, 0x7f, 0x05, 0x44, 0xd4, 0xdc, 0x06, 0x2f, 0xde, 0x21, 0x65,
0x36, 0xd3, 0x03, 0xc1, 0xf8, 0xb8, 0x2c, 0x2e, 0x73, 0x8b, 0x23, 0x22,
0xa9, 0x23, 0x24, 0x74, 0xe0, 0x69, 0x6d, 0xac, 0x17, 0x68, 0xf7, 0xe3,
0x20, 0x21, 0x05, 0xd0, 0x00, 0x97, 0xbb, 0xa7, 0xfd, 0x58, 0x91, 0xc0,
0xca, 0x5e, 0xe5, 0x94, 0xb8, 0x3f, 0x37, 0xf3, 0x75, 0x7e, 0x22, 0x2e,
0x2c, 0x77, 0x57, 0x30, 0x07, 0xd4, 0x66, 0xd9, 0x4f, 0xc3, 0xb1, 0x1a,
0xdf, 0x32, 0x82, 0x43, 0xe2, 0x4c, 0x08, 0xa4, 0x2a, 0x2a, 0xec, 0xd8,
0x0b, 0xd9, 0x4d, 0xf2, 0x1f, 0x1f, 0x26, 0x43, 0xef, 0x79, 0x9c, 0xcf,
0x32, 0xf3, 0x70, 0x1d, 0xe1, 0x44, 0x71, 0x31, 0xca, 0x15, 0x95, 0x54,
0xad, 0x76, 0x42, 0x8a, 0x22, 0x2a, 0x4f, 0xac, 0xba, 0xea, 0xe2, 0x40,
0x24, 0x0b, 0x2e, 0x77, 0xbb, 0x84, 0x31, 0xde, 0x1e, 0xe3, 0xbb, 0x95,
0x67, 0xf6, 0xcf, 0xd8, 0x19, 0xd0,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 0xff, 0xe2, 0xed, 0xdb, 0xbd, 0xe1, 0x4b, 0x6c,
0xcb, 0xdd, 0x46, 0x6f, 0x32, 0x4a, 0x76, 0xdf, 0x0d, 0x93, 0xed, 0x3d,
0x73, 0xd8, 0xd5, 0x9a, 0x92, 0x4d, 0x49, 0xe4, 0xa5, 0x67, 0xfa, 0x02,
0xc6, 0x90, 0xeb, 0xaf, 0x37, 0x21, 0xde, 0x68, 0xfe, 0x6b, 0x86, 0xcb,
0x5f, 0x3a, 0x59, 0xd7, 0x31, 0x5c, 0x99, 0xdd, 0xe7, 0xe2, 0x50, 0x6a,
0xed, 0x5b, 0x68, 0xee, 0xff, 0x07, 0xb7, 0x18, 0x41, 0x46, 0x68, 0x12,
0xa4, 0x87, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82,
};
#endif
Inside of my source file:
#include "test.hpp"
...
sf::Texture img_test;
sf::Sprite spr_test;
...
if (!img_test.LoadFromMemory(&test_png, sizeof(test_png)))
{
//oh no!
}
spr_test.SetTexture(img_test);
spr_test.SetPosition(30, 30);
... Main Loop ...
App.Draw(spr_test);
And it's working out as expected! Would this be an acceptable method for handling the assets that need to be included with the binary file? Could there be any significant problems using this method?