Skip to content
Permalink
Browse files

Added SDL_LockRect() and SDL_UnlockRect()

 Incorporated XFree86 extension libraries into the source
  • Loading branch information
slouken committed Mar 5, 2002
1 parent 0448ba7 commit bbf4b4c81f57a632e7731cf9765838d2748d40ab
Showing with 8,402 additions and 206 deletions.
  1. +1 −1 Makefile.am
  2. +6 −0 WhatsNew
  3. +91 −99 configure.in
  4. +2 −0 docs.html
  5. +20 −0 include/SDL_video.h
  6. +4 −0 src/main/beos/exports/SDL.exp
  7. +3 −0 src/main/macos/exports/SDL.x
  8. +2 −0 src/main/macosx/exports/SDL.x
  9. +3 −0 src/main/win32/exports/SDL.def
  10. +1 −1 src/video/Makefile.am
  11. +102 −0 src/video/SDL_surface.c
  12. +2 −0 src/video/SDL_sysvideo.h
  13. +1 −1 src/video/SDL_yuv_sw.c
  14. +4 −0 src/video/Xext/Makefile.am
  15. +9 −0 src/video/Xext/README
  16. +5 −0 src/video/Xext/Xinerama/Makefile.am
  17. +319 −0 src/video/Xext/Xinerama/Xinerama.c
  18. +5 −0 src/video/Xext/Xv/Makefile.am
  19. +1,152 −0 src/video/Xext/Xv/Xv.c
  20. +76 −0 src/video/Xext/Xv/Xvlibint.h
  21. +5 −0 src/video/Xext/Xxf86dga/Makefile.am
  22. +716 −0 src/video/Xext/Xxf86dga/XF86DGA.c
  23. +987 −0 src/video/Xext/Xxf86dga/XF86DGA2.c
  24. +5 −0 src/video/Xext/Xxf86vm/Makefile.am
  25. +1,210 −0 src/video/Xext/Xxf86vm/XF86VMode.c
  26. +16 −0 src/video/Xext/extensions/Makefile.am
  27. +8 −0 src/video/Xext/extensions/SDLname.h
  28. +46 −0 src/video/Xext/extensions/Xinerama.h
  29. +129 −0 src/video/Xext/extensions/Xv.h
  30. +433 −0 src/video/Xext/extensions/Xvlib.h
  31. +604 −0 src/video/Xext/extensions/Xvproto.h
  32. +224 −0 src/video/Xext/extensions/extutil.h
  33. +52 −0 src/video/Xext/extensions/panoramiXext.h
  34. +192 −0 src/video/Xext/extensions/panoramiXproto.h
  35. +265 −0 src/video/Xext/extensions/xf86dga.h
  36. +169 −0 src/video/Xext/extensions/xf86dga1.h
  37. +194 −0 src/video/Xext/extensions/xf86dga1str.h
  38. +344 −0 src/video/Xext/extensions/xf86dgastr.h
  39. +314 −0 src/video/Xext/extensions/xf86vmode.h
  40. +546 −0 src/video/Xext/extensions/xf86vmstr.h
  41. +3 −3 src/video/dga/SDL_dgaevents.c
  42. +35 −35 src/video/dga/SDL_dgavideo.c
  43. +40 −0 src/video/windx5/SDL_dx5video.c
  44. +6 −6 src/video/x11/SDL_x11dga.c
  45. +4 −4 src/video/x11/SDL_x11gamma.c
  46. +29 −29 src/video/x11/SDL_x11modes.c
  47. +3 −8 src/video/x11/SDL_x11video.h
  48. +14 −14 src/video/x11/SDL_x11yuv.c
  49. +1 −5 test/configure.in
@@ -45,7 +45,7 @@ EXTRA_DIST = \
EpocBuildFiles.zip \
WhatsNew \
docs.html \
sdl.m4 \
sdl.m4 \
SDL.spec \
autogen.sh \
strip_fPIC.sh
@@ -3,6 +3,12 @@ This is a list of API changes in SDL's version history.

