Mercurial > sdl-ios-xcode
diff src/video/dga/SDL_dgavideo.c @ 1575:3ba88cb7eb1b
Updated dynamic X11 code. See details in Bugzilla #170.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 22 Mar 2006 05:00:59 +0000 |
parents | 8d9bb0cf2c2a |
children | 14717b52abc0 45669d4efd02 |
line wrap: on
line diff
--- a/src/video/dga/SDL_dgavideo.c Wed Mar 22 04:51:44 2006 +0000 +++ b/src/video/dga/SDL_dgavideo.c Wed Mar 22 05:00:59 2006 +0000 @@ -73,9 +73,9 @@ and the DGA 2.0+ extension is available, and we can map mem. */ if ( SDL_X11_LoadSymbols() ) { - if ( (SDL_strncmp(pXDisplayName(display), ":", 1) == 0) || - (SDL_strncmp(pXDisplayName(display), "unix:", 5) == 0) ) { - dpy = pXOpenDisplay(display); + if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) || + (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) { + dpy = XOpenDisplay(display); if ( dpy ) { int events, errors, major, minor; @@ -90,7 +90,7 @@ SDL_NAME(XDGACloseFramebuffer)(dpy, screen); } } - pXCloseDisplay(dpy); + XCloseDisplay(dpy); } } SDL_X11_UnloadSymbols(); @@ -329,7 +329,7 @@ /* Open the X11 display */ display = NULL; /* Get it from DISPLAY environment variable */ - DGA_Display = pXOpenDisplay(display); + DGA_Display = XOpenDisplay(display); if ( DGA_Display == NULL ) { SDL_SetError("Couldn't open X11 display"); return(-1); @@ -339,12 +339,12 @@ if ( ! SDL_NAME(XDGAQueryExtension)(DGA_Display, &event_base, &error_base) || ! SDL_NAME(XDGAQueryVersion)(DGA_Display, &major_version, &minor_version) ) { SDL_SetError("DGA extension not available"); - pXCloseDisplay(DGA_Display); + XCloseDisplay(DGA_Display); return(-1); } if ( major_version < 2 ) { SDL_SetError("DGA driver requires DGA 2.0 or newer"); - pXCloseDisplay(DGA_Display); + XCloseDisplay(DGA_Display); return(-1); } DGA_event_base = event_base; @@ -360,10 +360,10 @@ int i, num_formats; vformat->BitsPerPixel = DefaultDepth(DGA_Display, DGA_Screen); - pix_format = pXListPixmapFormats(DGA_Display, &num_formats); + pix_format = XListPixmapFormats(DGA_Display, &num_formats); if ( pix_format == NULL ) { SDL_SetError("Couldn't determine screen formats"); - pXCloseDisplay(DGA_Display); + XCloseDisplay(DGA_Display); return(-1); } for ( i=0; i<num_formats; ++i ) { @@ -372,7 +372,7 @@ } if ( i != num_formats ) vformat->BitsPerPixel = pix_format[i].bits_per_pixel; - pXFree((char *)pix_format); + XFree((char *)pix_format); } if ( vformat->BitsPerPixel > 8 ) { vformat->Rmask = visual->red_mask; @@ -383,7 +383,7 @@ /* Open access to the framebuffer */ if ( ! SDL_NAME(XDGAOpenFramebuffer)(DGA_Display, DGA_Screen) ) { SDL_SetError("Unable to map the video memory"); - pXCloseDisplay(DGA_Display); + XCloseDisplay(DGA_Display); return(-1); } @@ -403,7 +403,7 @@ } } UpdateHWInfo(this, modes); - pXFree(modes); + XFree(modes); /* Create the hardware surface lock mutex */ hw_lock = SDL_CreateMutex(); @@ -442,7 +442,7 @@ /* Free any previous colormap */ if ( DGA_colormap ) { - pXFreeColormap(DGA_Display, DGA_colormap); + XFreeColormap(DGA_Display, DGA_colormap); DGA_colormap = 0; } @@ -473,7 +473,7 @@ /* Set the video mode */ mode = SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, modes[i].num); - pXFree(modes); + XFree(modes); if ( mode == NULL ) { SDL_SetError("Unable to switch to requested mode"); return(NULL); @@ -821,7 +821,7 @@ #endif SDL_NAME(XDGAFillRectangle)(DGA_Display, DGA_Screen, x, y, w, h, color); if ( !(this->screen->flags & SDL_DOUBLEBUF) ) { - pXFlush(DGA_Display); + XFlush(DGA_Display); } DGA_AddBusySurface(dst); UNLOCK_DISPLAY(); @@ -863,7 +863,7 @@ srcx, srcy, w, h, dstx, dsty); } if ( !(this->screen->flags & SDL_DOUBLEBUF) ) { - pXFlush(DGA_Display); + XFlush(DGA_Display); } DGA_AddBusySurface(src); DGA_AddBusySurface(dst); @@ -943,7 +943,7 @@ DGA_WaitFlip(this); SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen, 0, flip_yoffset[flip_page], XDGAFlipRetrace); - pXFlush(DGA_Display); + XFlush(DGA_Display); UNLOCK_DISPLAY(); was_flipped = 1; flip_page = !flip_page; @@ -976,8 +976,8 @@ xcmap[i].flags = (DoRed|DoGreen|DoBlue); } LOCK_DISPLAY(); - pXStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors); - pXSync(DGA_Display, False); + XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors); + XSync(DGA_Display, False); UNLOCK_DISPLAY(); SDL_stack_free(xcmap); @@ -1011,8 +1011,8 @@ xcmap[i].flags = (DoRed|DoGreen|DoBlue); } LOCK_DISPLAY(); - pXStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors); - pXSync(DGA_Display, False); + XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors); + XSync(DGA_Display, False); UNLOCK_DISPLAY(); return(0); } @@ -1024,7 +1024,7 @@ if ( DGA_Display ) { /* Free colormap, if necessary */ if ( DGA_colormap ) { - pXFreeColormap(DGA_Display, DGA_colormap); + XFreeColormap(DGA_Display, DGA_colormap); DGA_colormap = 0; } @@ -1064,6 +1064,6 @@ DGA_FreeHWSurfaces(this); /* Close up the display */ - pXCloseDisplay(DGA_Display); + XCloseDisplay(DGA_Display); } }