982de2266646e30cfd16c418faa6025263e26e83
[mesa.git] / src / gallium / state_trackers / wgl / shared / stw_pixelformat.h
1 /**************************************************************************
2 *
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
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:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
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.
25 *
26 **************************************************************************/
27
28 #ifndef PIXELFORMAT_H
29 #define PIXELFORMAT_H
30
31 #include <windows.h>
32
33 #define PF_FLAG_DOUBLEBUFFER 0x00000001
34 #define PF_FLAG_MULTISAMPLED 0x00000002
35
36 struct pixelformat_color_info
37 {
38 uint redbits;
39 uint redshift;
40 uint greenbits;
41 uint greenshift;
42 uint bluebits;
43 uint blueshift;
44 };
45
46 struct pixelformat_alpha_info
47 {
48 uint alphabits;
49 uint alphashift;
50 };
51
52 struct pixelformat_depth_info
53 {
54 uint depthbits;
55 uint stencilbits;
56 };
57
58 struct pixelformat_info
59 {
60 uint flags;
61 struct pixelformat_color_info color;
62 struct pixelformat_alpha_info alpha;
63 struct pixelformat_depth_info depth;
64 };
65
66 void
67 pixelformat_init( void );
68
69 uint
70 pixelformat_get_count( void );
71
72 uint
73 pixelformat_get_extended_count( void );
74
75 const struct pixelformat_info *
76 pixelformat_get_info( uint index );
77
78
79 int
80 stw_pixelformat_describe(
81 HDC hdc,
82 int iPixelFormat,
83 UINT nBytes,
84 LPPIXELFORMATDESCRIPTOR ppfd );
85
86 int
87 stw_pixelformat_get(
88 HDC hdc );
89
90 BOOL
91 stw_pixelformat_set(
92 HDC hdc,
93 int iPixelFormat );
94
95
96 #endif /* PIXELFORMAT_H */