// // Computergraphik II // Prof. Dr. Juergen Doellner // Wintersemester 2001/02 // // Rahmenprogramm zu Aufgabenzettel 8 // #ifndef CG_ALPHATEXTURE_H #define CG_ALPHATEXTURE_H #include "cgapplication.h" class CGAlphaTexture : public CGApplication { public: CGAlphaTexture(char* filename); virtual ~CGAlphaTexture(); virtual void onInit(); virtual void onDraw(); virtual void onIdle(); virtual void onKey(unsigned char key); virtual void onSize(unsigned int newWidth, unsigned int newHeight); void readImage(); // value Methode unsigned char value(int x, int z) const; private: void drawScene(); // dimension of viewport int width_; int height_; double zoom_; // filename of ppm-image char* filename_; // dimension of texture int texWidth_; int texHeight_; // image for texture GLubyte* image_; // texture identifier GLuint texName_; // alpha enabled ? bool alpha_; // alpha threshold double threshold_; bool run_; }; #endif