For my project, I need to load PNGs.
I have paked the code to load PNG in a Header.
My Header: (bg.h)
Code: Select all
#ifdef __cplusplus
extern "C" {
#endif
#include <malloc.h>
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <stdio.h>
#include "graphics.h"
#include "framebuffer.h"
void bg(void) {
Image* bg;
bg = loadImage("bg.png");
while(1)
{
blitAlphaImageToScreen(0, 0, 480, 272, bg, 0, 0);
}
}
#ifdef __cplusplus
}
#endif
Code: Select all
#include "bg.h"
Code: Select all
bg();
My makefile:
Code: Select all
TARGET = V1.0
OBJS = main.o graphics.o framebuffer.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = V1.0
LIBS = -lpspgu -lpng -lz -lm -lpspumd -lpspusb -lpspusbstor -lpspctrl
PSPSDK= D:\pspdev\psp\sdk
include $(PSPSDK)\lib\build.mak