-/* $Id: context.c,v 1.51 2000/03/27 17:54:17 brianp Exp $ */
+/* $Id: context.c,v 1.52 2000/03/31 01:05:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Return: pointer to new GLvisual or NULL if requested parameters can't
* be met.
*/
-GLvisual *gl_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
- GLboolean dbFlag,
- GLboolean stereoFlag,
- GLint depthBits,
- GLint stencilBits,
- GLint accumBits,
- GLint indexBits,
- GLint redBits,
- GLint greenBits,
- GLint blueBits,
- GLint alphaBits )
+GLvisual *
+_mesa_create_visual( GLboolean rgbFlag,
+ GLboolean alphaFlag,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint indexBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples )
{
GLvisual *vis;
if (stencilBits < 0 || stencilBits > (GLint) (8 * sizeof(GLstencil))) {
return NULL;
}
- if (accumBits < 0 || accumBits > (GLint) (8 * sizeof(GLaccum))) {
+ if (accumRedBits < 0 || accumRedBits > (GLint) (8 * sizeof(GLaccum))) {
+ return NULL;
+ }
+ if (accumGreenBits < 0 || accumGreenBits > (GLint) (8 * sizeof(GLaccum))) {
+ return NULL;
+ }
+ if (accumBlueBits < 0 || accumBlueBits > (GLint) (8 * sizeof(GLaccum))) {
+ return NULL;
+ }
+ if (accumAlphaBits < 0 || accumAlphaBits > (GLint) (8 * sizeof(GLaccum))) {
return NULL;
}
vis->BlueBits = blueBits;
vis->AlphaBits = alphaFlag ? (8 * sizeof(GLubyte)) : alphaBits;
- vis->IndexBits = indexBits;
- vis->DepthBits = depthBits;
- vis->AccumBits = (accumBits > 0) ? (8 * sizeof(GLaccum)) : 0;
- vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
+ vis->IndexBits = indexBits;
+ vis->DepthBits = depthBits;
+ vis->AccumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->AccumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->AccumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->AccumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
vis->SoftwareAlpha = alphaFlag;
}
+/* This function should no longer be used. Use _mesa_create_visual() instead */
+GLvisual *gl_create_visual( GLboolean rgbFlag,
+ GLboolean alphaFlag,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumBits,
+ GLint indexBits,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits )
+{
+ return _mesa_create_visual(rgbFlag, alphaFlag, dbFlag, stereoFlag,
+ redBits, greenBits, blueBits, alphaBits,
+ indexBits, depthBits, stencilBits,
+ accumBits, accumBits, accumBits, accumBits, 0);
+}
+
+
+void
+_mesa_destroy_visual( GLvisual *vis )
+{
+ FREE(vis);
+}
+
+/* obsolete */
void gl_destroy_visual( GLvisual *vis )
{
- FREE( vis );
+ _mesa_destroy_visual(vis);
}
}
if (softwareAccum) {
assert(visual->RGBAflag);
- assert(visual->AccumBits > 0);
+ assert(visual->AccumRedBits > 0);
+ assert(visual->AccumGreenBits > 0);
+ assert(visual->AccumBlueBits > 0);
}
if (softwareAlpha) {
assert(visual->RGBAflag);
-/* $Id: context.h,v 1.14 2000/03/19 01:10:11 brianp Exp $ */
+/* $Id: context.h,v 1.15 2000/03/31 01:05:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
* the colorbuffer, depth buffer, stencil buffer and accum buffer which will
* be used by the GL context and framebuffer.
*/
+extern GLvisual *
+_mesa_create_visual( GLboolean rgbFlag,
+ GLboolean alphaFlag,
+ GLboolean dbFlag,
+ GLboolean stereoFlag,
+ GLint redBits,
+ GLint greenBits,
+ GLint blueBits,
+ GLint alphaBits,
+ GLint indexBits,
+ GLint depthBits,
+ GLint stencilBits,
+ GLint accumRedBits,
+ GLint accumGreenBits,
+ GLint accumBlueBits,
+ GLint accumAlphaBits,
+ GLint numSamples );
+
+/* this function is obsolete */
extern GLvisual *gl_create_visual( GLboolean rgbFlag,
GLboolean alphaFlag,
GLboolean dbFlag,
GLint blueBits,
GLint alphaBits );
-extern void gl_destroy_visual( GLvisual *vis );
+
+extern void
+_mesa_destroy_visual( GLvisual *vis );
+
+/*obsolete */ extern void gl_destroy_visual( GLvisual *vis );
/*