* visualCaveat - ala the GLX extension, usually GLX_NONE_EXT
* Return; a new XMesaVisual or 0 if error.
*/
-extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
- XMesaVisualInfo visinfo,
+extern XMesaVisual XMesaCreateVisual( Display *display,
+ XVisualInfo * visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
/*
* Create an XMesaBuffer from an X window.
*/
-extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w );
+extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, Window w );
/*
* Create an XMesaBuffer from an X pixmap.
*/
extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
- XMesaPixmap p,
- XMesaColormap cmap );
+ Pixmap p,
+ Colormap cmap );
/*
*
* New in Mesa 2.3.
*/
-extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy,
- XMesaDrawable d );
+extern XMesaBuffer XMesaFindBuffer( Display *dpy,
+ Drawable d );
* GL_FALSE = context is single buffered
*/
extern GLboolean XMesaGetBackBuffer( XMesaBuffer b,
- XMesaPixmap *pixmap,
- XMesaImage **ximage );
+ Pixmap *pixmap,
+ XImage **ximage );
* Create a pbuffer.
* New in Mesa 4.1
*/
-extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
+extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, Colormap cmap,
unsigned int width, unsigned int height);
* New in Mesa 7.1
*/
extern void
-XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer,
+XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
const int *attrib_list);
extern void
-XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer);
+XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer);
extern XMesaBuffer
-XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p,
- XMesaColormap cmap,
+XMesaCreatePixmapTextureBuffer(XMesaVisual v, Pixmap p,
+ Colormap cmap,
int format, int target, int mipmap);
* 1 = shared XImage support available
* 2 = shared Pixmap support available also
*/
-int xmesa_check_for_xshm( XMesaDisplay *display )
+int xmesa_check_for_xshm( Display *display )
{
#if defined(USE_XSHM)
int major, minor, ignore;
static int
bits_per_pixel( XMesaVisual xmv )
{
- XMesaDisplay *dpy = xmv->display;
- XMesaVisualInfo visinfo = xmv->visinfo;
- XMesaImage *img;
+ Display *dpy = xmv->display;
+ XVisualInfo * visinfo = xmv->visinfo;
+ XImage *img;
int bitsPerPixel;
/* Create a temporary XImage */
img = XCreateImage( dpy, visinfo->visual, visinfo->depth,
*/
static GLboolean WindowExistsFlag;
-static int window_exists_err_handler( XMesaDisplay* dpy, XErrorEvent* xerr )
+static int window_exists_err_handler( Display* dpy, XErrorEvent* xerr )
{
(void) dpy;
if (xerr->error_code == BadWindow) {
return 0;
}
-static GLboolean window_exists( XMesaDisplay *dpy, Window win )
+static GLboolean window_exists( Display *dpy, Window win )
{
XWindowAttributes wa;
- int (*old_handler)( XMesaDisplay*, XErrorEvent* );
+ int (*old_handler)( Display*, XErrorEvent* );
WindowExistsFlag = GL_TRUE;
old_handler = XSetErrorHandler(window_exists_err_handler);
XGetWindowAttributes( dpy, win, &wa ); /* dummy request */
}
static Status
-get_drawable_size( XMesaDisplay *dpy, Drawable d, uint *width, uint *height )
+get_drawable_size( Display *dpy, Drawable d, uint *width, uint *height )
{
Window root;
Status stat;
* \param height returns height in pixels
*/
static void
-xmesa_get_window_size(XMesaDisplay *dpy, XMesaBuffer b,
+xmesa_get_window_size(Display *dpy, XMesaBuffer b,
GLuint *width, GLuint *height)
{
Status stat;
* \return new XMesaBuffer or NULL if any problem
*/
static XMesaBuffer
-create_xmesa_buffer(XMesaDrawable d, BufferType type,
- XMesaVisual vis, XMesaColormap cmap)
+create_xmesa_buffer(Drawable d, BufferType type,
+ XMesaVisual vis, Colormap cmap)
{
XMesaBuffer b;
GLframebuffer *fb;
* the notThis buffer.
*/
XMesaBuffer
-xmesa_find_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis)
+xmesa_find_buffer(Display *dpy, Colormap cmap, XMesaBuffer notThis)
{
XMesaBuffer b;
for (b = XMesaBufferList; b; b = b->Next) {
*/
static GLboolean
initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
- GLboolean rgb_flag, XMesaDrawable window,
- XMesaColormap cmap)
+ GLboolean rgb_flag, Drawable window,
+ Colormap cmap)
{
ASSERT(!b || b->xm_visual == v);
* Return; a new XMesaVisual or 0 if error.
*/
PUBLIC
-XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
- XMesaVisualInfo visinfo,
+XMesaVisual XMesaCreateVisual( Display *display,
+ XVisualInfo * visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
* \return new XMesaBuffer or NULL if error
*/
PUBLIC XMesaBuffer
-XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
+XMesaCreateWindowBuffer(XMesaVisual v, Window w)
{
XWindowAttributes attr;
XMesaBuffer b;
- XMesaColormap cmap;
+ Colormap cmap;
int depth;
assert(v);
cmap = XCreateColormap(v->display, w, attr.visual, AllocNone);
}
- b = create_xmesa_buffer((XMesaDrawable) w, WINDOW, v, cmap);
+ b = create_xmesa_buffer((Drawable) w, WINDOW, v, cmap);
if (!b)
return NULL;
if (!initialize_visual_and_buffer( v, b, v->mesa_visual.rgbMode,
- (XMesaDrawable) w, cmap )) {
+ (Drawable) w, cmap )) {
xmesa_free_buffer(b);
return NULL;
}
* \returns new XMesaBuffer or NULL if error
*/
PUBLIC XMesaBuffer
-XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap)
+XMesaCreatePixmapBuffer(XMesaVisual v, Pixmap p, Colormap cmap)
{
XMesaBuffer b;
assert(v);
- b = create_xmesa_buffer((XMesaDrawable) p, PIXMAP, v, cmap);
+ b = create_xmesa_buffer((Drawable) p, PIXMAP, v, cmap);
if (!b)
return NULL;
if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode,
- (XMesaDrawable) p, cmap)) {
+ (Drawable) p, cmap)) {
xmesa_free_buffer(b);
return NULL;
}
* For GLX_EXT_texture_from_pixmap
*/
XMesaBuffer
-XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p,
- XMesaColormap cmap,
+XMesaCreatePixmapTextureBuffer(XMesaVisual v, Pixmap p,
+ Colormap cmap,
int format, int target, int mipmap)
{
GET_CURRENT_CONTEXT(ctx);
assert(v);
- b = create_xmesa_buffer((XMesaDrawable) p, PIXMAP, v, cmap);
+ b = create_xmesa_buffer((Drawable) p, PIXMAP, v, cmap);
if (!b)
return NULL;
b->TextureMipmap = mipmap;
if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode,
- (XMesaDrawable) p, cmap)) {
+ (Drawable) p, cmap)) {
xmesa_free_buffer(b);
return NULL;
}
XMesaBuffer
-XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap,
+XMesaCreatePBuffer(XMesaVisual v, Colormap cmap,
unsigned int width, unsigned int height)
{
- XMesaWindow root;
- XMesaDrawable drawable; /* X Pixmap Drawable */
+ Window root;
+ Drawable drawable; /* X Pixmap Drawable */
XMesaBuffer b;
/* allocate pixmap for front buffer */
-XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, XMesaDrawable d )
+XMesaBuffer XMesaFindBuffer( Display *dpy, Drawable d )
{
XMesaBuffer b;
for (b=XMesaBufferList; b; b=b->Next) {
/**
* Free/destroy all XMesaBuffers associated with given display.
*/
-void xmesa_destroy_buffers_on_display(XMesaDisplay *dpy)
+void xmesa_destroy_buffers_on_display(Display *dpy)
{
XMesaBuffer b, next;
for (b = XMesaBufferList; b; b = next) {
PUBLIC void
-XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer,
+XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
const int *attrib_list)
{
}
PUBLIC void
-XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer)
+XMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer)
{
}
*/
struct xmesa_visual {
GLvisual mesa_visual; /* Device independent visual parameters */
- XMesaDisplay *display; /* The X11 display */
- XMesaVisualInfo visinfo; /* X's visual info (pointer to private copy) */
+ Display *display; /* The X11 display */
+ XVisualInfo * visinfo; /* X's visual info (pointer to private copy) */
XVisualInfo *vishandle; /* Only used in fakeglx.c */
GLint BitsPerPixel; /* True bits per pixel for XImages */
GLboolean wasCurrent; /* was ever the current buffer? */
XMesaVisual xm_visual; /* the X/Mesa visual */
- XMesaDrawable drawable; /* Usually the X window ID */
- XMesaColormap cmap; /* the X colormap */
+ Drawable drawable; /* Usually the X window ID */
+ Colormap cmap; /* the X colormap */
BufferType type; /* window, pixmap, pbuffer or glxwindow */
- XMesaImage *tempImage;
+ XImage *tempImage;
unsigned long selectedEvents;/* for pbuffers only */
GLuint shm; /* X Shared Memory extension status: */
XShmSegmentInfo shminfo;
#endif
- XMesaGC gc; /* scratch GC for span, line, tri drawing */
+ GC gc; /* scratch GC for span, line, tri drawing */
/* GLX_EXT_texture_from_pixmap */
GLint TextureTarget; /** GLX_TEXTURE_1D_EXT, for example */
xmesa_delete_framebuffer(struct gl_framebuffer *fb);
extern XMesaBuffer
-xmesa_find_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis);
+xmesa_find_buffer(Display *dpy, Colormap cmap, XMesaBuffer notThis);
extern void
xmesa_check_and_update_buffer_size(XMesaContext xmctx, XMesaBuffer drawBuffer);
extern void
-xmesa_destroy_buffers_on_display(XMesaDisplay *dpy);
+xmesa_destroy_buffers_on_display(Display *dpy);
static INLINE GLuint
xmesa_buffer_width(XMesaBuffer b)
}
extern int
-xmesa_check_for_xshm(XMesaDisplay *display);
+xmesa_check_for_xshm(Display *display);
#endif