fix compile errors
[wdl/wdl-ol.git] / WDL / lice / lice_extended.h
bloba453a77f0e2e47a693fe83053bbbad6126400374
1 #ifndef _LICE_EXTENDED_
2 #define _LICE_EXTENDED_
4 #include "lice.h"
6 #define DISABLE_LICE_EXTENSIONS
8 // stuff to pass to LICE_IBitmap::Extended
10 enum // IDs
12 LICE_EXT_SUPPORTS_ID, // data = ID, returns 1 if that extension ID is supported
13 LICE_EXT_CLEAR_ACCEL,
14 LICE_EXT_LINE_ACCEL,
15 LICE_EXT_FILLRECT_ACCEL,
16 LICE_EXT_DRAWCBEZIER_ACCEL,
17 LICE_EXT_DRAWGLYPH_ACCEL,
18 LICE_EXT_BLIT_ACCEL,
19 LICE_EXT_SCALEDBLIT_ACCEL,
20 LICE_EXT_GETFBOTEX_ACCEL, // if the bitmap is implemented as an openGL framebuffer object, get its texture backing store
21 LICE_EXT_DASHEDLINE_ACCEL,
22 LICE_EXT_GETPIXEL_ACCEL,
23 LICE_EXT_PUTPIXEL_ACCEL,
24 LICE_EXT_SETCLIP, // data == 0 to clear clip
25 LICE_EXT_WINDOW_BLIT,
26 LICE_EXT_FORGET, // optimizations can sometimes happen if a bitmap can be told it doesn't need to retain data after it's accessed
27 LICE_EXT_DRAWTRIANGLE_ACCEL,
28 };
30 struct LICE_Ext_Line_acceldata
32 float x1, y1, x2, y2;
33 LICE_pixel color;
34 float alpha;
35 int mode;
36 bool aa;
38 LICE_Ext_Line_acceldata(float _x1, float _y1, float _x2, float _y2, LICE_pixel _color, float _alpha, int _mode, bool _aa)
39 : x1(_x1), y1(_y1), x2(_x2), y2(_y2), color(_color), alpha(_alpha), mode(_mode), aa(_aa) {}
42 struct LICE_Ext_FillRect_acceldata
44 int x, y, w, h;
45 LICE_pixel color;
46 float alpha;
47 int mode;
49 LICE_Ext_FillRect_acceldata(int _x, int _y, int _w, int _h, LICE_pixel _color, float _alpha, int _mode)
50 : x(_x), y(_y), w(_w), h(_h), color(_color), alpha(_alpha), mode(_mode) {}
53 struct LICE_Ext_DrawCBezier_acceldata
55 float xstart, ystart, xctl1, yctl1, xctl2, yctl2, xend, yend;
56 LICE_pixel color;
57 float alpha;
58 int mode;
59 bool aa;
61 LICE_Ext_DrawCBezier_acceldata(float _xstart, float _ystart, float _xctl1, float _yctl1, float _xctl2, float _yctl2, float _xend, float _yend,
62 LICE_pixel _color, float _alpha, int _mode, bool _aa)
63 : xstart(_xstart), ystart(_ystart), xctl1(_xctl1), yctl1(_yctl1), xctl2(_xctl2), yctl2(_yctl2), xend(_xend), yend(_yend),
64 color(_color), alpha(_alpha), mode(_mode), aa(_aa) {}
67 struct LICE_Ext_DrawGlyph_acceldata
69 int x;
70 int y;
71 LICE_pixel color;
72 const LICE_pixel_chan* alphas;
73 int glyph_w, glyph_h;
74 float alpha;
75 int mode;
77 LICE_Ext_DrawGlyph_acceldata(int _x, int _y, LICE_pixel _color, LICE_pixel_chan* _alphas, int _glyph_w, int _glyph_h, float _alpha, int _mode)
78 : x(_x), y(_y), color(_color), alphas(_alphas), glyph_w(_glyph_w), glyph_h(_glyph_h), alpha(_alpha), mode(_mode) {}
81 struct LICE_Ext_Blit_acceldata
83 LICE_IBitmap* src;
84 int dstx, dsty, srcx, srcy, srcw, srch;
85 float alpha;
86 int mode;
88 LICE_Ext_Blit_acceldata(LICE_IBitmap* _src, int _dstx, int _dsty, int _srcx, int _srcy, int _srcw, int _srch, float _alpha, int _mode)
89 : src(_src), dstx(_dstx), dsty(_dsty), srcx(_srcx), srcy(_srcy), srcw(_srcw), srch(_srch), alpha(_alpha), mode(_mode) {}
92 struct LICE_Ext_ScaledBlit_acceldata
94 LICE_IBitmap* src;
95 int dstx, dsty, dstw, dsth;
96 float srcx, srcy, srcw, srch;
97 float alpha;
98 int mode;
100 LICE_Ext_ScaledBlit_acceldata(LICE_IBitmap* _src, int _dstx, int _dsty, int _dstw, int _dsth, float _srcx, float _srcy, float _srcw, float _srch, float _alpha, int _mode)
101 : src(_src), dstx(_dstx), dsty(_dsty), dstw(_dstw), dsth(_dsth), srcx(_srcx), srcy(_srcy), srcw(_srcw), srch(_srch), alpha(_alpha), mode(_mode) {}
104 struct LICE_Ext_DashedLine_acceldata
106 float x1, y1, x2, y2;
107 int pxon, pxoff;
108 LICE_pixel color;
109 float alpha;
110 int mode;
111 bool aa;
113 LICE_Ext_DashedLine_acceldata(float _x1, float _y1, float _x2, float _y2, int _pxon, int _pxoff, LICE_pixel _color, float _alpha, int _mode, bool _aa)
114 : x1(_x1), y1(_y1), x2(_x2), y2(_y2), pxon(_pxon), pxoff(_pxoff), color(_color), alpha(_alpha), mode(_mode), aa(_aa) {}
117 struct LICE_Ext_GetPixel_acceldata
119 int x, y;
120 LICE_pixel px; // return
122 LICE_Ext_GetPixel_acceldata(int _x, int _y)
123 : x(_x), y(_y), px(0) {}
126 struct LICE_Ext_PutPixel_acceldata
128 int x, y;
129 LICE_pixel color;
130 float alpha;
131 int mode;
133 LICE_Ext_PutPixel_acceldata(int _x, int _y, LICE_pixel _color, float _alpha, int _mode)
134 : x(_x), y(_y), color(_color), alpha(_alpha), mode(_mode) {}
137 struct LICE_Ext_SetClip_data
139 int x, y, w, h;
141 LICE_Ext_SetClip_data(int _x, int _y, int _w, int _h)
142 : x(_x), y(_y), w(_w), h(_h) {}
145 class pl_Mat;
147 struct LICE_Ext_DrawTriangle_acceldata
149 pl_Mat *mat; // will need to include plush.h to access this
150 double VertexShades[3][3]; // for solid element
151 float scrx[3], scry[3], scrz[3]; // scrz = 1/Zdist
152 double mapping_coords[2][3][2]; // [texture or texture2][vertex][uv]
155 struct LICE_Ext_WindowBlit_data
157 HWND hwnd;
158 int destx, desty, srcx, srcy, w, h;
160 LICE_Ext_WindowBlit_data(HWND _hwnd, int _destx, int _desty, int _srcx, int _srcy, int _w, int _h)
161 : hwnd(_hwnd), destx(_destx), desty(_desty), srcx(_srcx), srcy(_srcy), w(_w), h(_h) {}
164 #endif