Go to the documentation of this file.00001
00002 #ifndef vgui_cache_wizard_h_
00003 #define vgui_cache_wizard_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <vcl_vector.h>
00022 #include <vcl_list.h>
00023 #include <vcl_utility.h>
00024
00025 #include <vil1/vil1_image.h>
00026 #include <vgui/vgui_gl.h>
00027
00028
00029 class vgui_cache_wizard
00030 {
00031 public:
00032
00033 typedef vcl_vector <GLuint> image_cache_quadrants;
00034 typedef vcl_pair<vil1_image,image_cache_quadrants *> wizard_image;
00035 typedef vcl_pair<int,int> dimension;
00036
00037
00038 int load_image(vil1_image);
00039
00040
00041 bool get_section(int id, int x, int y,int width,int height,
00042 image_cache_quadrants *quadrants,dimension *pos,dimension *size);
00043
00044
00045 void TexImage2D_Brownie(vil1_image img);
00046
00047
00048 int get_quadrant_width() const { return quadrant_width_; }
00049
00050
00051 int get_quadrant_height() const { return quadrant_height_; }
00052
00053
00054 static vgui_cache_wizard *Instance();
00055
00056
00057 vgui_cache_wizard(int quadrant_width,
00058 int quadrant_height);
00059
00060
00061 ~vgui_cache_wizard();
00062
00063 private:
00064
00065 vcl_vector <wizard_image *> images_;
00066
00067
00068 vcl_vector <dimension *> dimensions_;
00069
00070
00071 int quadrant_width_;
00072
00073 int quadrant_height_;
00074
00075
00076
00077
00078
00079 unsigned int max_texture_num_;
00080
00081 GLuint *texture_names_;
00082
00083
00084 vcl_list <GLuint> cache_queue_;
00085 };
00086
00087 #endif // vgui_cache_wizard_h_