1 //
2 // Computergraphik II
3 // Prof. Dr. Juergen Doellner
4 // Wintersemester 2001/02
5 //
6 // Rahmenprogramm zu Aufgabenzettel 8
7 //
8
9 #ifndef CG_ALPHATEXTURE_H
10 #define CG_ALPHATEXTURE_H
11
12 #include "cgapplication.h"
13
14 class CGAlphaTexture : public CGApplication {
15 public:
16 CGAlphaTexture(char* filename);
17 virtual ~CGAlphaTexture();
18
19 virtual void onInit();
20 virtual void onDraw();
21 virtual void onIdle();
22 virtual void onKey(unsigned char key);
23 virtual void onSize(unsigned int newWidth, unsigned int newHeight);
24
25 void readImage();
26
27 // value Methode
28 unsigned char value(int x, int z) const;
29
30 private:
31
32 void drawScene();
33
34 // dimension of viewport
35 int width_;
36 int height_;
37
38 double zoom_;
39
40 // filename of ppm-image
41 char* filename_;
42
43 // dimension of texture
44 int texWidth_;
45 int texHeight_;
46 // image for texture
47 GLubyte* image_;
48 // texture identifier
49 GLuint texName_;
50
51 // alpha enabled ?
52 bool alpha_;
53 // alpha threshold
54 double threshold_;
55
56 bool run_;
57 };
58
59 #endif
60
61
62