blob: ea2f64f341678a286d32f02f13c5dd8e588c7a0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
//-----------------------------------------------------------------------------
//
// kwave - Partical Wave Screen Saver for KDE 2
//
// Copyright (c) Ian Reinhart Geiser 2001
//
/////
//NOTE:
// The base particle engine did not come from me, it was designed by Jeff Molofee <nehe@connect.ab.ca>
// I did some extensive modifications to make it work with QT's OpenGL but the base principal is about
// the same.
////
#ifndef __WAVE_H__
#define __WAVE_H__
#include <qdialog.h>
#include <qgl.h>
#ifdef Q_WS_MACX
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <kscreensaver.h>
#include <qtimer.h>
#include <qimage.h>
#include "wavecfg.h"
class Wave : public QGLWidget
{
Q_OBJECT
public:
Wave( QWidget * parent=0, const char * name=0 );
~Wave();
protected:
/** paint the GL view */
void paintGL ();
/** resize the gl view */
void resizeGL ( int w, int h );
/** setup the GL enviroment */
void initializeGL ();
private:
//
GLUnurbsObj *pNurb;
GLint nNumPoints;
// float ctrlPoints[4][4][3];
// float knots[8];
int index;
bool LoadGLTextures();
GLuint texture[1];
QImage tex;
};
class KWaveSaver : public KScreenSaver
{
Q_OBJECT
public:
KWaveSaver( WId drawable );
virtual ~KWaveSaver();
void readSettings();
public slots:
void blank();
private:
Wave *wave;
QTimer *timer;
};
class KWaveSetup : public SetupUi
{
Q_OBJECT
public:
KWaveSetup( QWidget *parent = NULL, const char *name = NULL );
~KWaveSetup( );
protected:
void readSettings();
private slots:
void slotOkPressed();
void aboutPressed();
private:
KWaveSaver *saver;
float size;
float stars;
};
#endif
|