Open discussions on programming specifically for the PS Vita.
Forum rules: Forum rule Nº 15 is strictly enforced in this subforum.
#417818 by domis4
Fri Apr 14, 2017 5:18 pm
Hello everyone,

i tried to get in touch with c++ for the first time and used one of the vitasdk samples in order to create some basic SDL2 application. Currently, i can't get past image loading using SDL2_image, as the image format is always unsupported no matter what format and properties i use (png, jpg, bmp). The small code behind loading and rendering is:
Code: Select allSDL_Texture* image = IMG_LoadTexture(gRenderer, path.c_str());

https://github.com/domis4/vita-sdl2-tes ... module.cpp
which throws
Code: Select allUnsupported image format

and results in an application crash due to texture nullpointer in SDL_RenderCopy().

After some research i thought to include libpng and zlib headers and use IMG_init(flags), but the application still throws and crashes.

Maybe a experienced Dev can see my mistake.
Advertising
#417819 by noname120
Fri Apr 14, 2017 9:05 pm
Your homebrew runs in safe mode, this means that it can only access ux0:data/* and ux0:app/YOURTITLEID/*.

If you're willing to embed resources in your app, add them here: https://github.com/domis4/vita-sdl2-tes ... ts.txt#L49
Advertising
#417824 by domis4
Sat Apr 15, 2017 8:52 am
thank you. This should have crossed my mind sooner. I wasn't too sure how i'd embed my assets.

While including it with
Code: Select allFILE src/assets/test.png assets/test.png
worked like a charm and is totally fine for me, the file got installed to ux0:/app/ap-id/assets/test.png but It still throws Unsupported Image format using either
app0:assets/test.png
or
ux0:/app/ap-id/assets/test.png

i figured, that even a wrong path specified to either of those dirs would throw "unsuported image format" while a completely different, wrong directory would throw "could not open file". Besides that, i'm still a bit worried why it would let me write to "ux0:domis4/log.txt" in safe mode.
#417829 by noname120
Sat Apr 15, 2017 2:13 pm
Strange. I don't have much experience with SDL2, you should probably ask xerpi on http://webchat.freenode.net/?channels=%23henkaku

By the way, you should change your VITA_TITLEID because "VSDK00013" is already used by a Vita sample.

Who is online

Users browsing this forum: No registered users and 2 guests