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