8 #include "GL/os2mesa.h"
11 /* global current HDC */
13 XVisualInfo
*wglDescribePixelFormat(int iPixelFormat
);
17 //extern HPS hpsCurrent;
18 extern HAB hab
; /* PM anchor block handle */
21 glXCreateContext(HPS hps
, XVisualInfo
* visinfo
,
22 GLXContext share
, Bool direct
)
24 /* KLUDGE: GLX really expects a display pointer to be passed
25 in as the first parameter, but Win32 needs an HDC instead,
26 so BE SURE that the global XHDC is set before calling this
30 context
= wglCreateContext(XHDC
,hps
,hab
);
33 /* Since direct rendering is implicit, the direct flag is
41 glXGetConfig(XVisualInfo
* visual
, int attrib
, int *value
)
44 return GLX_BAD_VISUAL
;
48 if (visual
->dwFlags
& (PFD_SUPPORT_OPENGL
| PFD_DRAW_TO_WINDOW
)) {
49 /* XXX Brad's Matrix Millenium II has problems creating
50 color index windows in 24-bit mode (lead to GDI crash)
51 and 32-bit mode (lead to black window). The cColorBits
52 filed of the PIXELFORMATDESCRIPTOR returned claims to
53 have 24 and 32 bits respectively of color indices. 2^24
54 and 2^32 are ridiculously huge writable colormaps.
55 Assume that if we get back a color index
56 PIXELFORMATDESCRIPTOR with 24 or more bits, the
57 PIXELFORMATDESCRIPTOR doesn't really work and skip it.
59 if (visual
->iPixelType
== PFD_TYPE_COLORINDEX
60 && visual
->cColorBits
>= 24) {
70 /* KLUDGE: if we're RGBA, return the number of bits/pixel,
71 otherwise, return 8 (we guessed at 256 colors in CI
73 if (visual
->iPixelType
== PFD_TYPE_RGBA
)
74 *value
= visual
->cColorBits
;
79 /* The bReserved flag of the pfd contains the
80 overlay/underlay info. */
81 *value
= visual
->bReserved
;
84 *value
= visual
->iPixelType
== PFD_TYPE_RGBA
;
86 case GLX_DOUBLEBUFFER
:
87 *value
= visual
->dwFlags
& PFD_DOUBLEBUFFER
;
90 *value
= visual
->dwFlags
& PFD_STEREO
;
93 *value
= visual
->cAuxBuffers
;
96 *value
= visual
->cRedBits
;
99 *value
= visual
->cGreenBits
;
102 *value
= visual
->cBlueBits
;
105 *value
= visual
->cAlphaBits
;
108 *value
= visual
->cDepthBits
;
110 case GLX_STENCIL_SIZE
:
111 *value
= visual
->cStencilBits
;
113 case GLX_ACCUM_RED_SIZE
:
114 *value
= visual
->cAccumRedBits
;
116 case GLX_ACCUM_GREEN_SIZE
:
117 *value
= visual
->cAccumGreenBits
;
119 case GLX_ACCUM_BLUE_SIZE
:
120 *value
= visual
->cAccumBlueBits
;
122 case GLX_ACCUM_ALPHA_SIZE
:
123 *value
= visual
->cAccumAlphaBits
;
126 #endif /* POKA == 100 */
128 return GLX_BAD_ATTRIB
;
134 XVisualInfo
* glXChooseVisual(int mode
)
136 if(mode
& GLUT_DOUBLE
)
139 wglDescribePixelFormat(imode
);