+ std::string path;
+ if (fileName.data[0] == '*') {
+ // embedded
+ int embIdx = atoi(&fileName.data[1]);
+ aiTexture *texture = scene.mTextures[embIdx];
+ if (texture->mHeight == 0) {
+ Image img((unsigned char*)texture->pcData, texture->mWidth, texture->achFormatHint);
+ glTexImage2D(GL_TEXTURE_2D, 0, img.internalFormat(), img.width(), img.height(), 0, img.format(), img.type(), img.data());
+ } else {
+ fprintf(stderr, "TODO: handle uncompressed embedded textures");
+ abort();
+ }
+ } else {
+ // not embedded
+ Image img("models/" + std::string(fileName.C_Str()));
+ glTexImage2D(GL_TEXTURE_2D, 0, img.internalFormat(), img.width(), img.height(), 0, img.format(), img.type(), img.data());
+ }
+
+ glGenerateMipmap(GL_TEXTURE_2D);