CVS commit by pahlibar: check for max texture value allowed before generating the textures. one user had a rather low texture size of 512. fixed problem over priv mail conversation. CCMAIL: 90183-done@bugs.kde.org M +20 -2 slideshowgl.cpp 1.9 --- kdeextragear-libs-1/kipi-plugins/slideshow/slideshowgl.cpp #1.8:1.9 @@ -50,6 +50,6 @@ SlideShowGL::SlideShowGL(const QStringLi resize(QApplication::desktop()->size()); - width_ = QMIN( 1024, 1 << (int)ceil(log((float)width())/log((float)2)) ); - height_ = QMIN( 1024, 1 << (int)ceil(log((float)height())/log((float)2)) ); + width_ = 64; + height_ = 64; // -------------------------------------------------- @@ -119,4 +119,22 @@ void SlideShowGL::initializeGL() glClearDepth(1.0f); + // get the maximum texture value. + GLint maxTexVal; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexVal); + + // allow only maximum texture value of 1024. anything bigger and things slow down + maxTexVal = QMIN(1024, maxTexVal); + + width_ = QApplication::desktop()->width(); + height_ = QApplication::desktop()->height(); + + width_ = 1 << (int)ceil(log((float)width_)/log((float)2)) ; + height_ = 1 << (int)ceil(log((float)height_)/log((float)2)); + + width_ = QMIN( maxTexVal, width_ ); + height_ = QMIN( maxTexVal, height_ ); + + // load the first image + loadImage(); }