1
General / Re: Android build error on launch
« on: August 16, 2023, 08:52:26 am »
First error suggests an issue with EGL initialization. make sure that you're initializing EGL properly before using it.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Note that this code is wrong:if (!texture.loadFromFile("/assets/textures/image.jpg"))
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
without indentation it means:if (!texture.loadFromFile("/assets/textures/image.jpg"))
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
So it would also just exit your application.
I'm personally a fan of using curly braces at all times, even or especially for single line statements:if (!texture.loadFromFile("/assets/textures/image.jpg"))
{
std::cout << "\nFailed loading texture.\n";
return EXIT_FAILURE;
}
Note the same issue for the music
You most likely don't want to use /assets as this will look for a folder in the root directory of you system called assets. For a relative path, you can just use assets/textures/image.jpg.
Then make sure the assets directory in your working directory.p.s.: This is my first time posting here, sorry if the formatting is trash.You can use the [code=cpp][/code] tags for code formatting.
Window created.
Creating texture...
%
Window created.
Creating texture...
Failed to load image "/assets/textures/image.jpg". Reason: Unable to open file
Failed loading texture.