1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __rendercontrol_hh
3 #define __rendercontrol_hh
26 // color tables, meaning, 256 (possibly) different shades of each color,
27 // based on the number of bits there are available for each color in the
29 unsigned char _red_color_table[256];
30 unsigned char _green_color_table[256];
31 unsigned char _blue_color_table[256];
37 int _cpc; // colors-per-channel: must be a value between [2,6]
38 int _bpp; // bits-per-pixel
40 unsigned int *_grad_xbuffer;
41 unsigned int *_grad_ybuffer;
42 unsigned int _grad_buffer_width;
43 unsigned int _grad_buffer_height;
45 unsigned long *_sqrt_table;
47 // These values are all determined based on a visual
49 int _red_bits; // the number of bits (1-255) that each shade of color
50 int _green_bits; // spans across. best case is 1, which gives 255 shades.
52 unsigned char _red_color_table[256];
53 unsigned char _green_color_table[256];
54 unsigned char _blue_color_table[256];
56 // These are only used for TrueColor visuals
57 int _red_offset; // the offset of each color in a color mask
61 // These are only used for !TrueColor visuals
66 RenderControl(int screen);
68 virtual void drawSolidBackground(Surface& sf,
69 const RenderTexture& texture) const;
72 virtual ~RenderControl();
74 static RenderControl *getRenderControl(int screen);
76 virtual void drawRoot(const RenderColor &color) const;
78 //! Draws a background onto a Surface, as specified by a RenderTexture
80 This function will overwrite the entire surface.
82 virtual void drawBackground(Surface &sf,
83 const RenderTexture &texture) const = 0;
85 //! Draws an image onto the surface
87 This function will overwrite the entire surface.<br>
88 The image must be specified in 32-bit packed ARGB format. The current
89 background will be used for applying the alpha.
91 virtual void drawImage(Surface &sf, int w, int h, unsigned long *data) const;
93 //! Draws a string onto a Surface
94 virtual void drawString(Surface &sf, const Font &font, int x, int y,
95 const RenderColor &color,
96 const ustring &string) const;
98 //! Draws a PixmapMask with a specified color onto a Surface
99 virtual void drawMask(Surface &sf, const RenderColor &color,
100 const PixmapMask &mask) const;
105 #endif // __rendercontrol_hh