vita2d load png images crash

Display, framebuffers, GXM, etc.
Post Reply
kkl
Posts: 2
Joined: Sun Jan 22, 2017 1:22 pm

vita2d load png images crash

Post by kkl » Sun Jan 22, 2017 1:32 pm

Hi

i m playing with vita2d and this is the code:

Code: Select all

x and y here;

for (int i=0; i<9; i++) {
			vita2d_texture *preview = NULL;

			preview = vita2d_load_PNG_file("ux0:theme/ZUMIX/preview_thumbnail.png");

			vita2d_draw_texture(preview, x, y);
			
			// increment x and y here
	}
i run the app and after a few seconds it crashes.

the psp2dump says Data abort exception, SceGxm cause 0x00030004.

thanks

noname120
Posts: 22
Joined: Sun Dec 11, 2016 7:39 pm

Re: vita2d load png images crash

Post by noname120 » Sun Jan 29, 2017 1:52 pm

Is your app marked safe? If so, it cannot access this path.

Besides, you should also make sure that preview isn't NULL prior to using it.

Netrix
Posts: 3
Joined: Sat Jan 14, 2017 8:26 am

Re: vita2d load png images crash

Post by Netrix » Sun Jan 29, 2017 6:16 pm

That and the PNG shouldn't be loaded more than once.

noname120
Posts: 22
Joined: Sun Dec 11, 2016 7:39 pm

Re: vita2d load png images crash

Post by noname120 » Sun Jan 29, 2017 6:32 pm

Netrix is right, I overlooked the fact that your loading is inside the loop. This means that your image will be loaded 9 times which leaks memory.

Joel16
Posts: 6
Joined: Tue Dec 27, 2016 4:25 pm

Re: vita2d load png images crash

Post by Joel16 » Tue Jan 31, 2017 6:06 am

Not sure if you're trying to animate something using a loop? but yeah like the others said, load the image before the loop, but you'll be fine drawing it inside (if that's what you're program should be doing.)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest