From 08fdc741bc509c284532d0e2fec32980c3047aec Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Jan 2009 17:20:18 -0700 Subject: mesa: import glext.h version 44 --- include/GL/glext.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 4255fa8639..c0941aa804 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -46,9 +46,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2008/10/09 */ +/* glext.h last updated 2008/11/14 */ /* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 43 +#define GL_GLEXT_VERSION 44 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -3834,6 +3834,34 @@ extern "C" { /* reuse GL_BGRA */ #endif +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + /*************************************************************/ @@ -8387,6 +8415,42 @@ typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenu #define GL_EXT_vertex_array_bgra 1 #endif +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From f7b4c2cca9ea9013f527b25ae45605047c58d64c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Jan 2009 17:20:41 -0700 Subject: mesa: latest glxext.h header, no version change --- include/GL/glxext.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 71cf0469e3..536fb25a76 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -127,6 +127,14 @@ extern "C" { #define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 #endif +#ifndef GLX_ARB_create_context +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#endif + #ifndef GLX_SGIS_multisample #define GLX_SAMPLE_BUFFERS_SGIS 100000 #define GLX_SAMPLES_SGIS 100001 @@ -366,14 +374,6 @@ extern "C" { #ifndef GLX_NV_swap_group #endif -#ifndef GLX_ARB_create_context -#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 -#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define GLX_CONTEXT_FLAGS_ARB 0x2094 -#endif - /*************************************************************/ @@ -510,6 +510,14 @@ typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procNam #define GLX_ARB_fbconfig_float 1 #endif +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); +#endif + #ifndef GLX_SGIS_multisample #define GLX_SGIS_multisample 1 #endif @@ -817,14 +825,6 @@ typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawab #define GLX_NV_swap_group 1 #endif -#ifndef GLX_ARB_create_context -#define GLX_ARB_create_context 1 -#ifdef GLX_GLXEXT_PROTOTYPES -extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *); -#endif /* GLX_GLXEXT_PROTOTYPES */ -typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); -#endif - #ifdef __cplusplus } -- cgit v1.2.3 From 1636328b0adefcebcc204d63980184a6d592efae Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 11:57:13 -0700 Subject: xmesa: deprecate the "XMesa" interface Move the include/GL/xmesa*.h files to src/mesa/drivers/x11/ so they're no longer considered public. --- include/GL/xmesa.h | 424 -------------------------------------- include/GL/xmesa_x.h | 86 -------- include/GL/xmesa_xf86.h | 198 ------------------ src/mesa/drivers/x11/fakeglx.c | 1 - src/mesa/drivers/x11/xm_api.c | 1 - src/mesa/drivers/x11/xm_buffer.c | 1 - src/mesa/drivers/x11/xmesa.h | 424 ++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/x11/xmesaP.h | 2 +- src/mesa/drivers/x11/xmesa_x.h | 86 ++++++++ src/mesa/drivers/x11/xmesa_xf86.h | 198 ++++++++++++++++++ 10 files changed, 709 insertions(+), 712 deletions(-) delete mode 100644 include/GL/xmesa.h delete mode 100644 include/GL/xmesa_x.h delete mode 100644 include/GL/xmesa_xf86.h create mode 100644 src/mesa/drivers/x11/xmesa.h create mode 100644 src/mesa/drivers/x11/xmesa_x.h create mode 100644 src/mesa/drivers/x11/xmesa_xf86.h (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h deleted file mode 100644 index 98139af833..0000000000 --- a/include/GL/xmesa.h +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 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. - */ - - -/* - * Mesa/X11 interface. This header file serves as the documentation for - * the Mesa/X11 interface functions. - * - * Note: this interface isn't intended for user programs. It's primarily - * just for implementing the pseudo-GLX interface. - */ - - -/* Sample Usage: - -In addition to the usual X calls to select a visual, create a colormap -and create a window, you must do the following to use the X/Mesa interface: - -1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo. - -2. Call XMesaCreateContext() to create an X/Mesa rendering context, given - the XMesaVisual. - -3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window - and XMesaVisual. - -4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and - to make the context the current one. - -5. Make gl* calls to render your graphics. - -6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers. - -7. Before the X window is destroyed, call XMesaDestroyBuffer(). - -8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext. - -*/ - - - - -#ifndef XMESA_H -#define XMESA_H - -#ifdef __VMS -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef XFree86Server -#include "xmesa_xf86.h" -#else -#include -#include -#include "xmesa_x.h" -#endif -#include "GL/gl.h" - -#ifdef AMIWIN -#include -extern struct Library *XLibBase; -#endif - - -#define XMESA_MAJOR_VERSION 6 -#define XMESA_MINOR_VERSION 3 - - - -/* - * Values passed to XMesaGetString: - */ -#define XMESA_VERSION 1 -#define XMESA_EXTENSIONS 2 - - -/* - * Values passed to XMesaSetFXmode: - */ -#define XMESA_FX_WINDOW 1 -#define XMESA_FX_FULLSCREEN 2 - - - -typedef struct xmesa_context *XMesaContext; - -typedef struct xmesa_visual *XMesaVisual; - -typedef struct xmesa_buffer *XMesaBuffer; - - - -/* - * Create a new X/Mesa visual. - * Input: display - X11 display - * visinfo - an XVisualInfo pointer - * rgb_flag - GL_TRUE = RGB mode, - * GL_FALSE = color index mode - * alpha_flag - alpha buffer requested? - * db_flag - GL_TRUE = double-buffered, - * GL_FALSE = single buffered - * stereo_flag - stereo visual? - * ximage_flag - GL_TRUE = use an XImage for back buffer, - * GL_FALSE = use an off-screen pixmap for back buffer - * depth_size - requested bits/depth values, or zero - * stencil_size - requested bits/stencil values, or zero - * accum_red_size - requested bits/red accum values, or zero - * accum_green_size - requested bits/green accum values, or zero - * accum_blue_size - requested bits/blue accum values, or zero - * accum_alpha_size - requested bits/alpha accum values, or zero - * num_samples - number of samples/pixel if multisampling, or zero - * level - visual level, usually 0 - * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT - * Return; a new XMesaVisual or 0 if error. - */ -extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, - XMesaVisualInfo visinfo, - GLboolean rgb_flag, - GLboolean alpha_flag, - GLboolean db_flag, - GLboolean stereo_flag, - GLboolean ximage_flag, - GLint depth_size, - GLint stencil_size, - GLint accum_red_size, - GLint accum_green_size, - GLint accum_blue_size, - GLint accum_alpha_size, - GLint num_samples, - GLint level, - GLint visualCaveat ); - -/* - * Destroy an XMesaVisual, but not the associated XVisualInfo. - */ -extern void XMesaDestroyVisual( XMesaVisual v ); - - - -/* - * Create a new XMesaContext for rendering into an X11 window. - * - * Input: visual - an XMesaVisual - * share_list - another XMesaContext with which to share display - * lists or NULL if no sharing is wanted. - * Return: an XMesaContext or NULL if error. - */ -extern XMesaContext XMesaCreateContext( XMesaVisual v, - XMesaContext share_list ); - - -/* - * Destroy a rendering context as returned by XMesaCreateContext() - */ -extern void XMesaDestroyContext( XMesaContext c ); - - -#ifdef XFree86Server -/* - * These are the extra routines required for integration with XFree86. - * None of these routines should be user visible. -KEM - */ -extern GLboolean XMesaForceCurrent( XMesaContext c ); - -extern GLboolean XMesaLoseCurrent( XMesaContext c ); - -extern GLboolean XMesaCopyContext( XMesaContext src, - XMesaContext dst, - GLuint mask ); -#endif /* XFree86Server */ - - -/* - * Create an XMesaBuffer from an X window. - */ -extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w ); - - -/* - * Create an XMesaBuffer from an X pixmap. - */ -extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, - XMesaPixmap p, - XMesaColormap cmap ); - - -/* - * Destroy an XMesaBuffer, but not the corresponding window or pixmap. - */ -extern void XMesaDestroyBuffer( XMesaBuffer b ); - - -/* - * Return the XMesaBuffer handle which corresponds to an X drawable, if any. - * - * New in Mesa 2.3. - */ -extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, - XMesaDrawable d ); - - - -/* - * Bind a buffer to a context and make the context the current one. - */ -extern GLboolean XMesaMakeCurrent( XMesaContext c, - XMesaBuffer b ); - - -/* - * Bind two buffers (read and draw) to a context and make the - * context the current one. - * New in Mesa 3.3 - */ -extern GLboolean XMesaMakeCurrent2( XMesaContext c, - XMesaBuffer drawBuffer, - XMesaBuffer readBuffer ); - - -/* - * Unbind the current context from its buffer. - */ -extern GLboolean XMesaUnbindContext( XMesaContext c ); - - -/* - * Return a handle to the current context. - */ -extern XMesaContext XMesaGetCurrentContext( void ); - - -/* - * Return handle to the current (draw) buffer. - */ -extern XMesaBuffer XMesaGetCurrentBuffer( void ); - - -/* - * Return handle to the current read buffer. - * New in Mesa 3.3 - */ -extern XMesaBuffer XMesaGetCurrentReadBuffer( void ); - - -/* - * Swap the front and back buffers for the given buffer. No action is - * taken if the buffer is not double buffered. - */ -extern void XMesaSwapBuffers( XMesaBuffer b ); - - -/* - * Copy a sub-region of the back buffer to the front buffer. - * - * New in Mesa 2.6 - */ -extern void XMesaCopySubBuffer( XMesaBuffer b, - int x, - int y, - int width, - int height ); - - -/* - * Return a pointer to the the Pixmap or XImage being used as the back - * color buffer of an XMesaBuffer. This function is a way to get "under - * the hood" of X/Mesa so one can manipulate the back buffer directly. - * Input: b - the XMesaBuffer - * Output: pixmap - pointer to back buffer's Pixmap, or 0 - * ximage - pointer to back buffer's XImage, or NULL - * Return: GL_TRUE = context is double buffered - * GL_FALSE = context is single buffered - */ -extern GLboolean XMesaGetBackBuffer( XMesaBuffer b, - XMesaPixmap *pixmap, - XMesaImage **ximage ); - - - -/* - * Return the depth buffer associated with an XMesaBuffer. - * Input: b - the XMesa buffer handle - * Output: width, height - size of buffer in pixels - * bytesPerValue - bytes per depth value (2 or 4) - * buffer - pointer to depth buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - * - * New in Mesa 2.4. - */ -extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b, - GLint *width, - GLint *height, - GLint *bytesPerValue, - void **buffer ); - - - -/* - * Flush/sync a context - */ -extern void XMesaFlush( XMesaContext c ); - - - -/* - * Get an X/Mesa-specific string. - * Input: name - either XMESA_VERSION or XMESA_EXTENSIONS - */ -extern const char *XMesaGetString( XMesaContext c, int name ); - - - -/* - * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free - * any memory used by that buffer. - * - * New in Mesa 2.3. - */ -extern void XMesaGarbageCollect( void ); - - - -/* - * Return a dithered pixel value. - * Input: c - XMesaContext - * x, y - window coordinate - * red, green, blue, alpha - color components in [0,1] - * Return: pixel value - * - * New in Mesa 2.3. - */ -extern unsigned long XMesaDitherColor( XMesaContext xmesa, - GLint x, - GLint y, - GLfloat red, - GLfloat green, - GLfloat blue, - GLfloat alpha ); - - - -/* - * 3Dfx Glide driver only! - * Set 3Dfx/Glide full-screen or window rendering mode. - * Input: mode - either XMESA_FX_WINDOW (window rendering mode) or - * XMESA_FX_FULLSCREEN (full-screen rendering mode) - * Return: GL_TRUE if success - * GL_FALSE if invalid mode or if not using 3Dfx driver - * - * New in Mesa 2.6. - */ -extern GLboolean XMesaSetFXmode( GLint mode ); - - - -/* - * Reallocate the back/depth/stencil/accum/etc/ buffers associated with - * buffer if its size has changed. - * - * New in Mesa 4.0.2 - */ -extern void XMesaResizeBuffers( XMesaBuffer b ); - - - -/* - * Create a pbuffer. - * New in Mesa 4.1 - */ -extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, - unsigned int width, unsigned int height); - - - -/* - * Texture from Pixmap - * New in Mesa 7.1 - */ -extern void -XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, - const int *attrib_list); - -extern void -XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer); - - -extern XMesaBuffer -XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, - XMesaColormap cmap, - int format, int target, int mipmap); - - - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h deleted file mode 100644 index 865bab4313..0000000000 --- a/include/GL/xmesa_x.h +++ /dev/null @@ -1,86 +0,0 @@ - -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - * When we're building the XMesa driver for stand-alone Mesa we - * include this file when building the xm_*.c files. - * We need to define some types and macros differently when building - * in the Xserver vs. stand-alone Mesa. - */ - -#ifndef _XMESA_X_H_ -#define _XMESA_X_H_ - -typedef Display XMesaDisplay; -typedef Pixmap XMesaPixmap; -typedef Colormap XMesaColormap; -typedef Drawable XMesaDrawable; -typedef Window XMesaWindow; -typedef GC XMesaGC; -typedef XVisualInfo *XMesaVisualInfo; -typedef XImage XMesaImage; -typedef XPoint XMesaPoint; -typedef XColor XMesaColor; - -#define XMesaDestroyImage XDestroyImage - -#define XMesaPutPixel XPutPixel -#define XMesaGetPixel XGetPixel - -#define XMesaSetForeground XSetForeground -#define XMesaSetBackground XSetBackground -#define XMesaSetPlaneMask XSetPlaneMask -#define XMesaSetFunction XSetFunction -#define XMesaSetFillStyle XSetFillStyle -#define XMesaSetTile XSetTile - -#define XMesaDrawPoint XDrawPoint -#define XMesaDrawPoints XDrawPoints -#define XMesaDrawLine XDrawLine -#define XMesaFillRectangle XFillRectangle -#define XMesaGetImage XGetImage -#define XMesaPutImage XPutImage -#define XMesaCopyArea XCopyArea - -#define XMesaCreatePixmap XCreatePixmap -#define XMesaFreePixmap XFreePixmap -#define XMesaFreeGC XFreeGC - -#define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size -#define GET_REDMASK(__v) __v->mesa_visual.redMask -#define GET_GREENMASK(__v) __v->mesa_visual.greenMask -#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask -#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth -#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen) -#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display) -#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True) - -#endif diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h deleted file mode 100644 index 10f93c3ab6..0000000000 --- a/include/GL/xmesa_xf86.h +++ /dev/null @@ -1,198 +0,0 @@ - -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - * When we're building the XMesa driver for use in the X server (as the - * indirect render) we include this file when building the xm_*.c files. - * We need to define some types and macros differently when building - * in the Xserver vs. stand-alone Mesa. - */ - -#ifndef _XMESA_XF86_H_ -#define _XMESA_XF86_H_ - -#include "GL/glxtokens.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "servermd.h" - - -typedef struct _XMesaImageRec { - int width, height; - char *data; - int bytes_per_line; /* Padded to 32 bits */ - int bits_per_pixel; -} XMesaImage; - -typedef ScreenRec XMesaDisplay; -typedef PixmapPtr XMesaPixmap; -typedef ColormapPtr XMesaColormap; -typedef DrawablePtr XMesaDrawable; -typedef WindowPtr XMesaWindow; -typedef GCPtr XMesaGC; -typedef VisualPtr XMesaVisualInfo; -typedef DDXPointRec XMesaPoint; -typedef xColorItem XMesaColor; - -#define XMesaSetGeneric(__d,__gc,__val,__mask) \ -do { \ - CARD32 __v[1]; \ - (void) __d; \ - __v[0] = __val; \ - dixChangeGC(NullClient, __gc, __mask, __v, NULL); \ -} while (0) - -#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \ -do { \ - ChangeGCVal __v[1]; \ - (void) __d; \ - __v[0].ptr = __pval; \ - dixChangeGC(NullClient, __gc, __mask, NULL, __v); \ -} while (0) - -#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground) -#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground) -#define XMesaSetPlaneMask(d,gc,v) XMesaSetGeneric(d,gc,v,GCPlaneMask) -#define XMesaSetFunction(d,gc,v) XMesaSetGeneric(d,gc,v,GCFunction) -#define XMesaSetFillStyle(d,gc,v) XMesaSetGeneric(d,gc,v,GCFillStyle) - -#define XMesaSetTile(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCTile) - -#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \ -do { \ - XMesaPoint __p[1]; \ - (void) __d; \ - __p[0].x = __x; \ - __p[0].y = __y; \ - ValidateGC(__b, __gc); \ - (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \ -} while (0) - -#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \ -do { \ - (void) __d; \ - ValidateGC(__b, __gc); \ - (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ -} while (0) - -#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \ -do { \ - XMesaPoint __p[2]; \ - (void) __d; \ - __p[0].x = __x0; \ - __p[0].y = __y0; \ - __p[1].x = __x1; \ - __p[1].y = __y1; \ - ValidateGC(__b, __gc); \ - (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \ -} while (0) - -#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ -do { \ - xRectangle __r[1]; \ - (void) __d; \ - ValidateGC((DrawablePtr)__b, __gc); \ - __r[0].x = __x; \ - __r[0].y = __y; \ - __r[0].width = __w; \ - __r[0].height = __h; \ - (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \ -} while (0) - -static _X_INLINE XMesaImage *XMesaGetImage(XMesaDisplay *dpy, PixmapPtr p, int x, - int y, unsigned int width, - unsigned int height, - unsigned long plane_mask, int format) -{ - XMesaImage *img = Xcalloc(sizeof(*img)); - - img->width = p->drawable.width; - img->height = p->drawable.height; - img->bits_per_pixel = p->drawable.bitsPerPixel; - img->bytes_per_line = PixmapBytePad(width, p->drawable.depth); - img->data = malloc(height * img->bytes_per_line); - - /* Assumes: Images are always in ZPixmap format */ - (*p->drawable.pScreen->GetImage)(&p->drawable, x, y, width, height, - plane_mask, ZPixmap, img->data); - - return img; -} - -#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ -do { \ - /* Assumes: Images are always in ZPixmap format */ \ - (void) __d; \ - ASSERT(!__sx && !__sy); /* The SubImage case */ \ - ValidateGC(__b, __gc); \ - (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ - __x, __y, __w, __h, 0, ZPixmap, \ - ((XMesaImage *)(__i))->data); \ -} while (0) - -#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \ -do { \ - (void) __d; \ - ValidateGC(__db, __gc); \ - (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \ - __sx, __sy, __w, __h, __x, __y); \ -} while (0) - - -/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ -#ifdef CREATE_PIXMAP_USAGE_SCRATCH -#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ - (*__d->CreatePixmap)(__d, __w, __h, __depth, 0) -#else -#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ - (*__d->CreatePixmap)(__d, __w, __h, __depth) -#endif - -#define XMesaFreePixmap(__d,__b) \ - (*__d->DestroyPixmap)(__b) - -#define XMesaFreeGC(__d,__gc) \ -do { \ - (void) __d; \ - FreeScratchGC(__gc); \ -} while (0) - -#define GET_COLORMAP_SIZE(__v) __v->ColormapEntries -#define GET_REDMASK(__v) __v->mesa_visual.redMask -#define GET_GREENMASK(__v) __v->mesa_visual.greenMask -#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask -#define GET_VISUAL_DEPTH(__v) __v->nplanes -#define GET_BLACK_PIXEL(__v) __v->display->blackPixel -#define CHECK_BYTE_ORDER(__v) GL_TRUE -#define CHECK_FOR_HPCR(__v) GL_FALSE - -#endif diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 827d39f995..ea3585258d 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -42,7 +42,6 @@ #include "glxheader.h" #include "glxapi.h" -#include "GL/xmesa.h" #include "main/context.h" #include "main/config.h" #include "main/macros.h" diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index c9009bad03..18aa8bcc09 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -63,7 +63,6 @@ #endif #include "glxheader.h" -#include "GL/xmesa.h" #include "xmesaP.h" #include "main/context.h" #include "main/extensions.h" diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index f104d44d05..7ad67bc34d 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -30,7 +30,6 @@ #include "glxheader.h" -#include "GL/xmesa.h" #include "xmesaP.h" #include "main/imports.h" #include "main/framebuffer.h" diff --git a/src/mesa/drivers/x11/xmesa.h b/src/mesa/drivers/x11/xmesa.h new file mode 100644 index 0000000000..98139af833 --- /dev/null +++ b/src/mesa/drivers/x11/xmesa.h @@ -0,0 +1,424 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2007 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. + */ + + +/* + * Mesa/X11 interface. This header file serves as the documentation for + * the Mesa/X11 interface functions. + * + * Note: this interface isn't intended for user programs. It's primarily + * just for implementing the pseudo-GLX interface. + */ + + +/* Sample Usage: + +In addition to the usual X calls to select a visual, create a colormap +and create a window, you must do the following to use the X/Mesa interface: + +1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo. + +2. Call XMesaCreateContext() to create an X/Mesa rendering context, given + the XMesaVisual. + +3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window + and XMesaVisual. + +4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and + to make the context the current one. + +5. Make gl* calls to render your graphics. + +6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers. + +7. Before the X window is destroyed, call XMesaDestroyBuffer(). + +8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext. + +*/ + + + + +#ifndef XMESA_H +#define XMESA_H + +#ifdef __VMS +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef XFree86Server +#include "xmesa_xf86.h" +#else +#include +#include +#include "xmesa_x.h" +#endif +#include "GL/gl.h" + +#ifdef AMIWIN +#include +extern struct Library *XLibBase; +#endif + + +#define XMESA_MAJOR_VERSION 6 +#define XMESA_MINOR_VERSION 3 + + + +/* + * Values passed to XMesaGetString: + */ +#define XMESA_VERSION 1 +#define XMESA_EXTENSIONS 2 + + +/* + * Values passed to XMesaSetFXmode: + */ +#define XMESA_FX_WINDOW 1 +#define XMESA_FX_FULLSCREEN 2 + + + +typedef struct xmesa_context *XMesaContext; + +typedef struct xmesa_visual *XMesaVisual; + +typedef struct xmesa_buffer *XMesaBuffer; + + + +/* + * Create a new X/Mesa visual. + * Input: display - X11 display + * visinfo - an XVisualInfo pointer + * rgb_flag - GL_TRUE = RGB mode, + * GL_FALSE = color index mode + * alpha_flag - alpha buffer requested? + * db_flag - GL_TRUE = double-buffered, + * GL_FALSE = single buffered + * stereo_flag - stereo visual? + * ximage_flag - GL_TRUE = use an XImage for back buffer, + * GL_FALSE = use an off-screen pixmap for back buffer + * depth_size - requested bits/depth values, or zero + * stencil_size - requested bits/stencil values, or zero + * accum_red_size - requested bits/red accum values, or zero + * accum_green_size - requested bits/green accum values, or zero + * accum_blue_size - requested bits/blue accum values, or zero + * accum_alpha_size - requested bits/alpha accum values, or zero + * num_samples - number of samples/pixel if multisampling, or zero + * level - visual level, usually 0 + * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT + * Return; a new XMesaVisual or 0 if error. + */ +extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, + XMesaVisualInfo visinfo, + GLboolean rgb_flag, + GLboolean alpha_flag, + GLboolean db_flag, + GLboolean stereo_flag, + GLboolean ximage_flag, + GLint depth_size, + GLint stencil_size, + GLint accum_red_size, + GLint accum_green_size, + GLint accum_blue_size, + GLint accum_alpha_size, + GLint num_samples, + GLint level, + GLint visualCaveat ); + +/* + * Destroy an XMesaVisual, but not the associated XVisualInfo. + */ +extern void XMesaDestroyVisual( XMesaVisual v ); + + + +/* + * Create a new XMesaContext for rendering into an X11 window. + * + * Input: visual - an XMesaVisual + * share_list - another XMesaContext with which to share display + * lists or NULL if no sharing is wanted. + * Return: an XMesaContext or NULL if error. + */ +extern XMesaContext XMesaCreateContext( XMesaVisual v, + XMesaContext share_list ); + + +/* + * Destroy a rendering context as returned by XMesaCreateContext() + */ +extern void XMesaDestroyContext( XMesaContext c ); + + +#ifdef XFree86Server +/* + * These are the extra routines required for integration with XFree86. + * None of these routines should be user visible. -KEM + */ +extern GLboolean XMesaForceCurrent( XMesaContext c ); + +extern GLboolean XMesaLoseCurrent( XMesaContext c ); + +extern GLboolean XMesaCopyContext( XMesaContext src, + XMesaContext dst, + GLuint mask ); +#endif /* XFree86Server */ + + +/* + * Create an XMesaBuffer from an X window. + */ +extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w ); + + +/* + * Create an XMesaBuffer from an X pixmap. + */ +extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, + XMesaPixmap p, + XMesaColormap cmap ); + + +/* + * Destroy an XMesaBuffer, but not the corresponding window or pixmap. + */ +extern void XMesaDestroyBuffer( XMesaBuffer b ); + + +/* + * Return the XMesaBuffer handle which corresponds to an X drawable, if any. + * + * New in Mesa 2.3. + */ +extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, + XMesaDrawable d ); + + + +/* + * Bind a buffer to a context and make the context the current one. + */ +extern GLboolean XMesaMakeCurrent( XMesaContext c, + XMesaBuffer b ); + + +/* + * Bind two buffers (read and draw) to a context and make the + * context the current one. + * New in Mesa 3.3 + */ +extern GLboolean XMesaMakeCurrent2( XMesaContext c, + XMesaBuffer drawBuffer, + XMesaBuffer readBuffer ); + + +/* + * Unbind the current context from its buffer. + */ +extern GLboolean XMesaUnbindContext( XMesaContext c ); + + +/* + * Return a handle to the current context. + */ +extern XMesaContext XMesaGetCurrentContext( void ); + + +/* + * Return handle to the current (draw) buffer. + */ +extern XMesaBuffer XMesaGetCurrentBuffer( void ); + + +/* + * Return handle to the current read buffer. + * New in Mesa 3.3 + */ +extern XMesaBuffer XMesaGetCurrentReadBuffer( void ); + + +/* + * Swap the front and back buffers for the given buffer. No action is + * taken if the buffer is not double buffered. + */ +extern void XMesaSwapBuffers( XMesaBuffer b ); + + +/* + * Copy a sub-region of the back buffer to the front buffer. + * + * New in Mesa 2.6 + */ +extern void XMesaCopySubBuffer( XMesaBuffer b, + int x, + int y, + int width, + int height ); + + +/* + * Return a pointer to the the Pixmap or XImage being used as the back + * color buffer of an XMesaBuffer. This function is a way to get "under + * the hood" of X/Mesa so one can manipulate the back buffer directly. + * Input: b - the XMesaBuffer + * Output: pixmap - pointer to back buffer's Pixmap, or 0 + * ximage - pointer to back buffer's XImage, or NULL + * Return: GL_TRUE = context is double buffered + * GL_FALSE = context is single buffered + */ +extern GLboolean XMesaGetBackBuffer( XMesaBuffer b, + XMesaPixmap *pixmap, + XMesaImage **ximage ); + + + +/* + * Return the depth buffer associated with an XMesaBuffer. + * Input: b - the XMesa buffer handle + * Output: width, height - size of buffer in pixels + * bytesPerValue - bytes per depth value (2 or 4) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 2.4. + */ +extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b, + GLint *width, + GLint *height, + GLint *bytesPerValue, + void **buffer ); + + + +/* + * Flush/sync a context + */ +extern void XMesaFlush( XMesaContext c ); + + + +/* + * Get an X/Mesa-specific string. + * Input: name - either XMESA_VERSION or XMESA_EXTENSIONS + */ +extern const char *XMesaGetString( XMesaContext c, int name ); + + + +/* + * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free + * any memory used by that buffer. + * + * New in Mesa 2.3. + */ +extern void XMesaGarbageCollect( void ); + + + +/* + * Return a dithered pixel value. + * Input: c - XMesaContext + * x, y - window coordinate + * red, green, blue, alpha - color components in [0,1] + * Return: pixel value + * + * New in Mesa 2.3. + */ +extern unsigned long XMesaDitherColor( XMesaContext xmesa, + GLint x, + GLint y, + GLfloat red, + GLfloat green, + GLfloat blue, + GLfloat alpha ); + + + +/* + * 3Dfx Glide driver only! + * Set 3Dfx/Glide full-screen or window rendering mode. + * Input: mode - either XMESA_FX_WINDOW (window rendering mode) or + * XMESA_FX_FULLSCREEN (full-screen rendering mode) + * Return: GL_TRUE if success + * GL_FALSE if invalid mode or if not using 3Dfx driver + * + * New in Mesa 2.6. + */ +extern GLboolean XMesaSetFXmode( GLint mode ); + + + +/* + * Reallocate the back/depth/stencil/accum/etc/ buffers associated with + * buffer if its size has changed. + * + * New in Mesa 4.0.2 + */ +extern void XMesaResizeBuffers( XMesaBuffer b ); + + + +/* + * Create a pbuffer. + * New in Mesa 4.1 + */ +extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, + unsigned int width, unsigned int height); + + + +/* + * Texture from Pixmap + * New in Mesa 7.1 + */ +extern void +XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, + const int *attrib_list); + +extern void +XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer); + + +extern XMesaBuffer +XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, + XMesaColormap cmap, + int format, int target, int mipmap); + + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 98867ac710..6a6c9ef600 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -27,7 +27,7 @@ #define XMESAP_H -#include "GL/xmesa.h" +#include "xmesa.h" #include "main/mtypes.h" #if defined(FX) #include "GL/fxmesa.h" diff --git a/src/mesa/drivers/x11/xmesa_x.h b/src/mesa/drivers/x11/xmesa_x.h new file mode 100644 index 0000000000..865bab4313 --- /dev/null +++ b/src/mesa/drivers/x11/xmesa_x.h @@ -0,0 +1,86 @@ + +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * + * When we're building the XMesa driver for stand-alone Mesa we + * include this file when building the xm_*.c files. + * We need to define some types and macros differently when building + * in the Xserver vs. stand-alone Mesa. + */ + +#ifndef _XMESA_X_H_ +#define _XMESA_X_H_ + +typedef Display XMesaDisplay; +typedef Pixmap XMesaPixmap; +typedef Colormap XMesaColormap; +typedef Drawable XMesaDrawable; +typedef Window XMesaWindow; +typedef GC XMesaGC; +typedef XVisualInfo *XMesaVisualInfo; +typedef XImage XMesaImage; +typedef XPoint XMesaPoint; +typedef XColor XMesaColor; + +#define XMesaDestroyImage XDestroyImage + +#define XMesaPutPixel XPutPixel +#define XMesaGetPixel XGetPixel + +#define XMesaSetForeground XSetForeground +#define XMesaSetBackground XSetBackground +#define XMesaSetPlaneMask XSetPlaneMask +#define XMesaSetFunction XSetFunction +#define XMesaSetFillStyle XSetFillStyle +#define XMesaSetTile XSetTile + +#define XMesaDrawPoint XDrawPoint +#define XMesaDrawPoints XDrawPoints +#define XMesaDrawLine XDrawLine +#define XMesaFillRectangle XFillRectangle +#define XMesaGetImage XGetImage +#define XMesaPutImage XPutImage +#define XMesaCopyArea XCopyArea + +#define XMesaCreatePixmap XCreatePixmap +#define XMesaFreePixmap XFreePixmap +#define XMesaFreeGC XFreeGC + +#define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size +#define GET_REDMASK(__v) __v->mesa_visual.redMask +#define GET_GREENMASK(__v) __v->mesa_visual.greenMask +#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask +#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth +#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen) +#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display) +#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True) + +#endif diff --git a/src/mesa/drivers/x11/xmesa_xf86.h b/src/mesa/drivers/x11/xmesa_xf86.h new file mode 100644 index 0000000000..10f93c3ab6 --- /dev/null +++ b/src/mesa/drivers/x11/xmesa_xf86.h @@ -0,0 +1,198 @@ + +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * + * When we're building the XMesa driver for use in the X server (as the + * indirect render) we include this file when building the xm_*.c files. + * We need to define some types and macros differently when building + * in the Xserver vs. stand-alone Mesa. + */ + +#ifndef _XMESA_XF86_H_ +#define _XMESA_XF86_H_ + +#include "GL/glxtokens.h" +#include "scrnintstr.h" +#include "pixmapstr.h" +#include "gcstruct.h" +#include "servermd.h" + + +typedef struct _XMesaImageRec { + int width, height; + char *data; + int bytes_per_line; /* Padded to 32 bits */ + int bits_per_pixel; +} XMesaImage; + +typedef ScreenRec XMesaDisplay; +typedef PixmapPtr XMesaPixmap; +typedef ColormapPtr XMesaColormap; +typedef DrawablePtr XMesaDrawable; +typedef WindowPtr XMesaWindow; +typedef GCPtr XMesaGC; +typedef VisualPtr XMesaVisualInfo; +typedef DDXPointRec XMesaPoint; +typedef xColorItem XMesaColor; + +#define XMesaSetGeneric(__d,__gc,__val,__mask) \ +do { \ + CARD32 __v[1]; \ + (void) __d; \ + __v[0] = __val; \ + dixChangeGC(NullClient, __gc, __mask, __v, NULL); \ +} while (0) + +#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \ +do { \ + ChangeGCVal __v[1]; \ + (void) __d; \ + __v[0].ptr = __pval; \ + dixChangeGC(NullClient, __gc, __mask, NULL, __v); \ +} while (0) + +#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground) +#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground) +#define XMesaSetPlaneMask(d,gc,v) XMesaSetGeneric(d,gc,v,GCPlaneMask) +#define XMesaSetFunction(d,gc,v) XMesaSetGeneric(d,gc,v,GCFunction) +#define XMesaSetFillStyle(d,gc,v) XMesaSetGeneric(d,gc,v,GCFillStyle) + +#define XMesaSetTile(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCTile) + +#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \ +do { \ + XMesaPoint __p[1]; \ + (void) __d; \ + __p[0].x = __x; \ + __p[0].y = __y; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \ +} while (0) + +#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \ +do { \ + (void) __d; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ +} while (0) + +#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \ +do { \ + XMesaPoint __p[2]; \ + (void) __d; \ + __p[0].x = __x0; \ + __p[0].y = __y0; \ + __p[1].x = __x1; \ + __p[1].y = __y1; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \ +} while (0) + +#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ +do { \ + xRectangle __r[1]; \ + (void) __d; \ + ValidateGC((DrawablePtr)__b, __gc); \ + __r[0].x = __x; \ + __r[0].y = __y; \ + __r[0].width = __w; \ + __r[0].height = __h; \ + (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \ +} while (0) + +static _X_INLINE XMesaImage *XMesaGetImage(XMesaDisplay *dpy, PixmapPtr p, int x, + int y, unsigned int width, + unsigned int height, + unsigned long plane_mask, int format) +{ + XMesaImage *img = Xcalloc(sizeof(*img)); + + img->width = p->drawable.width; + img->height = p->drawable.height; + img->bits_per_pixel = p->drawable.bitsPerPixel; + img->bytes_per_line = PixmapBytePad(width, p->drawable.depth); + img->data = malloc(height * img->bytes_per_line); + + /* Assumes: Images are always in ZPixmap format */ + (*p->drawable.pScreen->GetImage)(&p->drawable, x, y, width, height, + plane_mask, ZPixmap, img->data); + + return img; +} + +#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ +do { \ + /* Assumes: Images are always in ZPixmap format */ \ + (void) __d; \ + ASSERT(!__sx && !__sy); /* The SubImage case */ \ + ValidateGC(__b, __gc); \ + (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ + __x, __y, __w, __h, 0, ZPixmap, \ + ((XMesaImage *)(__i))->data); \ +} while (0) + +#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \ +do { \ + (void) __d; \ + ValidateGC(__db, __gc); \ + (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \ + __sx, __sy, __w, __h, __x, __y); \ +} while (0) + + +/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ +#ifdef CREATE_PIXMAP_USAGE_SCRATCH +#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ + (*__d->CreatePixmap)(__d, __w, __h, __depth, 0) +#else +#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ + (*__d->CreatePixmap)(__d, __w, __h, __depth) +#endif + +#define XMesaFreePixmap(__d,__b) \ + (*__d->DestroyPixmap)(__b) + +#define XMesaFreeGC(__d,__gc) \ +do { \ + (void) __d; \ + FreeScratchGC(__gc); \ +} while (0) + +#define GET_COLORMAP_SIZE(__v) __v->ColormapEntries +#define GET_REDMASK(__v) __v->mesa_visual.redMask +#define GET_GREENMASK(__v) __v->mesa_visual.greenMask +#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask +#define GET_VISUAL_DEPTH(__v) __v->nplanes +#define GET_BLACK_PIXEL(__v) __v->display->blackPixel +#define CHECK_BYTE_ORDER(__v) GL_TRUE +#define CHECK_FOR_HPCR(__v) GL_FALSE + +#endif -- cgit v1.2.3 From d25cc16efa356a92f61f0b4836bcbd0b4cb606d2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 12:00:27 -0700 Subject: mesa: remove the ancient include/GL/ugl*.h headers --- include/GL/uglglutshapes.h | 45 ------------- include/GL/uglmesa.h | 155 --------------------------------------------- 2 files changed, 200 deletions(-) delete mode 100644 include/GL/uglglutshapes.h delete mode 100644 include/GL/uglmesa.h (limited to 'include') diff --git a/include/GL/uglglutshapes.h b/include/GL/uglglutshapes.h deleted file mode 100644 index 28192de2d5..0000000000 --- a/include/GL/uglglutshapes.h +++ /dev/null @@ -1,45 +0,0 @@ -/* uglglutshapes.h - Public header GLUT Shapes */ - -/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ - -/* This program is freely distributable without licensing fees and is - provided without guarantee or warrantee expressed or implied. This - program is -not- in the public domain. */ - -#ifndef GLUTSHAPES_H -#define GLUTSHAPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -void glutWireSphere (GLdouble radius, GLint slices, GLint stacks); -void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks); -void glutWireCone (GLdouble base, GLdouble height, - GLint slices, GLint stacks); -void glutSolidCone (GLdouble base, GLdouble height, - GLint slices, GLint stacks); -void glutWireCube (GLdouble size); -void glutSolidCube (GLdouble size); -void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, - GLint sides, GLint rings); -void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, - GLint sides, GLint rings); -void glutWireDodecahedron (void); -void glutSolidDodecahedron (void); -void glutWireOctahedron (void); -void glutSolidOctahedron (void); -void glutWireTetrahedron (void); -void glutSolidTetrahedron (void); -void glutWireIcosahedron (void); -void glutSolidIcosahedron (void); -void glutWireTeapot (GLdouble size); -void glutSolidTeapot (GLdouble size); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/GL/uglmesa.h b/include/GL/uglmesa.h deleted file mode 100644 index 7ef5843504..0000000000 --- a/include/GL/uglmesa.h +++ /dev/null @@ -1,155 +0,0 @@ -/* uglmesa.h - Public header UGL/Mesa */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * The MIT License - * 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 - * THE AUTHORS OR COPYRIGHT 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. - */ - -/* - * Author: - * Stephane Raimbault - */ - -#ifndef UGLMESA_H -#define UGLMESA_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define UGL_MESA_MAJOR_VERSION 4 -#define UGL_MESA_MINOR_VERSION 0 - -#include -#include - -/* - * Values for display mode of uglMesaCreateContext () - */ - -/* - * With these mask values, it's possible to test double buffer mode - * with UGL_MESA_DOUBLE mask - * - * SINGLE 0000 0001 - * DOUBLE 0000 0110 - * - SOFT 0000 0010 - * - HARD 0000 0100 - * WINDML 0001 0000 - * - * - */ -#define UGL_MESA_SINGLE 0x01 -#define UGL_MESA_DOUBLE 0x06 -#define UGL_MESA_DOUBLE_SOFTWARE 0x02 -#define UGL_MESA_DOUBLE_HARDWARE 0x04 - -#define UGL_MESA_WINDML_EXCLUSIVE 0x10 - -#define UGL_MESA_FULLSCREEN_WIDTH 0x0 -#define UGL_MESA_FULLSCREEN_HEIGHT 0x0 - -/* - * uglMesaPixelStore() parameters: - */ - -#define UGL_MESA_ROW_LENGTH 0x20 -#define UGL_MESA_Y_UP 0x21 - -/* - * Accepted by uglMesaGetIntegerv: - */ - -#define UGL_MESA_LEFT_X 0x01 -#define UGL_MESA_TOP_Y 0x02 -#define UGL_MESA_WIDTH 0x03 -#define UGL_MESA_HEIGHT 0x04 -#define UGL_MESA_DISPLAY_WIDTH 0x05 -#define UGL_MESA_DISPLAY_HEIGHT 0x06 -#define UGL_MESA_COLOR_FORMAT 0x07 -#define UGL_MESA_COLOR_MODEL 0x08 -#define UGL_MESA_PIXEL_FORMAT 0x09 -#define UGL_MESA_TYPE 0x0A -#define UGL_MESA_RGB 0x0B -#define UGL_MESA_COLOR_INDEXED 0x0C -#define UGL_MESA_SINGLE_BUFFER 0x0D -#define UGL_MESA_DOUBLE_BUFFER 0x0E -#define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F -#define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10 - -/* - * typedefs - */ - -typedef struct uglMesaContext * UGL_MESA_CONTEXT; - -UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode, - UGL_MESA_CONTEXT share_list); - -UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum mode, - GLint depth_bits, - GLint stencil_bits, - GLint accum_red_bits, - GLint accum_green_bits, - GLint accum_blue_bits, - GLint accum_alpha_bits, - UGL_MESA_CONTEXT share_list); - -GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc, - GLsizei left, GLsizei top, - GLsizei width, GLsizei height); - -GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy); - -GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top); - -GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh); - -GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height); - -void uglMesaDestroyContext (void); - -UGL_MESA_CONTEXT uglMesaGetCurrentContext (void); - -void uglMesaSwapBuffers (void); - -void uglMesaPixelStore (GLint pname, GLint value); - -void uglMesaGetIntegerv (GLint pname, GLint *value); - -GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height, - GLint *bytesPerValue, void **buffer); - -GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height, - GLint *format, void **buffer); - -GLboolean uglMesaSetColor (GLubyte index, GLfloat red, - GLfloat green, GLfloat blue); - -#ifdef __cplusplus -} -#endif - - -#endif -- cgit v1.2.3 From f5979b0c159d1d3839caf86072639f5d96a5b0b5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 12:01:40 -0700 Subject: mesa: deprecate the GL/fxmesa.h header --- include/GL/fxmesa.h | 103 ------------------------------------------ src/mesa/drivers/x11/fxmesa.h | 103 ++++++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/x11/xmesaP.h | 2 +- 3 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 include/GL/fxmesa.h create mode 100644 src/mesa/drivers/x11/fxmesa.h (limited to 'include') diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h deleted file mode 100644 index f8e9661f9c..0000000000 --- a/include/GL/fxmesa.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-2001 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli - * - * NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide) - */ - - -#ifndef FXMESA_H -#define FXMESA_H - - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -#define FXMESA_MAJOR_VERSION 6 -#define FXMESA_MINOR_VERSION 3 - - -/* - * Values for attribList parameter to fxMesaCreateContext(): - */ -#define FXMESA_NONE 0 /* to terminate attribList */ -#define FXMESA_DOUBLEBUFFER 10 -#define FXMESA_ALPHA_SIZE 11 /* followed by an integer */ -#define FXMESA_DEPTH_SIZE 12 /* followed by an integer */ -#define FXMESA_STENCIL_SIZE 13 /* followed by an integer */ -#define FXMESA_ACCUM_SIZE 14 /* followed by an integer */ -#define FXMESA_COLORDEPTH 20 /* followed by an integer */ -#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */ - - - -typedef struct tfxMesaContext *fxMesaContext; - - -#if defined (__BEOS__) -#pragma export on -#endif - - -GLAPI fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, GrScreenResolution_t, - GrScreenRefresh_t, - const GLint attribList[]); - -GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win, - GLint width, GLint height, - const GLint attribList[]); -GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx); - -GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n); - -GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); - -GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void); - -GLAPI void GLAPIENTRY fxMesaSwapBuffers(void); - -GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal); - -GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx); - -GLAPI void GLAPIENTRY fxCloseHardware(void); - -GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h); - - -#if defined (__BEOS__) -#pragma export off -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/src/mesa/drivers/x11/fxmesa.h b/src/mesa/drivers/x11/fxmesa.h new file mode 100644 index 0000000000..f8e9661f9c --- /dev/null +++ b/src/mesa/drivers/x11/fxmesa.h @@ -0,0 +1,103 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-2001 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli + * + * NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide) + */ + + +#ifndef FXMESA_H +#define FXMESA_H + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define FXMESA_MAJOR_VERSION 6 +#define FXMESA_MINOR_VERSION 3 + + +/* + * Values for attribList parameter to fxMesaCreateContext(): + */ +#define FXMESA_NONE 0 /* to terminate attribList */ +#define FXMESA_DOUBLEBUFFER 10 +#define FXMESA_ALPHA_SIZE 11 /* followed by an integer */ +#define FXMESA_DEPTH_SIZE 12 /* followed by an integer */ +#define FXMESA_STENCIL_SIZE 13 /* followed by an integer */ +#define FXMESA_ACCUM_SIZE 14 /* followed by an integer */ +#define FXMESA_COLORDEPTH 20 /* followed by an integer */ +#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */ + + + +typedef struct tfxMesaContext *fxMesaContext; + + +#if defined (__BEOS__) +#pragma export on +#endif + + +GLAPI fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, GrScreenResolution_t, + GrScreenRefresh_t, + const GLint attribList[]); + +GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win, + GLint width, GLint height, + const GLint attribList[]); +GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx); + +GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n); + +GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); + +GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void); + +GLAPI void GLAPIENTRY fxMesaSwapBuffers(void); + +GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal); + +GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx); + +GLAPI void GLAPIENTRY fxCloseHardware(void); + +GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h); + + +#if defined (__BEOS__) +#pragma export off +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 6a6c9ef600..65e747d7b9 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -30,7 +30,7 @@ #include "xmesa.h" #include "main/mtypes.h" #if defined(FX) -#include "GL/fxmesa.h" +#include "fxmesa.h" #include "xm_glide.h" #endif #ifdef XFree86Server -- cgit v1.2.3 From 287102ddcc72ae19f7e6b912205805c5e78771f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 12:04:39 -0700 Subject: mesa: deprecate GL/amesa.h header (allegro driver) --- include/GL/amesa.h | 65 ---------------------------------------- src/mesa/drivers/allegro/amesa.c | 2 +- src/mesa/drivers/allegro/amesa.h | 65 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 include/GL/amesa.h create mode 100644 src/mesa/drivers/allegro/amesa.h (limited to 'include') diff --git a/include/GL/amesa.h b/include/GL/amesa.h deleted file mode 100644 index 852d34cf4f..0000000000 --- a/include/GL/amesa.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - - -/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ - - -#ifndef AMESA_H -#define AMESA_H - - -#define AMESA_MAJOR_VERSION 3 -#define AMESA_MINOR_VERSION 3 - - -typedef struct amesa_visual *AMesaVisual; -typedef struct amesa_buffer *AMesaBuffer; -typedef struct amesa_context *AMesaContext; - - -extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, - GLint depthSize, - GLint stencilSize, - GLint accumSize); - -extern void AMesaDestroyVisual(AMesaVisual visual); - -extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, - GLint width, GLint height); - -extern void AMesaDestroyBuffer(AMesaBuffer buffer); - - -extern AMesaContext AMesaCreateContext(AMesaVisual visual, - AMesaContext sharelist); - -extern void AMesaDestroyContext(AMesaContext context); - -extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer); - -extern void AMesaSwapBuffers(AMesaBuffer buffer); - - -#endif /* AMESA_H */ diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index ade6251848..a9d8f62f92 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -26,7 +26,7 @@ #include "main/imports.h" #include "main/matrix.h" #include "main/mtypes.h" -#include "GL/amesa.h" +#include "amesa.h" struct amesa_visual diff --git a/src/mesa/drivers/allegro/amesa.h b/src/mesa/drivers/allegro/amesa.h new file mode 100644 index 0000000000..852d34cf4f --- /dev/null +++ b/src/mesa/drivers/allegro/amesa.h @@ -0,0 +1,65 @@ +/* + * 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. + */ + + +/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ + + +#ifndef AMESA_H +#define AMESA_H + + +#define AMESA_MAJOR_VERSION 3 +#define AMESA_MINOR_VERSION 3 + + +typedef struct amesa_visual *AMesaVisual; +typedef struct amesa_buffer *AMesaBuffer; +typedef struct amesa_context *AMesaContext; + + +extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, + GLint depthSize, + GLint stencilSize, + GLint accumSize); + +extern void AMesaDestroyVisual(AMesaVisual visual); + +extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, + GLint width, GLint height); + +extern void AMesaDestroyBuffer(AMesaBuffer buffer); + + +extern AMesaContext AMesaCreateContext(AMesaVisual visual, + AMesaContext sharelist); + +extern void AMesaDestroyContext(AMesaContext context); + +extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer); + +extern void AMesaSwapBuffers(AMesaBuffer buffer); + + +#endif /* AMESA_H */ -- cgit v1.2.3 From c3a00a728b15a13a33a38c8687ed6732c98d2260 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 12:06:29 -0700 Subject: mesa: remove deprecated headers from Makefile.am --- include/GL/Makefile.am | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 199bd5c8f3..ca528f606d 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -2,17 +2,12 @@ GLincludedir = $(includedir)/GL -INC_FX = fxmesa.h INC_GGI = ggimesa.h INC_OSMESA = osmesa.h INC_SVGA = svgamesa.h -INC_X11 = glx.h glxext.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h +INC_X11 = glx.h glxext.h glx_mangle.h INC_GLUT = glut.h glutf90.h -if HAVE_FX -sel_inc_fx = $(INC_FX) -endif - if HAVE_GGI sel_inc_ggi = $(INC_GGI) endif @@ -35,9 +30,9 @@ endif EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ vms_x_fix.h wmesa.h \ - $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) + $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ - $(sel_inc_fx) $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ + $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ $(sel_inc_x11) $(sel_inc_glut) include $(top_srcdir)/common_rules.make -- cgit v1.2.3 From ef193c10e7b3f048abf5fce0d7dc4d72d94ba123 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Jan 2009 12:07:58 -0700 Subject: mesa: remove old GLView.h header for BeOS --- include/GLView.h | 192 ------------------------------------------------------- 1 file changed, 192 deletions(-) delete mode 100644 include/GLView.h (limited to 'include') diff --git a/include/GLView.h b/include/GLView.h deleted file mode 100644 index 8d9d25bb1c..0000000000 --- a/include/GLView.h +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* -/ -/ File: GLView.h -/ -/ Copyright 1993-98, Be Incorporated, All Rights Reserved. -/ -*******************************************************************************/ - -#ifndef BGLVIEW_H -#define BGLVIEW_H - -#include - -#define BGL_RGB 0 -#define BGL_INDEX 1 -#define BGL_SINGLE 0 -#define BGL_DOUBLE 2 -#define BGL_DIRECT 0 -#define BGL_INDIRECT 4 -#define BGL_ACCUM 8 -#define BGL_ALPHA 16 -#define BGL_DEPTH 32 -#define BGL_OVERLAY 64 -#define BGL_UNDERLAY 128 -#define BGL_STENCIL 512 - -#ifdef __cplusplus - - -#include -#include -#include -#include -#include -#include - -class BGLView : public BView { -public: - - BGLView(BRect rect, char *name, - ulong resizingMode, ulong mode, - ulong options); -virtual ~BGLView(); - - void LockGL(); - void UnlockGL(); - void SwapBuffers(); - void SwapBuffers( bool vSync ); - BView * EmbeddedView(); - status_t CopyPixelsOut(BPoint source, BBitmap *dest); - status_t CopyPixelsIn(BBitmap *source, BPoint dest); -virtual void ErrorCallback(unsigned long errorCode); // Mesa's GLenum is uint where Be's ones was ulong! - -virtual void Draw(BRect updateRect); - -virtual void AttachedToWindow(); -virtual void AllAttached(); -virtual void DetachedFromWindow(); -virtual void AllDetached(); - -virtual void FrameResized(float width, float height); -virtual status_t Perform(perform_code d, void *arg); - - /* The public methods below, for the moment, - are just pass-throughs to BView */ - -virtual status_t Archive(BMessage *data, bool deep = true) const; - -virtual void MessageReceived(BMessage *msg); -virtual void SetResizingMode(uint32 mode); - -virtual void Show(); -virtual void Hide(); - -virtual BHandler *ResolveSpecifier(BMessage *msg, int32 index, - BMessage *specifier, int32 form, - const char *property); -virtual status_t GetSupportedSuites(BMessage *data); - -/* New public functions */ - void DirectConnected( direct_buffer_info *info ); - void EnableDirectMode( bool enabled ); - - void * getGC() { return m_gc; } - -private: - -virtual void _ReservedGLView1(); -virtual void _ReservedGLView2(); -virtual void _ReservedGLView3(); -virtual void _ReservedGLView4(); -virtual void _ReservedGLView5(); -virtual void _ReservedGLView6(); -virtual void _ReservedGLView7(); -virtual void _ReservedGLView8(); - - BGLView(const BGLView &); - BGLView &operator=(const BGLView &); - - void dither_front(); - bool confirm_dither(); - void draw(BRect r); - - void * m_gc; - uint32 m_options; - uint32 m_ditherCount; - BLocker m_drawLock; - BLocker m_displayLock; - void * m_clip_info; - void * _Unused1; - - BBitmap * m_ditherMap; - BRect m_bounds; - int16 * m_errorBuffer[2]; - uint64 _reserved[8]; - - /* Direct Window stuff */ -private: - void drawScanline( int x1, int x2, int y, void *data ); -static void scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2); - - void lock_draw(); - void unlock_draw(); - bool validateView(); -}; - - - -class BGLScreen : public BWindowScreen { -public: - BGLScreen(char *name, - ulong screenMode, ulong options, - status_t *error, bool debug=false); - ~BGLScreen(); - - void LockGL(); - void UnlockGL(); - void SwapBuffers(); - virtual void ErrorCallback(GLenum errorCode); - - virtual void ScreenConnected(bool connected); - virtual void FrameResized(float width, float height); - virtual status_t Perform(perform_code d, void *arg); - - /* The public methods below, for the moment, - are just pass-throughs to BWindowScreen */ - - virtual status_t Archive(BMessage *data, bool deep = true) const; - virtual void MessageReceived(BMessage *msg); - - virtual void Show(); - virtual void Hide(); - - virtual BHandler *ResolveSpecifier(BMessage *msg, - int32 index, - BMessage *specifier, - int32 form, - const char *property); - virtual status_t GetSupportedSuites(BMessage *data); - -private: - - virtual void _ReservedGLScreen1(); - virtual void _ReservedGLScreen2(); - virtual void _ReservedGLScreen3(); - virtual void _ReservedGLScreen4(); - virtual void _ReservedGLScreen5(); - virtual void _ReservedGLScreen6(); - virtual void _ReservedGLScreen7(); - virtual void _ReservedGLScreen8(); - - BGLScreen(const BGLScreen &); - BGLScreen &operator=(const BGLScreen &); - - void * m_gc; - long m_options; - BLocker m_drawLock; - - int32 m_colorSpace; - uint32 m_screen_mode; - - uint64 _reserved[7]; -}; - -#endif // __cplusplus - -#endif // BGLVIEW_H - - - - - -- cgit v1.2.3