16#define WIDTH_BYTES_ALIGN32(cx, bpp) ((((cx) * (bpp) + 31) & ~31) >> 3)
17#define WIDTH_BYTES_ALIGN16(cx, bpp) ((((cx) * (bpp) + 15) & ~15) >> 3)
20#define SB_FLAGS (PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT)
21#define SB_FLAGS_WINDOW (PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT)
22#define SB_FLAGS_PALETTE (PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT | PFD_NEED_PALETTE)
23#define DB_FLAGS (PFD_DOUBLEBUFFER | PFD_SWAP_COPY | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT)
24#define DB_FLAGS_PALETTE (PFD_DOUBLEBUFFER | PFD_SWAP_COPY | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT | PFD_NEED_PALETTE)
44 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
45 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
46 {
DB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
47 {
DB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
48 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
49 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
50 {
DB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
51 {
DB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
52 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
53 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
54 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
55 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
57 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
58 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
59 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
60 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
61 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
62 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
64 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 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RGBA, 4, 1, 0, 1, 1, 1, 2, 8, 0, 16, 4, 4, 4, 4, 32},
81 {
SB_FLAGS,
PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 8, 0, 16, 4, 4, 4, 4, 16},
82 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 4, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 32},
83 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 4, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 16},
89 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
90 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
91 {
DB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
92 {
DB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
93 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
94 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
95 {
DB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
96 {
DB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
97 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
98 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
99 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
100 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
102 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
103 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
104 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
105 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
106 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
107 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
109 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 32},
110 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 16},
111 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 32},
112 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 16},
113 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 16, 5, 10, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 32},
114 {
SB_FLA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, 0, 32, 11, 11, 10, 0, 32},
135 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 16},
136 {
DB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 32},
137 {
DB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 16},
138 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 32},
139 {
SB_FLAGS_WINDOW,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 16},
140 {
DB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 32},
141 {
DB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 16},
142 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 16, 5, 11, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 32},
143 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 16, 5, 11, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 16},
144 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 16, 5, 11, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 32},
145 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 16, 5, 11, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 16},
147 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
148 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
149 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
150 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
151 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
152 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
154 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
155 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
156 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
157 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
158 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
159 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
161 {
SB_FLAGS,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 0, 0, 32, 11, 11, 10, 0, 32},
162 {
SB_FLAGS,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 0, 0, 32, 11, 11, 10, 0, 16},
163 {
SB_FLAGS,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 8, 0, 32, 8, 8, 8, 8, 32},
164 {
SB_FLAGS,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 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 8, 32},
184 {
SB_FLAGS_PALETTE,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 8, 0, 32, 8, 8, 8, 8, 16},
185 {
DB_FLAGS_PALETTE,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 8, 0, 32, 8, 8, 8, 8, 32},
186 {
DB_FLAGS_PALETTE,
PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 8, 0, 32, 8, 8, 8, 8, 16},
187 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 8, 3, 0, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, 0, 32},
188 {
SB_FLAGS_WINDOW,
PFD_TYPE_COLORINDEX, 8, 3, 0, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, 0, 16},
189 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 8, 3, 0, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, 0, 32},
190 {
DB_FLAGS,
PFD_TYPE_COLORINDEX, 8, 3, 0, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, 0, 16},
192 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
193 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
194 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
195 {
SB_FLAGS,
PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
196 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
197 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
199 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 32},
200 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0, 16},
201 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 32},
202 {
SB_FLAGS,
PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16, 16},
203 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 32},
204 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16},
206 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 32},
207 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0, 16},
208 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 32},
209 {
SB_FLAGS,
PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8, 16},
210 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 16, 5, 10, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 32},
211 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 16, 5, 10, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 16},
213 {
SB_FLAGS,
PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 0, 0, 16, 5, 6, 5, 0, 32},
214 {
SB_FLAGS,
PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 0, 0, 16, 5, 6, 5, 0, 16},
215 {
SB_FLAGS,
PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 8, 0, 16, 4, 4, 4, 4, 32},
216 {
SB_FLAGS,
PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 8, 0, 16, 4, 4, 4, 4, 16},
217 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 4, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 32},
218 {
SB_FLAGS,
PFD_TYPE_COLORINDEX, 4, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 16},
286#define HANDLE_BPP(__x__) \
288 nb_format = ARRAYSIZE(pixel_formats_##__x__); \
289 if ((pf_index > nb_format) || (pf_index <= 0)) \
292 ret = &pixel_formats_##__x__[pf_index - 1]; \
301 FIXME(
"Unhandled bit depth %u, defaulting to 32bpp\n",
bpp);
303 if ((pf_index > nb_format) || (pf_index == 0))
310 *pf_count = nb_format;
329 descr->nSize =
sizeof(*descr);
349 descr->cAuxBuffers = 0;
351 descr->bReserved = 0;
352 descr->dwLayerMask = 0;
353 descr->dwVisibleMask = 0;
354 descr->dwDamageMask = 0;
365 TRACE(
"OpenGL software implementation START for hdc %p, format %i!\n",
hdc,
format);
375 ERR(
"HeapAlloc FAILED!\n");
400 ERR(
"Failed to allocate a GL visual.\n");
408 ERR(
"Failed to allocate the mesa framebuffer structure.\n");
435 ERR(
"Failed to initialize the mesa context.\n");
445 return (DHGLRC)sw_ctx;
487 if (
strcmp(
name,
"glGetColorTableParameterivEXT") == 0)
489 if (
strcmp(
name,
"glGetColorTableParameterfvEXT") == 0)
491 if (
strcmp(
name,
"glAddSwapHintRectWIN") == 0)
494 WARN(
"Asking for proc address %s, returning NULL.\n",
name);
500 FIXME(
"Software wglCopyContext is UNIMPLEMENTED, mask %lx.\n",
mask);
515 gl_reference_shared_state(sw_ctx_dst->
gl_ctx,
519 FIXME(
"Unimplemented!\n");
534 if((!dc_data) || (!
ctx))
559 TRACE(
"Got WM_WINDOWPOSCHANGED\n");
578 return "ReactOS SW Implementation";
611 return *
Buffer & 0x00FFFFFF;
621 return (
r & 0x7) | ((
g & 0x7) << 3) | ((
b & 0x3) << 6);
626 return ((
r & 0x1F) << 11) | ((
g & 0x3F) << 5) | (
b & 0x1F);
631 return (
r << 16) | (
g << 8) | (
b);
636 return (
r << 16) | (
g << 8) | (
b);
641 return RGB(
r << 5,
g << 5,
b << 6);
646 return RGB(
r << 3,
g << 2,
b << 3);
668 *
r = (
Color >> 11) & 0x1F;
675 *
r = (
Color >> 16) & 0xFF;
682 *
r = (
Color >> 16) & 0xFF;
715#define MAKE_COLORREF(__bpp, __type) \
716static inline COLORREF MAKE_COLORREF_##__bpp(const struct pixel_format *format, __type Color) \
720 if (format->iPixelType == PFD_TYPE_COLORINDEX) \
721 return PALETTEINDEX(Color); \
723 UNPACK_COLOR_##__bpp(Color, &r, &g, &b); \
725 return PACK_COLORREF_##__bpp(r, g, b); \
736#define CLEAR_INDEX(__bpp, __type) \
737static void clear_index_##__bpp(GLcontext* ctx, GLuint index) \
739 struct sw_context* sw_ctx = ctx->DriverCtx; \
741 sw_ctx->u##__bpp.ClearColor = (__type)index; \
752#define CLEAR_COLOR(__bpp) \
753static void clear_color_##__bpp( GLcontext* ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) \
755 struct sw_context* sw_ctx = ctx->DriverCtx; \
757 sw_ctx->u##__bpp.ClearColor = PACK_COLOR_##__bpp(r, g, b); \
759 TRACE("Set Clear color %u, %u, %u.\n", r, g, b); \
798#define CLEAR(__bpp, __type, __pixel_size) \
799static void clear_##__bpp(GLcontext* ctx, GLboolean all,GLint x, GLint y, GLint width, GLint height)\
801 struct sw_context* sw_ctx = ctx->DriverCtx; \
802 struct sw_framebuffer* fb = sw_ctx->fb; \
809 height = fb->height; \
812 if (sw_ctx->Mode == GL_FRONT) \
814 clear_frontbuffer(sw_ctx, fb, x, y, width, height, \
815 MAKE_COLORREF_##__bpp(fb->pixel_format, sw_ctx->u##__bpp.ClearColor)); \
819 ScanLine = fb->BackBuffer + y * WIDTH_BYTES_ALIGN32(fb->width, __bpp); \
822 BYTE* Buffer = ScanLine + x * __pixel_size; \
827 PUT_PIXEL_##__bpp((__type*)Buffer, sw_ctx->u##__bpp.ClearColor); \
828 Buffer += __pixel_size; \
831 ScanLine += WIDTH_BYTES_ALIGN32(fb->width, __bpp); \
841#define SET_INDEX(__bpp) \
842static void set_index_##__bpp(GLcontext* ctx, GLuint index) \
844 struct sw_context* sw_ctx = ctx->DriverCtx; \
846 sw_ctx->u##__bpp.CurrentColor = index; \
855#define SET_COLOR(__bpp) \
856static void set_color_##__bpp( GLcontext* ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) \
858 struct sw_context* sw_ctx = ctx->DriverCtx; \
860 sw_ctx->u##__bpp.CurrentColor = PACK_COLOR_##__bpp(r, g, b); \
912 TRACE(
"Framebuffer size : %i, %i\n", bm.bmWidth, bm.bmHeight);
936 ERR(
"Failed allocating back buffer !.\n");
947#define WRITE_COLOR_SPAN_FRONTBUFFER(__bpp) \
948static void write_color_span_frontbuffer_##__bpp(struct sw_framebuffer* fb, \
949 GLuint n, GLint x, GLint y, \
950 const GLubyte red[], const GLubyte green[], \
951 const GLubyte blue[], const GLubyte mask[] ) \
953 TRACE("Writing color span at %u, %u (%u)\n", x, y, n); \
961 SetPixel(fb->Hdc, x + n, fb->height - y, \
962 PACK_COLORREF_##__bpp(red[n], green[n], blue[n])); \
970 SetPixel(fb->Hdc, x + n, fb->height - y, \
971 PACK_COLORREF_##__bpp(red[n], green[n], blue[n])); \
979#undef WRITE_COLOR_SPAN_FRONTBUFFER
981#define WRITE_COLOR_SPAN(__bpp, __type, __pixel_size) \
982static void write_color_span_##__bpp(GLcontext* ctx, \
983 GLuint n, GLint x, GLint y, \
984 const GLubyte red[], const GLubyte green[], \
985 const GLubyte blue[], const GLubyte alpha[], \
986 const GLubyte mask[] ) \
988 struct sw_context* sw_ctx = ctx->DriverCtx; \
989 struct sw_framebuffer* fb = sw_ctx->fb; \
992 if (sw_ctx->Mode == GL_FRONT) \
994 write_color_span_frontbuffer_##__bpp(fb, n, x, y, red, green, blue, mask); \
998 Buffer = fb->BackBuffer + y * WIDTH_BYTES_ALIGN32(fb->width, __bpp) \
999 + (x + n) * __pixel_size; \
1004 Buffer -= __pixel_size; \
1007 PUT_PIXEL_##__bpp((__type*)Buffer, \
1008 PACK_COLOR_##__bpp(red[n], green[n], blue[n])); \
1016 Buffer -= __pixel_size; \
1017 PUT_PIXEL_##__bpp((__type*)Buffer, \
1018 PACK_COLOR_##__bpp(red[n], green[n], blue[n])); \
1026#undef WRITE_COLOR_SPAN
1031 TRACE(
"Writing monocolor span at %u %u (%u), Color 0x%08x\n",
x,
y,
n,
Color);
1053#define WRITE_MONOCOLOR_SPAN(__bpp, __type, __pixel_size) \
1054static void write_monocolor_span_##__bpp(GLcontext* ctx, \
1055 GLuint n, GLint x, GLint y, \
1056 const GLubyte mask[]) \
1058 struct sw_context* sw_ctx = ctx->DriverCtx; \
1059 struct sw_framebuffer* fb = sw_ctx->fb; \
1062 if (sw_ctx->Mode == GL_FRONT) \
1064 write_monocolor_span_frontbuffer(fb, n, x, y, mask, \
1065 MAKE_COLORREF_##__bpp(fb->pixel_format, sw_ctx->u##__bpp.CurrentColor)); \
1069 Buffer = fb->BackBuffer + y * WIDTH_BYTES_ALIGN32(fb->width, __bpp) + (x + n) * __pixel_size; \
1074 Buffer -= __pixel_size; \
1076 PUT_PIXEL_##__bpp((__type*)Buffer, sw_ctx->u##__bpp.CurrentColor); \
1083 Buffer -= __pixel_size; \
1084 PUT_PIXEL_##__bpp((__type*)Buffer, sw_ctx->u##__bpp.CurrentColor); \
1092#undef WRITE_MONOCOLOR_SPAN
1095#define WRITE_COLOR_PIXELS(__bpp, __type, __pixel_size) \
1096static void write_color_pixels_##__bpp(GLcontext* ctx, \
1097 GLuint n, const GLint x[], const GLint y[], \
1098 const GLubyte r[], const GLubyte g[], \
1099 const GLubyte b[], const GLubyte a[], \
1100 const GLubyte mask[]) \
1102 struct sw_context* sw_ctx = ctx->DriverCtx; \
1103 struct sw_framebuffer* fb = sw_ctx->fb; \
1105 TRACE("Writing color pixels\n"); \
1107 if (sw_ctx->Mode == GL_FRONT) \
1113 TRACE("Setting pixel %u, %u to 0x%08x.\n", x[n], fb->height - y[n], \
1114 PACK_COLORREF_##__bpp(r[n], g[n], b[n])); \
1115 SetPixel(fb->Hdc, x[n], fb->height - y[n], \
1116 PACK_COLORREF_##__bpp(r[n], g[n], b[n])); \
1127 BYTE* Buffer = fb->BackBuffer + y[n] * WIDTH_BYTES_ALIGN32(fb->width, __bpp) \
1128 + x[n] * __pixel_size; \
1129 PUT_PIXEL_##__bpp((__type*)Buffer, PACK_COLOR_##__bpp(r[n], g[n], b[n])); \
1137#undef WRITE_COLOR_PIXELS
1144 TRACE(
"Writing monocolor pixels to front buffer.\n");
1159#define WRITE_MONOCOLOR_PIXELS(__bpp, __type, __pixel_size) \
1160static void write_monocolor_pixels_##__bpp(GLcontext* ctx, GLuint n, \
1161 const GLint x[], const GLint y[], \
1162 const GLubyte mask[] ) \
1164 struct sw_context* sw_ctx = ctx->DriverCtx; \
1165 struct sw_framebuffer* fb = sw_ctx->fb; \
1167 if (sw_ctx->Mode == GL_FRONT) \
1169 write_monocolor_pixels_frontbuffer(fb, n, x, y, mask, \
1170 MAKE_COLORREF_##__bpp(fb->pixel_format, sw_ctx->u##__bpp.CurrentColor)); \
1179 BYTE* Buffer = fb->BackBuffer + y[n] * WIDTH_BYTES_ALIGN32(fb->width, 32) \
1180 + x[n] * __pixel_size; \
1181 PUT_PIXEL_##__bpp((__type*)Buffer, sw_ctx->u##__bpp.CurrentColor); \
1189#undef WRITE_MONOCOLOR_PIXELS
1197 ERR(
"Not implemented yet !\n");
1205 ERR(
"Not implemented yet !\n");
1211 ERR(
"Not implemented yet !\n");
1215#define READ_COLOR_SPAN(__bpp, __type, __pixel_size) \
1216static void read_color_span_##__bpp(GLcontext* ctx, \
1217 GLuint n, GLint x, GLint y, \
1218 GLubyte red[], GLubyte green[], \
1219 GLubyte blue[], GLubyte alpha[] ) \
1221 struct sw_context* sw_ctx = ctx->DriverCtx; \
1222 struct sw_framebuffer* fb = sw_ctx->fb; \
1225 if (sw_ctx->Mode == GL_FRONT) \
1230 Color = GetPixel(fb->Hdc, x + n, fb->height - y); \
1231 UNPACK_COLORREF_##__bpp(Color, &red[n], &green[n], &blue[n]); \
1238 Buffer = fb->BackBuffer + y * WIDTH_BYTES_ALIGN32(fb->width, __bpp) \
1239 + (x + n) * __pixel_size; \
1242 Buffer -= __pixel_size; \
1243 UNPACK_COLOR_##__bpp(GET_PIXEL_##__bpp((__type*)Buffer), \
1244 &red[n], &green[n], &blue[n]); \
1252#undef READ_COLOR_SPAN
1260 ERR(
"Not implemented yet !\n");
1264#define READ_COLOR_PIXELS(__bpp, __type, __pixel_size) \
1265static void read_color_pixels_##__bpp(GLcontext* ctx, \
1266 GLuint n, const GLint x[], const GLint y[], \
1267 GLubyte red[], GLubyte green[], \
1268 GLubyte blue[], GLubyte alpha[], \
1269 const GLubyte mask[] ) \
1271 struct sw_context* sw_ctx = ctx->DriverCtx; \
1272 struct sw_framebuffer* fb = sw_ctx->fb; \
1274 if (sw_ctx->Mode == GL_FRONT) \
1281 Color = GetPixel(fb->Hdc, x[n], fb->height - y[n]); \
1282 UNPACK_COLORREF_##__bpp(Color, &red[n], &green[n], &blue[n]); \
1294 BYTE *Buffer = fb->BackBuffer + y[n] * WIDTH_BYTES_ALIGN32(fb->width, __bpp) \
1295 + x[n] * __pixel_size; \
1296 UNPACK_COLOR_##__bpp(GET_PIXEL_##__bpp((__type*)Buffer), \
1297 &red[n], &green[n], &blue[n]); \
1306#undef READ_COLOR_PIXELS
1315 switch (sw_ctx->
fb->pixel_format->cColorBits)
1317#define HANDLE_BPP(__bpp) \
1319 ctx->Driver.ClearIndex = clear_index_##__bpp; \
1320 ctx->Driver.ClearColor = clear_color_##__bpp; \
1321 ctx->Driver.Clear = clear_##__bpp; \
1322 ctx->Driver.Index = set_index_##__bpp; \
1323 ctx->Driver.Color = set_color_##__bpp; \
1324 ctx->Driver.WriteColorSpan = write_color_span_##__bpp; \
1325 ctx->Driver.WriteMonocolorSpan = write_monocolor_span_##__bpp; \
1326 ctx->Driver.WriteMonoindexSpan = write_monocolor_span_##__bpp; \
1327 ctx->Driver.WriteColorPixels = write_color_pixels_##__bpp; \
1328 ctx->Driver.WriteMonocolorPixels = write_monocolor_pixels_##__bpp; \
1329 ctx->Driver.WriteMonoindexPixels = write_monocolor_pixels_##__bpp; \
1330 ctx->Driver.ReadColorSpan = read_color_span_##__bpp; \
1331 ctx->Driver.ReadColorPixels = read_color_pixels_##__bpp; \
1339 ERR(
"Unhandled bit depth %u, defaulting to 32bpp.\n", sw_ctx->
fb->pixel_format->cColorBits);
1340 ctx->Driver.ClearIndex = clear_index_32;
1341 ctx->Driver.ClearColor = clear_color_32;
1342 ctx->Driver.Clear = clear_32;
1343 ctx->Driver.Index = set_index_32;
1344 ctx->Driver.Color = set_color_32;
1345 ctx->Driver.WriteColorSpan = write_color_span_32;
1346 ctx->Driver.WriteMonocolorSpan = write_monocolor_span_32;
1347 ctx->Driver.WriteMonoindexSpan = write_monocolor_span_32;
1348 ctx->Driver.WriteColorPixels = write_color_pixels_32;
1349 ctx->Driver.WriteMonocolorPixels = write_monocolor_pixels_32;
1350 ctx->Driver.WriteMonoindexPixels = write_monocolor_pixels_32;
1351 ctx->Driver.ReadColorSpan = read_color_span_32;
1352 ctx->Driver.ReadColorPixels = read_color_pixels_32;
1369#define USE_GL_FUNC(name, proto_args, call_args, offset, stack) extern void WINAPI _mesa_##name proto_args ;
1370#define USE_GL_FUNC_RET(name, ret_type, proto_args, call_args, offset, stack) extern ret_type WINAPI _mesa_##name proto_args ;
1377#define USE_GL_FUNC(name, proto_args, call_args, offset, stack) _mesa_##name,
1403 ERR(
"Physical DC without a window!\n");
1408 ERR(
"GetClientRect failed!\n");
1430 ERR(
"Memory DC called with a double buffered format.\n");
1437 ERR(
"No Bitmap!\n");
1442 ERR(
"GetObject failed!\n");
1520 BitMasks[0] = 0x0000F800;
1521 BitMasks[1] = 0x000007E0;
1522 BitMasks[2] = 0x0000001F;
1525 return SetDIBitsToDevice(fb->
Hdc, 0, 0, fb->
width, fb->
height, 0, 0, 0, fb->
height, fb->
BackBuffer, bmi,
int strcmp(const char *String1, const char *String2)
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
GLvisual * gl_create_visual(GLboolean rgb_flag, GLboolean alpha_flag, GLboolean db_flag, GLint depth_bits, GLint stencil_bits, GLint accum_bits, GLint index_bits, GLfloat red_scale, GLfloat green_scale, GLfloat blue_scale, GLfloat alpha_scale, GLint red_bits, GLint green_bits, GLint blue_bits, GLint alpha_bits)
void gl_ResizeBuffersMESA(GLcontext *ctx)
GLframebuffer * gl_create_framebuffer(GLvisual *visual)
GLcontext * gl_create_context(GLvisual *visual, GLcontext *share_list, void *driver_ctx)
void gl_make_current(GLcontext *ctx, GLframebuffer *buffer)
void gl_destroy_context(GLcontext *ctx)
void gl_destroy_visual(GLvisual *vis)
void gl_Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height)
#define HeapFree(x, y, z)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
#define OPENGL_VERSION_110_ENTRIES
static struct wgl_dc_data * IntGetCurrentDcData(void)
FORCEINLINE void IntSetCurrentDispatchTable(const GLDISPATCHTABLE *table)
FORCEINLINE void IntSetCurrentICDPrivate(void *value)
FORCEINLINE DHGLRC IntGetCurrentDHGLRC(void)
FORCEINLINE const GLDISPATCHTABLE * IntGetCurrentDispatchTable(void)
FORCEINLINE void * IntGetCurrentICDPrivate(void)
wchar_t const *const size_t const buffer_size
GLDISPATCHTABLE glDispatchTable
struct gl_viewport_attrib Viewport
struct gl_shared_state * Shared
struct sw_context::@295::@300 u32
struct sw_context::@295::@297 u8
struct sw_context::@295::@299 u24
struct sw_context::@295::@298 u16
struct sw_framebuffer * fb
GLframebuffer * gl_buffer
const struct pixel_format * pixel_format
BITMAPINFOHEADER bmiHeader
union wgl_dc_data::@294 owner
static void PUT_PIXEL_16(USHORT *Buffer, USHORT Value)
BOOL sw_SetPixelFormat(HDC hdc, struct wgl_dc_data *dc_data, INT format)
static void PUT_PIXEL_24(ULONG *Buffer, ULONG Value)
#define WRITE_COLOR_PIXELS(__bpp, __type, __pixel_size)
void APIENTRY _mesa_GetColorTableParameterivEXT(GLenum, GLenum, GLfloat *)
static LRESULT CALLBACK sw_call_window_proc(int nCode, WPARAM wParam, LPARAM lParam)
static void UNPACK_COLOR_24(ULONG Color, GLubyte *r, GLubyte *g, GLubyte *b)
static const char * renderer_string(void)
static void PUT_PIXEL_8(BYTE *Buffer, BYTE Value)
#define WIDTH_BYTES_ALIGN32(cx, bpp)
static void read_index_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[])
static COLORREF PACK_COLORREF_32(GLubyte r, GLubyte g, GLubyte b)
#define WRITE_COLOR_SPAN(__bpp, __type, __pixel_size)
static void write_monocolor_span_frontbuffer(struct sw_framebuffer *fb, GLuint n, GLint x, GLint y, const GLubyte mask[], COLORREF Color)
void APIENTRY _mesa_GetColorTableParameterfvEXT(GLenum, GLenum, GLint *)
static USHORT GET_PIXEL_16(USHORT *Buffer)
#define WRITE_COLOR_SPAN_FRONTBUFFER(__bpp)
#define READ_COLOR_PIXELS(__bpp, __type, __pixel_size)
static COLORREF PACK_COLORREF_24(GLubyte r, GLubyte g, GLubyte b)
#define WRITE_MONOCOLOR_SPAN(__bpp, __type, __pixel_size)
#define CLEAR(__bpp, __type, __pixel_size)
static const struct pixel_format pixel_formats_8[]
static void write_monocolor_pixels_frontbuffer(struct sw_framebuffer *fb, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[], COLORREF Color)
static ULONG PACK_COLOR_32(GLubyte r, GLubyte g, GLubyte b)
BOOL sw_CopyContext(DHGLRC dhglrcSrc, DHGLRC dhglrcDst, UINT mask)
static COLORREF PACK_COLORREF_8(GLubyte r, GLubyte g, GLubyte b)
BOOL sw_ShareLists(DHGLRC dhglrcSrc, DHGLRC dhglrcDst)
BOOL sw_DeleteContext(DHGLRC dhglrc)
static void UNPACK_COLOR_16(USHORT Color, GLubyte *r, GLubyte *g, GLubyte *b)
static void UNPACK_COLORREF_16(COLORREF Color, GLubyte *r, GLubyte *g, GLubyte *b)
static void write_index_span(GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[])
DHGLRC sw_CreateContext(struct wgl_dc_data *dc_data)
void APIENTRY _mesa_GetColorTableEXT(GLenum, GLenum, GLenum, void *)
static BYTE GET_PIXEL_8(BYTE *Buffer)
BOOL sw_SetContext(struct wgl_dc_data *dc_data, DHGLRC dhglrc)
static ULONG GET_PIXEL_32(ULONG *Buffer)
static void UNPACK_COLOR_8(BYTE Color, GLubyte *r, GLubyte *g, GLubyte *b)
static ULONG PACK_COLOR_24(GLubyte r, GLubyte g, GLubyte b)
INT sw_DescribePixelFormat(HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR *descr)
static void read_index_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[])
static void UNPACK_COLORREF_24(COLORREF Color, GLubyte *r, GLubyte *g, GLubyte *b)
PROC sw_GetProcAddress(LPCSTR name)
void APIENTRY _mesa_ColorSubTableEXT(GLenum, GLsizei, GLsizei, GLenum, GLenum, const void *)
static void write_index_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[])
static USHORT PACK_COLOR_16(GLubyte r, GLubyte g, GLubyte b)
static const struct pixel_format * get_format(INT pf_index, INT *pf_count)
static COLORREF PACK_COLORREF_16(GLubyte r, GLubyte g, GLubyte b)
#define CLEAR_INDEX(__bpp, __type)
static void setup_DD_pointers(GLcontext *ctx)
static void UNPACK_COLORREF_8(COLORREF Color, GLubyte *r, GLubyte *g, GLubyte *b)
static void clear_frontbuffer(struct sw_context *sw_ctx, struct sw_framebuffer *fb, GLint x, GLint y, GLint width, GLint height, COLORREF ClearColor)
static const struct pixel_format pixel_formats_16[]
#define CLEAR_COLOR(__bpp)
static void UNPACK_COLOR_32(ULONG Color, GLubyte *r, GLubyte *g, GLubyte *b)
BOOL sw_SwapBuffers(HDC hdc, struct wgl_dc_data *dc_data)
static GLboolean set_buffer(GLcontext *ctx, GLenum mode)
#define READ_COLOR_SPAN(__bpp, __type, __pixel_size)
static ULONG GET_PIXEL_24(ULONG *Buffer)
static const struct pixel_format pixel_formats_32[]
static void APIENTRY _swimpl_AddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height)
static void UNPACK_COLORREF_32(COLORREF Color, GLubyte *r, GLubyte *g, GLubyte *b)
void sw_ReleaseContext(DHGLRC dhglrc)
void APIENTRY _mesa_ColorTableEXT(GLenum, GLenum, GLsizei, GLenum, GLenum, const void *)
static BYTE PACK_COLOR_8(GLubyte r, GLubyte g, GLubyte b)
static GLCLTPROCTABLE sw_api_table
#define HANDLE_BPP(__x__)
GLcontext * gl_get_thread_context(void)
#define WRITE_MONOCOLOR_PIXELS(__bpp, __type, __pixel_size)
static const struct pixel_format pixel_formats_24[]
#define MAKE_COLORREF(__bpp, __type)
static void PUT_PIXEL_32(ULONG *Buffer, ULONG Value)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
#define PFD_TYPE_COLORINDEX
int WINAPI SetDIBitsToDevice(_In_ HDC, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ int, _In_ int, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HWND WINAPI WindowFromDC(_In_ HDC hDC)
struct tagCWPSTRUCT * PCWPSTRUCT
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
struct _WINDOWPOS * LPWINDOWPOS
HDC WINAPI GetDC(_In_opt_ HWND)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define WM_WINDOWPOSCHANGED