summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/kdesavers/Euphoria.h
blob: 45ef32079444ab5dcf9ffe236ca1a3f38f37ca88 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#ifndef __EUPHORIASS_H__
#define __EUPHORIASS_H__
//============================================================================
//
// Terence Welsh Screensaver - Euphoria
// http://www.reallyslick.com/
//
// TDE port by Karl Robillard
//
//============================================================================


#include <tqgl.h>

#include <kdialogbase.h>

class wisp;
class TQTimer;

class EuphoriaWidget : public TQGLWidget
{
    Q_OBJECT
  

public:

    enum eDefault
    {
        Regular,
        Grid,
        Cubism,
        BadMath,
        MTheory,
        UHFTEM,   // ultra high frequency tunneling electron microscope
        Nowhere,
        Echo,
        Kaleidoscope,
        DefaultModes
    };

    EuphoriaWidget( TQWidget* parent=0, const char* name=0 );
    ~EuphoriaWidget();

    void updateParameters();
    void setDefaults( int which );

protected:

    void paintGL();
    void resizeGL( int w, int h );
    void initializeGL();
#ifdef UNIT_TEST
    void keyPressEvent( TQKeyEvent* );
#endif

private slots:

    void nextFrame();

private:

    GLuint texName;
    wisp* _wisps;
    wisp* _backwisps;
    unsigned char* feedbackmap;
    float aspectRatio;
    int viewport[4];
    double elapsedTime;

    // feedback texture object
    unsigned int feedbacktex;
    int feedbacktexsize;
    // feedback variables
    float fr[4];
    float fv[4];
    float f[4];
    // feedback limiters
    float lr[3];
    float lv[3];
    float l[3];



    int dWisps;
    int dBackground;
    int dDensity;
    int dVisibility;
    float dSpeed;
    int dFeedback;
    int dFeedbackspeed;
    int dFeedbacksize;
    int dWireframe;
    int dTexture;
    int dPriority;


    // Using TQTimer rather than timerEvent() to avoid getting locked out of
    // the TQEvent loop on lower-end systems.  Ian Geiser <geiseri@kde.org>
    // says this is the way to go.
    TQTimer* _timer;
    int _frameTime;

    friend class wisp;
};


#ifndef UNIT_TEST
#include <tqdialog.h>
#include <tdescreensaver.h>


class KEuphoriaScreenSaver : public KScreenSaver
{
    Q_OBJECT
  

public:

    KEuphoriaScreenSaver( WId id );
    virtual ~KEuphoriaScreenSaver();

    int mode() const { return _mode; }

public slots:

    void setMode( int );

private:

    void readSettings();

    EuphoriaWidget* _effect;
    int _mode;
};


class TQComboBox;

class KEuphoriaSetup : public KDialogBase
{
    Q_OBJECT
  

public:
    KEuphoriaSetup( TQWidget* parent = 0, const char* name = 0 );
    ~KEuphoriaSetup();

private slots:
    void slotHelp();
    void slotOk();

private:
    TQComboBox* modeW;
    KEuphoriaScreenSaver* _saver;
};
#endif

#endif //__EUPHORIASS_H__