Back to index

kdeartwork  4.3.2
wave.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // kwave - Partical Wave Screen Saver for KDE 2
00004 //
00005 // Copyright (c)  Ian Reinhart Geiser 2001
00006 //
00008 //NOTE:
00009 // The base particle engine did not come from me, it was designed by Jeff Molofee <nehe@connect.ab.ca>
00010 // I did some extensive modifications to make it work with QT's OpenGL but the base principal is about
00011 // the same.
00013 
00014 #ifndef WAVE_H
00015 #define WAVE_H
00016 
00017 #include <qdialog.h>
00018 #include <qgl.h>
00019 #ifdef Q_WS_MACX
00020 #include <OpenGL/glu.h>
00021 #include <OpenGL/gl.h>
00022 #else
00023 #include <GL/glu.h>
00024 #include <GL/gl.h>
00025 #endif
00026 #include <kscreensaver.h>
00027 #include <qtimer.h>
00028 #include <qimage.h>
00029 #include "ui_wavecfg.h"
00030 
00031 
00032 class Wave : public QGLWidget
00033 {
00034 Q_OBJECT
00035 
00036 public:
00037        Wave( QWidget * parent=0 );
00038        ~Wave();
00039 
00040 protected:
00042        void paintGL ();
00044        void resizeGL ( int w, int h );
00046        void initializeGL ();
00047 
00048 
00049 private:
00050 //
00051        GLUnurbsObj *pNurb;
00052        GLint nNumPoints;
00053 //     float ctrlPoints[4][4][3];
00054 //     float knots[8];
00055        int index;
00056        bool LoadGLTextures();
00057        GLuint  texture[1];
00058        QImage  tex;
00059 
00060 };
00061 
00062 class KWaveSaver : public KScreenSaver
00063 {
00064 Q_OBJECT
00065 public:
00066        KWaveSaver( WId drawable );
00067        virtual ~KWaveSaver();
00068        void readSettings();
00069 public slots:
00070        void blank();
00071 
00072 private:
00073        Wave *wave;
00074        QTimer  *timer;
00075 };
00076 
00077 class KWaveSetup : public QDialog, public Ui::SetupUi
00078 {
00079        Q_OBJECT
00080 public:
00081        KWaveSetup( QWidget *parent = 0L );
00082     ~KWaveSetup( );
00083 protected:
00084        void readSettings();
00085 
00086 private slots:
00087        void slotOkPressed();
00088        void aboutPressed();
00089 private:
00090        KWaveSaver *saver;
00091        float  size;
00092        float  stars;
00093 };
00094 
00095 #endif
00096 
00097