- bugfixes to avoid segfault when user has no sound card or openal cannot init

- more fallback handling for non power of two textures
This commit is contained in:
Mark Vejvoda
2011-05-18 17:54:46 +00:00
parent 93767d8ed8
commit ae47b47bc8
3 changed files with 92 additions and 38 deletions

View File

@@ -51,8 +51,13 @@ void checkGlExtension(const char *extensionName);
void inline _assertGl(const char *file, int line, GLenum *forceErrorNumber = NULL) {
GLenum error = (forceErrorNumber != NULL ? *forceErrorNumber : glGetError());
if(error != GL_NO_ERROR) {
const char *errorString= reinterpret_cast<const char*>(gluErrorString(error));
throw runtime_error("OpenGL error #" + intToStr(error) + " : " + string(errorString) + " at file: " + string(file) + ", line " + intToStr(line));
//if(error != GL_INVALID_ENUM) {
const char *errorString= reinterpret_cast<const char*>(gluErrorString(error));
char szBuf[4096]="";
sprintf(szBuf,"OpenGL error #%d [0x%X] : [%s] at file: [%s], line: %d",error,error,errorString,file,line);
//throw runtime_error("OpenGL error #" + intToStr(error) + " : " + string(errorString) + " at file: " + string(file) + ", line " + intToStr(line));
throw runtime_error(szBuf);
//}
}
}