Version 1.0:

1.2.4:
Added SDL_LockRect() and SDL_UnlockRect() to lock a portion of a
surface. This may be more efficient than a full lock if you are
using a hardware surface and plan to make a few changes to small
areas in the surface.

1.2.0:
Added SDL_VIDEOEXPOSE event to signal that the screen needs to
be redrawn. This is currently only delivered to OpenGL windows
@@ -372,7 +372,7 @@ dnl See if the NAS audio interface is supported
CheckNAS()
{
AC_ARG_ENABLE(nas,
[ --enable-nas support the NAS audio API [default=yes]],
[ --enable-nas support the NAS audio API [default=yes]],
, enable_nas=yes)
if test x$enable_audio = xyes -a x$enable_nas = xyes; then
AC_MSG_CHECKING(for NAS audio support)
@@ -394,7 +394,7 @@ dnl rcg07142001 See if the user wants the disk writer audio driver...
CheckDiskAudio()
{
AC_ARG_ENABLE(diskaudio,
[ --enable-diskaudio support the disk writer audio driver [default=yes]],
[ --enable-diskaudio support the disk writer audio driver [default=yes]],
, enable_diskaudio=yes)
if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
@@ -445,44 +445,44 @@ CheckNASM()
dnl Find the nanox include and library directories
CheckNANOX()
{
AC_ARG_ENABLE(video-nanox,
[ --enable-video-nanox use nanox video driver [default=no]],
, enable_video_nanox=no)
AC_ARG_ENABLE(nanox-debug,
[ --enable-nanox-debug print debug messages [default=no]],
, enable_nanox_debug=no)
AC_ARG_ENABLE(nanox-share-memory,
[ --enable-nanox-share-memory use share memory [default=no]],
, enable_nanox_share_memory=no)

AC_ARG_WITH(nanox_pixel_type,
[ --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])

if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
if test x$enable_nanox_debug = xyes; then
CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
fi

if test x$enable_nanox_share_memory = xyes; then
CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
fi

case "$with_nanox_pixel_type" in
rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888" ;;
565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565" ;;
555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555" ;;
332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332" ;;
pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL" ;;
*) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
esac

CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
fi
AC_ARG_ENABLE(video-nanox,
[ --enable-video-nanox use nanox video driver [default=no]],
, enable_video_nanox=no)
AC_ARG_ENABLE(nanox-debug,
[ --enable-nanox-debug print debug messages [default=no]],
, enable_nanox_debug=no)
AC_ARG_ENABLE(nanox-share-memory,
[ --enable-nanox-share-memory use share memory [default=no]],
, enable_nanox_share_memory=no)

AC_ARG_WITH(nanox_pixel_type,
[ --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])

if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
if test x$enable_nanox_debug = xyes; then
CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
fi

if test x$enable_nanox_share_memory = xyes; then
CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
fi

case "$with_nanox_pixel_type" in
rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888" ;;
565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565" ;;
555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555" ;;
332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332" ;;
pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL" ;;
*) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
esac

CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
fi
}

