Basically I can load and texture a cube if I load the texture from a romdisk, if I load it form my PC via a coders cable then it just hangs and doesn't load the image. (not slow, actually halting).
No errors or anything.
I tried this with the example in examples/kgl/basic/gl example and it's still not making a difference.
I'm sure the path to the image is correct, I've set the working directory to the correct place etc.
If you're too lazy to look at the examples, here's the code:
Code: Select all
// fn- "/pc/crate.pcx
void loadtxr(const char *fn, GLuint *txr) {
kos_img_t img;
pvr_ptr_t txaddr;
if (pcx_to_img(fn, &img) < 0) { // Get's stuck here
printf("can't load %s\n", fn);
return;
}
txaddr = pvr_mem_malloc(img.w * img.h * 2);
pvr_txr_load_kimg(&img, txaddr, PVR_TXRLOAD_INVERT_Y);
kos_img_free(&img, 0);
glGenTextures(1, txr);
glBindTexture(GL_TEXTURE_2D, *txr);
glKosTex2D(GL_RGB565_TWID, img.w, img.h, txaddr);
}
Thanks.