diff include/SDL_video.h @ 292:eadc0746dfaf

Added SDL_LockRect() and SDL_UnlockRect() Incorporated XFree86 extension libraries into the source
author Sam Lantinga <slouken@libsdl.org>
date Tue, 05 Mar 2002 19:55:32 +0000
parents b8688cfdc232
children fab1ddc4d7bf
line wrap: on
line diff
--- a/include/SDL_video.h	Sat Mar 02 16:50:35 2002 +0000
+++ b/include/SDL_video.h	Tue Mar 05 19:55:32 2002 +0000
@@ -532,6 +532,26 @@
 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.
  * Returns the new surface, or NULL if there was an error.