| View previous topic :: View next topic |
| Author |
Message |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Sat Oct 14, 2006 8:52 am Post subject: Graphics Library for 2.71 se? |
|
|
Is there a graphics library or something I could use for 2.71
Like the graphics.c but made for 2.71
I have no clue why it does not work but it isnt loading the image
image->data = (Color*) memalign(16, image->textureWidth * image->textureHeight * sizeof(Color));
if (!image->data) {
free(image);
fclose(fp);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return NULL;
}
some where in that block it does not work right nad return null for the loaded image so I couldnt use it. |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Sat Oct 14, 2006 9:06 am Post subject: |
|
|
This means your allocation fails, what can have some reasons:
a) you're running out of memory - check how much you're allocating
b) you have a buffer/stack overflow somewhere before that, which causes the alloc to fail (most likely) _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Sat Oct 14, 2006 9:14 am Post subject: |
|
|
weird i didnt even code much though .
just using the 2.71 se
i am just trying ot replace the textr based gui with a gui with pictures like what i been doing in my mod.
but now i cant use the graphics.c
no clue how to fix it. but is there a working graphics.c for 2.71 homebrews? |
|
| Back to top |
|
 |
aeolusc
Joined: 14 Oct 2006 Posts: 18
|
Posted: Sat Oct 14, 2006 1:54 pm Post subject: |
|
|
| Use macro PSP_HEAP_SIZE_KB to pre-allocate memory for libc use in prx module. |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Sat Oct 14, 2006 2:26 pm Post subject: |
|
|
| do you know a example of the line rewritten to using PSP_HEAP_SIZE_KB ? |
|
| Back to top |
|
 |
aeolusc
Joined: 14 Oct 2006 Posts: 18
|
Posted: Sat Oct 14, 2006 7:06 pm Post subject: |
|
|
if you wanna allocate 8MB memory for libc use in prx module, just write following line right after PSP_MODULE_INFO:
PSP_HEAP_SIZE_KB(1024 * 8); |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Mon Oct 16, 2006 4:55 am Post subject: |
|
|
| is that the max I could use? |
|
| Back to top |
|
 |
TheBuzzer
Joined: 06 Feb 2006 Posts: 49
|
Posted: Mon Oct 16, 2006 5:08 am Post subject: |
|
|
also the line of code worked.
i can see some graphics now |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Mon Oct 16, 2006 6:37 am Post subject: |
|
|
| you should be able to get more (with devhook loading i could get 22-23mb maybe with 2.71SE you can use the full 24mbytes) |
|
| Back to top |
|
 |
|