48
48
class GPC_Canvas : public RAS_ICanvas
52
* Used to position banners in the canvas.
59
typedef int TBannerId;
63
* Used to store info for banners drawn on top of the canvas.
66
/** Where the banner will be displayed. */
67
TBannerAlignment alignment;
68
/** Banner display enabled. */
70
/** Banner display width. */
71
unsigned int displayWidth;
72
/** Banner display height. */
73
unsigned int displayHeight;
74
/** Banner image width. */
75
unsigned int imageWidth;
76
/** Banner image height. */
77
unsigned int imageHeight;
78
/** Banner image data. */
79
unsigned char* imageData;
80
/** Banner OpenGL texture name. */
81
unsigned int textureName;
83
typedef std::map<TBannerId, TBannerData> TBannerMap;
85
52
/** Width of the context. */
178
140
virtual void MakeScreenShot(const char* filename);
180
142
void ClearBuffer(int type);
183
* \section Services provided by this class.
187
* Enables display of a banner.
188
* The image data is copied inside.
189
* \param bannerWidth Display width of the banner.
190
* \param bannerHeight Display height of the banner.
191
* \param imageWidth Width of the banner image in pixels.
192
* \param imageHeight Height of the banner image in pixels.
193
* \param imageData Pointer to the pixels of the image to display.
194
* \param alignment Where the banner will be positioned on the canvas.
195
* \param enabled Whether the banner will be displayed initially.
196
* \return A banner id.
199
unsigned int bannerWidth, unsigned int bannerHeight,
200
unsigned int imageWidth, unsigned int imageHeight,
201
unsigned char* imageData, TBannerAlignment alignment = alignTopLeft,
202
bool enabled = true);
206
* \param id Banner to be disposed.
208
void DisposeBanner(TBannerId id);
211
* Disposes all the banners.
213
void DisposeAllBanners();
216
* Enables or disables display of a banner.
217
* \param id Banner id of the banner to be enabled/disabled.
218
* \param enabled New state of the banner.
220
void SetBannerEnabled(TBannerId id, bool enabled = true);
223
* Enables or disables display of all banners.
224
* \param enabled New state of the banners.
226
void SetBannerDisplayEnabled(bool enabled = true);
231
* \param it Banner to be disposed.
233
void DisposeBanner(TBannerData& banner);
236
* Draws all the banners enabled.
238
void DrawAllBanners(void);
243
void DrawBanner(TBannerData& banner);
245
struct CanvasRenderState {
259
CanvasRenderState & render_state
263
const CanvasRenderState & render_state
267
* Set up an orthogonal viewing,model and texture matrix
268
* for banners and progress bars.
274
static TBannerId s_bannerId;
277
145
#endif /* __GPC_CANVAS_H__ */