00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef RENDER_WINDOW_H
00024 #define RENDER_WINDOW_H
00025
00026 #include <FL/Fl.H>
00027 #include <FL/Fl_Group.H>
00028 #include <FL/Fl_Image.H>
00029 #include <FL/fl_draw.H>
00030
00031 #ifdef LUX_USE_OPENGL
00032 #include <FL/Fl_Gl_Window.H>
00033 #include <FL/gl.h>
00034 #endif // LUX_USE_OPENGL
00035
00036
00037 #ifdef LUX_USE_OPENGL
00038
00039 class GlWindow : public Fl_Gl_Window {
00040 int image_w, image_h;
00041 int tiles_x, tiles_y, tiles_nr;
00042 bool image_changed;
00043 const int texture_w;
00044 const int texture_h;
00045 int offset_x, offset_y, scale_xo2, scale_yo2, scale_xo, scale_yo, lastx, lasty;
00046 float scale;
00047 float scale_exp;
00048 Fl_RGB_Image *image_ptr;
00049
00050 public:
00051 GlWindow(int x,int y,int w,int h,const char *lab=0);
00052 ~GlWindow();
00053 void update_image();
00054 void set_image(Fl_RGB_Image *img);
00055 void resize(int X,int Y,int W,int H);
00056 int handle(int event);
00057 void draw(void);
00058 };
00059
00060 #else // LUX_USE_OPENGL
00061
00062
00063 class GlWindow {
00064 public:
00065 GlWindow(int x,int y,int w,int h,const char *lab=0){};
00066 ~GlWindow(){};
00067 void update_image(){};
00068 void set_image(Fl_RGB_Image *img){};
00069 void draw(void){};
00070 };
00071
00072 #endif // LUX_USE_OPENGL
00073
00074 class RenderWindow: public Fl_Group{
00075 GlWindow *glwin;
00076 Fl_Group *groupwin;
00077 Fl_RGB_Image *image_ptr;
00078 const bool opengl_enabled;
00079
00080 public:
00081 RenderWindow(int x,int y,int w,int h,Fl_Color col_back,Fl_Color col_renderback,const char *lab=0,bool opengl_enabled=false);
00082 void update_image();
00083 void set_image(Fl_RGB_Image *img);
00084 };
00085
00086 #endif // RENDER_WINDOW_H