dnl Find the X11 include and library directories
@@ -495,7 +495,7 @@ CheckX11()
AC_PATH_X
AC_PATH_XTRA
if test x$have_x = xyes; then
CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11"
CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -Isrc/video"
if test x$ac_cv_func_shmat != xyes; then
CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
fi
@@ -511,42 +511,23 @@ CheckX11()
video_x11_vm=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#include <XFree86/extensions/xf86vmode.h>
],[
],[
video_x11_vm=yes
])
AC_MSG_RESULT($video_x11_vm)
if test x$video_x11_vm = xyes; then
CFLAGS="$CFLAGS -DXFREE86_VM"
# Check for nasty XFree86 4.0/Glide hack
AC_ARG_ENABLE(xfree86_glidehack,
[ --enable-xfree86-glidehack Alternate vidmode lib for old Glide [default=no]],
, enable_xfreeglidehack=no)
if test x$enable_xfree86_glidehack = xyes; then
ac_save_libs="$LIBS"
LIBS="$LIBS $X_LIBS -lX11 -lXext"
if test x$xfree86_glidehack = x; then
AC_CHECK_LIB(Xxf86vm, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm)
fi
if test x$xfree86_glidehack = x; then
AC_CHECK_LIB(Xxf86vm40, XF40VidModeQueryExtension, xfree86_glidehack=Xxf86vm40)
fi
LIBS="$ac_save_libs"
fi
if test x$xfree86_glidehack != x; then
CFLAGS="$CFLAGS -DXFREE86_VM_DYNAMIC_HACK"
SYSTEM_LIBS="$SYSTEM_LIBS -l$xfree86_glidehack"
else
SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86vm"
fi
VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
AC_MSG_CHECKING(for XFree86 VidMode gamma support)
video_x11_vmgamma=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#include <XFree86/extensions/xf86vmode.h>
],[
XF86VidModeGamma gamma;
SDL_NAME(XF86VidModeGamma) gamma;
],[
video_x11_vmgamma=yes
])
@@ -567,7 +548,7 @@ CheckX11()
video_x11_dga=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
#include <XFree86/extensions/xf86dga.h>
],[
],[
video_x11_dga=yes
@@ -578,7 +559,8 @@ CheckX11()
if test x$enable_video_x11_dgamouse = xyes; then
CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
fi
SYSTEM_LIBS="$SYSTEM_LIBS -lXxf86dga"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
fi
fi
AC_ARG_ENABLE(video-x11-xv,
@@ -592,16 +574,17 @@ CheckX11()
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xvlib.h>
#include <XFree86/extensions/Xvlib.h>
],[
XvImage *image;
SDL_NAME(XvImage) *image;
],[
video_x11_xv=yes
])
AC_MSG_RESULT($video_x11_xv)
if test x$video_x11_xv = xyes; then
CFLAGS="$CFLAGS -DXFREE86_XV"
SYSTEM_LIBS="$SYSTEM_LIBS -lXv"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
fi
fi
AC_ARG_ENABLE(video-x11-xinerama,
@@ -612,16 +595,17 @@ CheckX11()
video_x11_xinerama=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <XFree86/extensions/Xinerama.h>
],[
XineramaScreenInfo *xinerama;
SDL_NAME(XineramaScreenInfo) *xinerama;
],[
video_x11_xinerama=yes
])
AC_MSG_RESULT($video_x11_xinerama)
if test x$video_x11_xinerama = xyes; then
CFLAGS="$CFLAGS -DHAVE_XINERAMA"
SYSTEM_LIBS="$SYSTEM_LIBS -lXinerama"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
fi
fi
AC_ARG_ENABLE(video-x11-xme,
@@ -648,6 +632,33 @@ CheckX11()
fi
}

dnl Find the X11 DGA 2.0 include and library directories
CheckDGA()
{
AC_ARG_ENABLE(video-dga,
[ --enable-video-dga use DGA 2.0 video driver [default=yes]],
, enable_video_dga=yes)
if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
video_x11_dga2=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <XFree86/extensions/xf86dga.h>
],[
SDL_NAME(XDGAEvent) xevent;
],[
video_x11_dga2=yes
])
AC_MSG_RESULT($video_x11_dga2)
if test x$video_x11_dga2 = xyes; then
CFLAGS="$CFLAGS -DENABLE_DGA"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
fi
fi
}

