[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeextragear-libs-1/kipi-plugins/slideshow
From: Renchi Raju <renchi () pooh ! tam ! uiuc ! edu>
Date: 2004-09-30 21:31:54
Message-ID: 20040930213154.B26969922 () office ! kde ! org
[Download RAW message or body]
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();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic