aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/software_ddraw/evas_engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/engines/software_ddraw/evas_engine.h')
-rw-r--r--libraries/evas/src/modules/engines/software_ddraw/evas_engine.h220
1 files changed, 220 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/software_ddraw/evas_engine.h b/libraries/evas/src/modules/engines/software_ddraw/evas_engine.h
new file mode 100644
index 0000000..2f59170
--- /dev/null
+++ b/libraries/evas/src/modules/engines/software_ddraw/evas_engine.h
@@ -0,0 +1,220 @@
1#ifndef __EVAS_ENGINE_H__
2#define __EVAS_ENGINE_H__
3
4
5#define WIN32_LEAN_AND_MEAN
6#include <windows.h>
7#undef WIN32_LEAN_AND_MEAN
8#include <ddraw.h>
9
10typedef struct _Outbuf Outbuf;
11typedef struct _Outbuf_Region Outbuf_Region;
12typedef struct _DD_Output_Buffer DD_Output_Buffer;
13
14enum _Outbuf_Depth
15{
16 OUTBUF_DEPTH_NONE,
17 OUTBUF_DEPTH_INHERIT,
18 OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
19 OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
20 OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
21 OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
22 OUTBUF_DEPTH_RGB_32BPP_888_8888,
23 OUTBUF_DEPTH_LAST
24};
25
26typedef enum _Outbuf_Depth Outbuf_Depth;
27
28struct _Outbuf
29{
30 Outbuf_Depth depth;
31 int width;
32 int height;
33 int rot;
34 int onebuf;
35
36 struct {
37 Convert_Pal *pal;
38 struct {
39 HWND window;
40 LPDIRECTDRAW object;
41 LPDIRECTDRAWSURFACE surface_primary;
42 LPDIRECTDRAWSURFACE surface_back;
43 LPDIRECTDRAWCLIPPER clipper;
44 int depth;
45 unsigned char fullscreen : 1;
46 unsigned char swap : 1;
47 unsigned char bit_swap : 1;
48 } dd;
49 struct {
50 DATA32 r, g, b;
51 } mask;
52
53 /* 1 big buffer for updates - flush on idle_flush */
54 RGBA_Image *onebuf;
55 Eina_List *onebuf_regions;
56
57 /* a list of pending regions to write to the target */
58 Eina_List *pending_writes;
59 /* a list of previous frame pending regions to write to the target */
60 Eina_List *prev_pending_writes;
61
62 unsigned char mask_dither : 1;
63 unsigned char destination_alpha : 1;
64 unsigned char debug : 1;
65 unsigned char synced : 1;
66 } priv;
67};
68
69struct _Outbuf_Region
70{
71 DD_Output_Buffer *ddob;
72 int x;
73 int y;
74 int width;
75 int height;
76};
77
78struct _DD_Output_Buffer
79{
80 void *data;
81 int width;
82 int height;
83 int depth;
84 int pitch;
85 int psize;
86};
87
88extern int _evas_log_dom_module;
89
90#ifdef EVAS_DEFAULT_LOG_COLOR
91# undef EVAS_DEFAULT_LOG_COLOR
92#endif
93#define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
94#ifdef ERR
95# undef ERR
96#endif
97#define ERR(...) EINA_LOG_DOM_ERR(_evas_log_dom_module, __VA_ARGS__)
98#ifdef DBG
99# undef DBG
100#endif
101#define DBG(...) EINA_LOG_DOM_DBG(_evas_log_dom_module, __VA_ARGS__)
102#ifdef INF
103# undef INF
104#endif
105#define INF(...) EINA_LOG_DOM_INFO(_evas_log_dom_module, __VA_ARGS__)
106#ifdef WRN
107# undef WRN
108#endif
109#define WRN(...) EINA_LOG_DOM_WARN(_evas_log_dom_module, __VA_ARGS__)
110#ifdef CRT
111# undef CRT
112#endif
113#define CRT(...) EINA_LOG_DOM_CRIT(_evas_log_dom_module, __VA_ARGS__)
114
115/* evas_outbuf.c */
116
117void evas_software_ddraw_outbuf_init(void);
118
119void evas_software_ddraw_outbuf_free(Outbuf *buf);
120
121Outbuf *evas_software_ddraw_outbuf_setup(int width,
122 int height,
123 int rotation,
124 Outbuf_Depth depth,
125 HWND window,
126 int w_depth,
127 int fullscreen);
128
129void evas_software_ddraw_outbuf_reconfigure(Outbuf *buf,
130 int width,
131 int height,
132 int rotation,
133 Outbuf_Depth depth);
134
135RGBA_Image *evas_software_ddraw_outbuf_new_region_for_update(Outbuf *buf,
136 int x,
137 int y,
138 int w,
139 int h,
140 int *cx,
141 int *cy,
142 int *cw,
143 int *ch);
144
145void evas_software_ddraw_outbuf_push_updated_region(Outbuf *buf,
146 RGBA_Image *update,
147 int x,
148 int y,
149 int w,
150 int h);
151
152void evas_software_ddraw_outbuf_free_region_for_update(Outbuf *buf,
153 RGBA_Image *update);
154
155void evas_software_ddraw_outbuf_flush(Outbuf *buf);
156
157void evas_software_ddraw_outbuf_idle_flush(Outbuf *buf);
158
159int evas_software_ddraw_outbuf_width_get(Outbuf *buf);
160
161int evas_software_ddraw_outbuf_height_get(Outbuf *buf);
162
163Outbuf_Depth evas_software_ddraw_outbuf_depth_get(Outbuf *buf);
164
165int evas_software_ddraw_outbuf_rot_get(Outbuf *buf);
166
167/* evas_ddraw_buffer.c */
168
169DD_Output_Buffer *evas_software_ddraw_output_buffer_new(int depth,
170 int width,
171 int height,
172 void *data);
173
174void evas_software_ddraw_output_buffer_free(DD_Output_Buffer *ddob);
175
176void evas_software_ddraw_output_buffer_paste(DD_Output_Buffer *ddob,
177 void *ddraw_data,
178 int ddraw_width,
179 int ddraw_height,
180 int ddraw_pitch,
181 int ddraw_depth,
182 int x,
183 int y);
184
185DATA8 *evas_software_ddraw_output_buffer_data(DD_Output_Buffer *ddob,
186 int *bytes_per_line_ret);
187
188int evas_software_ddraw_output_buffer_depth(DD_Output_Buffer *ddob);
189
190/* evas_ddraw_main.cpp */
191
192#ifdef __cplusplus
193extern "C" {
194#endif
195
196int evas_software_ddraw_init (HWND window,
197 int depth,
198 int fullscreen,
199 Outbuf *buf);
200
201void evas_software_ddraw_shutdown(Outbuf *buf);
202
203int evas_software_ddraw_masks_get(Outbuf *buf);
204
205void *evas_software_ddraw_lock(Outbuf *buf,
206 int *ddraw_width,
207 int *ddraw_height,
208 int *ddraw_pitch,
209 int *ddraw_depth);
210
211void evas_software_ddraw_unlock_and_flip(Outbuf *buf);
212
213void evas_software_ddraw_surface_resize(Outbuf *buf);
214
215#ifdef __cplusplus
216}
217#endif
218
219
220#endif /* __EVAS_ENGINE_H__ */