CheckPHOTON()
{
AC_ARG_ENABLE(video-photon,
@@ -677,32 +688,6 @@ CheckPHOTON()
fi
}

dnl Find the X11 DGA 2.0 include and library directories
CheckDGA()
{
AC_ARG_ENABLE(video-dga,
[ --enable-video-dga use DGA 2.0 video driver [default=yes]],
, enable_video_dga=yes)
if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
video_x11_dga2=no
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
],[
XDGAEvent xevent;
],[
video_x11_dga2=yes
])
AC_MSG_RESULT($video_x11_dga2)
if test x$video_x11_dga2 = xyes; then
CFLAGS="$CFLAGS -DENABLE_DGA"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
fi
fi
}

dnl Find the framebuffer console includes
CheckFBCON()
{
@@ -2335,6 +2320,7 @@ CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
@@ -2391,6 +2377,12 @@ src/audio/windib/Makefile
src/audio/windx5/Makefile
src/audio/disk/Makefile
src/video/Makefile
src/video/XFree86/Makefile
src/video/XFree86/extensions/Makefile
src/video/XFree86/Xinerama/Makefile
src/video/XFree86/Xv/Makefile
src/video/XFree86/Xxf86dga/Makefile
src/video/XFree86/Xxf86vm/Makefile
src/video/cybergfx/Makefile
src/video/x11/Makefile
src/video/dga/Makefile
@@ -16,6 +16,8 @@ <H2>
Major changes since SDL 1.0.0:
</H2>
<UL>
<LI> 1.2.4: Added SDL_LockRect() and SDL_UnlockRect()
<LI> 1.2.4: Incorporated XFree86 extension libraries into the source
<LI> 1.2.4: Added initial support for Atari (thanks Patrice!)
<LI> 1.2.4: Added support for joysticks on *BSD (thanks Wilbern!)
<LI> 1.2.4: Added a YUV overlay test program (thanks Jon!)
@@ -531,6 +531,26 @@ extern DECLSPEC void SDL_FreeSurface(SDL_Surface *surface);
extern DECLSPEC int SDL_LockSurface(SDL_Surface *surface);
extern DECLSPEC void SDL_UnlockSurface(SDL_Surface *surface);

/*
* SDL_LockRect() locks a portion of the surface designated by the 'rect'
* parameter, and saves the resulting pixels and pitch in the arguments.
* The rect will be clipped if it extends beyond the bounds of the surface
*
* This may be more efficient than a full lock if you are using a hardware
* surface and plan to make a few changes to small areas in the surface.
*
* While a rectangle is locked, no other lock or blit call may be called
* on the surface. No operating system or library calls should be made
* between lock/unlock pairs, as critical system locks may be held during
* this time.
*
* After the surface is unlocked, the pixels pointer is no longer valid.
*
* SDL_LockRect() returns 0, or -1 if the surface couldn't be locked.
*/
extern DECLSPEC int SDL_LockRect(SDL_Surface *surface, SDL_Rect *rect, void **pixels, int *pitch);
extern DECLSPEC void SDL_UnlockRect(SDL_Surface *surface);

/*
* Load a surface from a seekable SDL data source (memory or file.)
* If 'freesrc' is non-zero, the source will be closed after being read.
@@ -74,6 +74,7 @@ _SDL_GetKeyState
_SDL_GetModState
_SDL_SetModState
_SDL_GetKeyName
_SDL_SetModuleHandle
_SDL_RegisterApp
_SDL_InitQuickDraw
_SDL_GetMouseState
@@ -143,6 +144,8 @@ _SDL_CreateRGBSurfaceFrom
_SDL_FreeSurface
_SDL_LockSurface
_SDL_UnlockSurface
_SDL_LockRect
_SDL_UnlockRect
_SDL_LoadBMP_RW
_SDL_SaveBMP_RW
_SDL_SetColorKey
@@ -174,3 +177,4 @@ _SDL_WM_SetIcon
_SDL_WM_IconifyWindow
_SDL_WM_ToggleFullScreen
_SDL_WM_GrabInput
_SDL_SoftStretch

0 comments on commit bbf4b4c

Please sign in to comment.