00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GLSHAPE_H
00024 #define GLSHAPE_H 1
00025
00026 #ifdef HAVE_OPENGL
00027
00028 class Xform_palette;
00029 class Shape_frame;
00030 class GL_texshape;
00031 class Image_buffer8;
00032
00033
00034
00035
00036 class GL_texshape
00037 {
00038 Shape_frame *frame;
00039
00040 unsigned int texture;
00041 unsigned int texsize;
00042
00043 GL_texshape *lru_next, *lru_prev;
00044
00045 void create(Image_buffer8 *src, unsigned char *pal,
00046 Xform_palette *xforms = 0, int xfcnt = 0);
00047 public:
00048 friend class GL_manager;
00049 GL_texshape(Shape_frame *f, unsigned char *pal,
00050 Xform_palette *xforms = 0, int xfcnt = 0);
00051 GL_texshape(Image_buffer8 *src, unsigned char *pal);
00052 ~GL_texshape();
00053 void paint(int px, int py);
00054 };
00055
00056
00057
00058
00059 class GL_manager
00060 {
00061 static GL_manager *instance;
00062 int scale;
00063 int max_texsize;
00064 GL_texshape *shapes;
00065 int num_shapes;
00066 unsigned char *palette;
00067 public:
00068 friend class GL_texshape;
00069 GL_manager();
00070 ~GL_manager();
00071 static GL_manager *get_instance()
00072 { return instance; }
00073 void set_palette(unsigned char *pal)
00074 { delete palette; palette = pal; }
00075
00076
00077 GL_texshape *create(Image_buffer8 *src)
00078 { return new GL_texshape(src, palette); }
00079
00080 void resized(int new_width, int new_height, int new_scale);
00081
00082
00083 void paint(Shape_frame *frame, int px, int py,
00084 Xform_palette *xforms = 0, int xfcnt = 0);
00085 };
00086
00087
00088 #else
00089
00090 class GL_manager
00091 {
00092 public:
00093 static GL_manager *get_instance()
00094 { return 0; }
00095 };
00096
00097 #endif
00098
00099
00100 #endif