12 bool Texture::load(const char *fname)
18 images.push_back(img);
24 /* check if it is a cubemap */
25 return load_cubemap(fname);
28 bool Texture::load_cubemap(const char *fname)
30 const char *suffixes[] = {
35 for(int i=0; i<6; i++) {
36 char *buf = new char[strlen(fname) + 3 + 1];
38 char *suffix = strrchr(buf, '.');
41 memmove(suffix + 3, suffix, strlen(suffix) + 1);
42 memcpy(suffix, suffixes[i], 3);
44 strcat(buf, suffixes[i]);
52 images.push_back(img);
59 bool Texture::is_cubemap() const
61 return images.size() > 1;