12 bool Texture::load(const char *fname)
18 images.push_back(img);
24 printf("%s NOT LOADED\n", fname);
25 /* check if it is a cubemap */
26 return load_cubemap(fname);
29 bool Texture::load_cubemap(const char *fname)
31 const char *suffixes[] = {
36 for(int i=0; i<6; i++) {
37 char *buf = new char[strlen(fname) + 3 + 1];
39 char *suffix = strrchr(buf, '.');
42 memmove(suffix + 3, suffix, strlen(suffix) + 1);
43 memcpy(suffix, suffixes[i], 3);
46 strcat(buf, suffixes[i]);
54 images.push_back(img);
61 bool Texture::is_cubemap() const
63 return (images.size() > 1);