2 * DIBDRV OpenGL functions
4 * Copyright 2009 Massimo Del Fedele
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
26 #define HPBUFFERARB void *
28 WINE_DEFAULT_DEBUG_CHANNEL(dibdrv
);
30 int DIBDRV_ChoosePixelFormat( DIBDRVPHYSDEV
*physDev
,
31 const PIXELFORMATDESCRIPTOR
*ppfd
)
35 MAYBE(TRACE("physDev:%p, ppfd:%p\n", physDev
, ppfd
));
39 /* DIB section selected in, use DIB Engine */
40 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
41 res
= _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev
->X11PhysDev
, ppfd
);
45 /* DDB selected in, use X11 driver */
46 res
= _DIBDRV_GetDisplayDriver()->pChoosePixelFormat(physDev
->X11PhysDev
, ppfd
);
51 int DIBDRV_DescribePixelFormat( DIBDRVPHYSDEV
*physDev
,
54 PIXELFORMATDESCRIPTOR
*ppfd
)
58 MAYBE(TRACE("physDev:%p, iPixelFormat:%d, nBytes:%d, ppfd:%p\n", physDev
, iPixelFormat
, nBytes
, ppfd
));
62 /* DIB section selected in, use DIB Engine */
63 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
64 res
= _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev
->X11PhysDev
, iPixelFormat
, nBytes
, ppfd
);
68 /* DDB selected in, use X11 driver */
69 res
= _DIBDRV_GetDisplayDriver()->pDescribePixelFormat(physDev
->X11PhysDev
, iPixelFormat
, nBytes
, ppfd
);
74 int DIBDRV_GetPixelFormat( DIBDRVPHYSDEV
*physDev
)
78 MAYBE(TRACE("physDev:%p\n", physDev
));
82 /* DIB section selected in, use DIB Engine */
83 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
84 res
= _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev
->X11PhysDev
);
88 /* DDB selected in, use X11 driver */
89 res
= _DIBDRV_GetDisplayDriver()->pGetPixelFormat(physDev
->X11PhysDev
);
94 BOOL
DIBDRV_SetPixelFormat( DIBDRVPHYSDEV
*physDev
,
96 const PIXELFORMATDESCRIPTOR
*ppfd
)
100 MAYBE(TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev
, iPixelFormat
, ppfd
));
104 /* DIB section selected in, use DIB Engine */
105 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
106 res
= _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev
->X11PhysDev
, iPixelFormat
, ppfd
);
110 /* DDB selected in, use X11 driver */
111 res
= _DIBDRV_GetDisplayDriver()->pSetPixelFormat(physDev
->X11PhysDev
, iPixelFormat
, ppfd
);
116 BOOL
DIBDRV_SwapBuffers( DIBDRVPHYSDEV
*physDev
)
120 MAYBE(TRACE("physDev:%p\n", physDev
));
124 /* DIB section selected in, use DIB Engine */
125 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
126 res
= _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev
->X11PhysDev
);
130 /* DDB selected in, use X11 driver */
131 res
= _DIBDRV_GetDisplayDriver()->pSwapBuffers(physDev
->X11PhysDev
);
137 * DIBDRV_wglCopyContext
139 * For OpenGL32 wglCopyContext.
141 BOOL CDECL
DIBDRV_wglCopyContext(HGLRC hglrcSrc
, HGLRC hglrcDst
, UINT mask
)
145 MAYBE(TRACE("hglrcSrc:%p, hglrcDst:%p, mask:%x\n", hglrcSrc
, hglrcDst
, mask
));
147 ONCE(FIXME("stub\n"));
148 res
= _DIBDRV_GetDisplayDriver()->pwglCopyContext(hglrcSrc
, hglrcDst
, mask
);
154 * DIBDRV_wglCreateContext
156 * For OpenGL32 wglCreateContext.
158 HGLRC CDECL
DIBDRV_wglCreateContext(DIBDRVPHYSDEV
*physDev
)
162 MAYBE(TRACE("physDev:%p\n", physDev
));
166 /* DIB section selected in, use DIB Engine */
167 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
168 res
= _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev
->X11PhysDev
);
172 /* DDB selected in, use X11 driver */
173 res
= _DIBDRV_GetDisplayDriver()->pwglCreateContext(physDev
->X11PhysDev
);
179 * DIBDRV_wglDeleteContext
181 * For OpenGL32 wglDeleteContext.
183 BOOL CDECL
DIBDRV_wglDeleteContext(HGLRC hglrc
)
187 MAYBE(TRACE("hglrc:%p\n", hglrc
));
189 ONCE(FIXME("stub\n"));
190 res
= _DIBDRV_GetDisplayDriver()->pwglDeleteContext(hglrc
);
195 * DIBDRV_wglGetProcAddress
197 * For OpenGL32 wglGetProcAddress.
199 PROC CDECL
DIBDRV_wglGetProcAddress(LPCSTR lpszProc
)
203 MAYBE(TRACE("lpszProc:%p\n", lpszProc
));
205 ONCE(FIXME("stub\n"));
206 res
= _DIBDRV_GetDisplayDriver()->pwglGetProcAddress(lpszProc
);
212 * DIBDRV_wglGetPbufferDCARB
214 * WGL_ARB_pbuffer: wglGetPbufferDCARB
215 * The function wglGetPbufferDCARB returns a device context for a pbuffer.
216 * Gdi32 implements the part of this function which creates a device context.
217 * This part associates the physDev with the X drawable of the pbuffer.
219 HDC CDECL
DIBDRV_wglGetPbufferDCARB(DIBDRVPHYSDEV
*physDev
, HPBUFFERARB hPbuffer
)
223 MAYBE(TRACE("physDev:%p, hPbuffer:%p\n", physDev
, hPbuffer
));
227 /* DIB section selected in, use DIB Engine */
228 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
229 res
= _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev
->X11PhysDev
, hPbuffer
);
233 /* DDB selected in, use X11 driver */
234 res
= _DIBDRV_GetDisplayDriver()->pwglGetPbufferDCARB(physDev
->X11PhysDev
, hPbuffer
);
240 * DIBDRV_wglMakeContextCurrentARB
242 * For OpenGL32 wglMakeContextCurrentARB
244 BOOL CDECL
DIBDRV_wglMakeContextCurrentARB(DIBDRVPHYSDEV
* pDrawDev
, DIBDRVPHYSDEV
* pReadDev
, HGLRC hglrc
)
248 MAYBE(TRACE("pDrawDev:%p, pReadDev:%p, hglrc:%p\n", pDrawDev
, pReadDev
, hglrc
));
250 if(pDrawDev
->hasDIB
&& pReadDev
->hasDIB
)
252 /* DIB section selected both in source and dest DCs, use DIB Engine */
253 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
254 res
= _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev
->X11PhysDev
, pReadDev
->X11PhysDev
, hglrc
);
256 if(!pDrawDev
->hasDIB
&& !pReadDev
->hasDIB
)
258 /* DDB selected both in source and dest DCs, use X11 Driver */
259 res
= _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev
->X11PhysDev
, pReadDev
->X11PhysDev
, hglrc
);
261 else if(pDrawDev
->hasDIB
)
263 /* DIB selected in pDrawDev, must convert pReadDev to DIB and use DIB Engine */
264 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
265 res
= _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev
->X11PhysDev
, pReadDev
->X11PhysDev
, hglrc
);
267 else /* if(pReadDev->hasDIB) */
269 /* DIB selected in pReadDev, must convert pReadDev to DDB and use X11 Driver */
270 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
271 res
= _DIBDRV_GetDisplayDriver()->pwglMakeContextCurrentARB(pDrawDev
->X11PhysDev
, pReadDev
->X11PhysDev
, hglrc
);
277 * DIBDRV_wglMakeCurrent
279 * For OpenGL32 wglMakeCurrent.
281 BOOL CDECL
DIBDRV_wglMakeCurrent(DIBDRVPHYSDEV
*physDev
, HGLRC hglrc
)
285 MAYBE(TRACE("physDev:%p, hglrc:%p\n", physDev
, hglrc
));
289 /* DIB section selected in, use DIB Engine */
290 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
291 res
= _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev
->X11PhysDev
, hglrc
);
295 /* DDB selected in, use X11 driver */
296 res
= _DIBDRV_GetDisplayDriver()->pwglMakeCurrent(physDev
->X11PhysDev
, hglrc
);
302 * DIBDRV_wglSetPixelFormatWINE
304 * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE
305 * This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times.
307 BOOL CDECL
DIBDRV_wglSetPixelFormatWINE(DIBDRVPHYSDEV
*physDev
, int iPixelFormat
, const PIXELFORMATDESCRIPTOR
*ppfd
)
311 MAYBE(TRACE("physDev:%p, iPixelFormat:%d, ppfd:%p\n", physDev
, iPixelFormat
, ppfd
));
315 /* DIB section selected in, use DIB Engine */
316 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
317 res
= _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev
->X11PhysDev
, iPixelFormat
, ppfd
);
321 /* DDB selected in, use X11 driver */
322 res
= _DIBDRV_GetDisplayDriver()->pwglSetPixelFormatWINE(physDev
->X11PhysDev
, iPixelFormat
, ppfd
);
328 * DIBDRV_wglShareLists
330 * For OpenGL32 wglShareLists.
332 BOOL CDECL
DIBDRV_wglShareLists(HGLRC hglrc1
, HGLRC hglrc2
)
336 MAYBE(TRACE("hglrc1:%p, hglrc2:%p\n", hglrc1
, hglrc2
));
338 ONCE(FIXME("stub\n"));
339 res
= _DIBDRV_GetDisplayDriver()->pwglShareLists(hglrc1
, hglrc2
);
345 * DIBDRV_wglUseFontBitmapsA
347 * For OpenGL32 wglUseFontBitmapsA.
349 BOOL CDECL
DIBDRV_wglUseFontBitmapsA(DIBDRVPHYSDEV
*physDev
, DWORD first
, DWORD count
, DWORD listBase
)
353 MAYBE(TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev
, first
, count
, listBase
));
357 /* DIB section selected in, use DIB Engine */
358 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
359 res
= _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev
->X11PhysDev
, first
, count
, listBase
);
363 /* DDB selected in, use X11 driver */
364 res
= _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsA(physDev
->X11PhysDev
, first
, count
, listBase
);
370 * DIBDRV_wglUseFontBitmapsW
372 * For OpenGL32 wglUseFontBitmapsW.
374 BOOL CDECL
DIBDRV_wglUseFontBitmapsW(DIBDRVPHYSDEV
*physDev
, DWORD first
, DWORD count
, DWORD listBase
)
378 MAYBE(TRACE("physDev:%p, first:%d, count:%d, listBase:%d\n", physDev
, first
, count
, listBase
));
382 /* DIB section selected in, use DIB Engine */
383 ONCE(FIXME("TEMPORARY - fallback to X11 driver\n"));
384 res
= _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev
->X11PhysDev
, first
, count
, listBase
);
388 /* DDB selected in, use X11 driver */
389 res
= _DIBDRV_GetDisplayDriver()->pwglUseFontBitmapsW(physDev
->X11PhysDev
, first
, count
, listBase
);