ssgState * grSsgEnvTexState(char *img) { char buf[256]; char *s; grMultiTexState *st; // remove the directory s = strrchr(img, '/'); if (s == NULL) { s = img; } else { s++; } if (!grGetFilename(s, grFilePath, buf)) { GfOut("grSsgLoadTexState: File %s not found\n", s); return NULL; } st = new grMultiTexState; grSetupState(st, buf); st->setTexture(buf); return (ssgState*)st; }
ssgState * grSsgLoadTexStateEx(char *img, char *filepath, int wrap, int mipmap) { char buf[256]; char *s; grManagedState *st; // remove the directory s = strrchr(img, '/'); if (s == NULL) { s = img; } else { s++; } if (!grGetFilename(s, filepath, buf)) { GfOut("File %s not found\n", s); return NULL; } st = grGetState(buf); if (st != NULL) { return (ssgState*)st; } st = grStateFactory(); grSetupState(st, buf); st->setTexture(buf, wrap, wrap, mipmap); return (ssgState*)st; }
ssgState * grSsgEnvTexState(const char *img) { const int BUFSIZE = 1024; char buf[BUFSIZE]; const char *s; grManagedState *st; // remove the directory s = strrchr(img, '/'); if (s == NULL) { s = img; } else { s++; } if (!grGetFilename(s, grFilePath, buf, BUFSIZE)) { GfOut("grSsgLoadTexState: File %s not found\n", s); return NULL; } /*st = grGetState(buf); if (st != NULL) { return (ssgState*)st; }*/ st = new grMultiTexState(); grSetupState(st, buf); st->setTexture(buf); return (ssgState*)st; }