-/* $Id: fakeglx.c,v 1.32 2000/04/10 21:13:19 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.33 2000/04/19 01:44:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "config.h"
#include "macros.h"
+#include "mmath.h"
#include "types.h"
+#include "xfonts.h"
#include "xmesaP.h"
-/*
- * Return number of bits set in n.
- */
-static int bitcount( unsigned long n )
-{
- int bits;
- for (bits=0; n>0; n=n>>1) {
- if (n&1) {
- bits++;
- }
- }
- return bits;
-}
-
-
/*
* Try to get an X visual which matches the given arguments.
*/
* 10 bits per color channel. Mesa's limited to a max of 8 bits/channel.
*/
if (vis && depth > 24 && (xclass==TrueColor || xclass==DirectColor)) {
- if (bitcount(vis->red_mask) <= 8
- && bitcount(vis->green_mask) <= 8
- && bitcount(vis->blue_mask) <= 8) {
+ if (_mesa_bitcount((GLuint) vis->red_mask ) <= 8 &&
+ _mesa_bitcount((GLuint) vis->green_mask) <= 8 &&
+ _mesa_bitcount((GLuint) vis->blue_mask ) <= 8) {
return vis;
}
else {
-extern void Fake_glXUseXFont( Font font, int first, int count, int listbase );
-
-
extern struct _glxapi_table *_mesa_GetGLXDispatchTable(void);
struct _glxapi_table *_mesa_GetGLXDispatchTable(void)
{
glx.DestroyWindow = Fake_glXDestroyWindow;
/*glx.GetCurrentReadDrawable = Fake_glXGetCurrentReadDrawable;*/
glx.GetFBConfigAttrib = Fake_glXGetFBConfigAttrib;
+ glx.GetFBConfigs = Fake_glXGetFBConfigs;
glx.GetSelectedEvent = Fake_glXGetSelectedEvent;
glx.GetVisualFromFBConfig = Fake_glXGetVisualFromFBConfig;
glx.MakeContextCurrent = Fake_glXMakeContextCurrent;
-/* $Id: xfonts.c,v 1.5 1999/12/12 17:04:50 brianp Exp $ */
+/* $Id: xfonts.c,v 1.6 2000/04/19 01:44:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "GL/xmesa.h"
#include "context.h"
#include "mem.h"
+#include "xfonts.h"
#include "xmesaP.h"
+
/* Some debugging info. */
#ifdef DEBUG
glEndList ();
}
- free (bm);
+ FREE(bm);
XFreeFontInfo( NULL, fs, 0 );
XFreeGC (dpy, gc);
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
}
+
+extern void xmesa_xfonts_dummy( void );
void xmesa_xfonts_dummy( void )
{
/* silence unused var warnings */
--- /dev/null
+/* $Id: xfonts.h,v 1.1 2000/04/19 01:44:02 brianp Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.3
+ *
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef XFONTS_H
+#define XFONTS_H
+
+
+#include <X11/Xlib.h>
+
+
+extern void Fake_glXUseXFont( Font font, int first, int count, int listbase );
+
+
+#endif
+