1 /**************************************************************************
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 #include "util/u_debug.h"
31 #include "stw_public.h"
35 WINGDIAPI BOOL APIENTRY
41 return stw_copy_context( (UINT_PTR
)hglrcSrc
,
46 WINGDIAPI HGLRC APIENTRY
50 return wglCreateLayerContext(hdc
, 0);
53 WINGDIAPI HGLRC APIENTRY
54 wglCreateLayerContext(
58 return (HGLRC
) stw_create_layer_context( hdc
, iLayerPlane
);
61 WINGDIAPI BOOL APIENTRY
65 return stw_delete_context( (UINT_PTR
)hglrc
);
69 WINGDIAPI HGLRC APIENTRY
70 wglGetCurrentContext( VOID
)
72 return (HGLRC
)stw_get_current_context();
75 WINGDIAPI HDC APIENTRY
76 wglGetCurrentDC( VOID
)
78 return stw_get_current_dc();
81 WINGDIAPI BOOL APIENTRY
86 return stw_make_current( hdc
, (UINT_PTR
)hglrc
);
90 WINGDIAPI BOOL APIENTRY
94 return stw_swap_buffers( hdc
);
98 WINGDIAPI BOOL APIENTRY
103 return stw_swap_layer_buffers( hdc
, fuPlanes
);
106 WINGDIAPI PROC APIENTRY
110 return stw_get_proc_address( lpszProc
);
114 WINGDIAPI
int APIENTRY
115 wglChoosePixelFormat(
117 CONST PIXELFORMATDESCRIPTOR
*ppfd
)
119 if (ppfd
->nSize
!= sizeof( PIXELFORMATDESCRIPTOR
) || ppfd
->nVersion
!= 1)
121 if (ppfd
->iPixelType
!= PFD_TYPE_RGBA
)
123 if (!(ppfd
->dwFlags
& PFD_DRAW_TO_WINDOW
))
125 if (!(ppfd
->dwFlags
& PFD_SUPPORT_OPENGL
))
127 if (ppfd
->dwFlags
& PFD_DRAW_TO_BITMAP
)
129 if (ppfd
->dwFlags
& PFD_SUPPORT_GDI
)
131 if (!(ppfd
->dwFlags
& PFD_STEREO_DONTCARE
) && (ppfd
->dwFlags
& PFD_STEREO
))
134 return stw_pixelformat_choose( hdc
, ppfd
);
137 WINGDIAPI
int APIENTRY
138 wglDescribePixelFormat(
142 LPPIXELFORMATDESCRIPTOR ppfd
)
144 return stw_pixelformat_describe( hdc
, iPixelFormat
, nBytes
, ppfd
);
147 WINGDIAPI
int APIENTRY
151 return stw_pixelformat_get( hdc
);
154 WINGDIAPI BOOL APIENTRY
158 const PIXELFORMATDESCRIPTOR
*ppfd
)
160 if (ppfd
->nSize
!= sizeof( PIXELFORMATDESCRIPTOR
))
163 return stw_pixelformat_set( hdc
, iPixelFormat
);
167 WINGDIAPI BOOL APIENTRY
184 WINGDIAPI BOOL APIENTRY
189 return stw_share_lists( (UINT_PTR
)hglrc1
, (UINT_PTR
)hglrc2
);;
192 WINGDIAPI BOOL APIENTRY
209 WINGDIAPI BOOL APIENTRY
218 LPGLYPHMETRICSFLOAT lpgmf
)
234 WINGDIAPI BOOL APIENTRY
243 LPGLYPHMETRICSFLOAT lpgmf
)
259 WINGDIAPI BOOL APIENTRY
260 wglDescribeLayerPlane(
265 LPLAYERPLANEDESCRIPTOR plpd
)
278 WINGDIAPI
int APIENTRY
279 wglSetLayerPaletteEntries(
284 CONST COLORREF
*pcr
)
297 WINGDIAPI
int APIENTRY
298 wglGetLayerPaletteEntries(
316 WINGDIAPI BOOL APIENTRY
317 wglRealizeLayerPalette(