Commit 36c39dd5 authored by Sam Lantinga's avatar Sam Lantinga

Updated for DirectFB 0.9.9

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40287
parent ef355146
...@@ -748,7 +748,7 @@ CheckDirectFB() ...@@ -748,7 +748,7 @@ CheckDirectFB()
AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.]) AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
fi fi
DIRECTFB_REQUIRED_VERSION=0.9.8 DIRECTFB_REQUIRED_VERSION=0.9.9
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb` DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
......
...@@ -56,7 +56,8 @@ void DirectFB_PumpEvents (_THIS) ...@@ -56,7 +56,8 @@ void DirectFB_PumpEvents (_THIS)
{ {
DFBInputEvent evt; DFBInputEvent evt;
while (HIDDEN->inputbuffer->GetEvent (HIDDEN->inputbuffer, &evt) == DFB_OK) while (HIDDEN->eventbuffer->GetEvent (HIDDEN->eventbuffer,
DFB_EVENT (&evt)) == DFB_OK)
{ {
SDL_keysym keysym; SDL_keysym keysym;
......
...@@ -304,7 +304,7 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -304,7 +304,7 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat)
DFBCardCapabilities caps; DFBCardCapabilities caps;
IDirectFBDisplayLayer *layer; IDirectFBDisplayLayer *layer;
DFBDisplayLayerConfig dlc; DFBDisplayLayerConfig dlc;
IDirectFBInputBuffer *inputbuffer; IDirectFBEventBuffer *eventbuffer;
ret = DirectFBInit (NULL, NULL); ret = DirectFBInit (NULL, NULL);
...@@ -329,11 +329,10 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -329,11 +329,10 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat)
return -1; return -1;
} }
ret = dfb->CreateInputBuffer (dfb, DICAPS_BUTTONS | DICAPS_AXIS | DICAPS_KEYS, ret = dfb->CreateEventBuffer (dfb, DICAPS_ALL, &eventbuffer);
&inputbuffer);
if (ret) if (ret)
{ {
SetDirectFBerror ("dfb->CreateInputBuffer", ret); SetDirectFBerror ("dfb->CreateEventBuffer", ret);
layer->Release (layer); layer->Release (layer);
dfb->Release (dfb); dfb->Release (dfb);
return -1; return -1;
...@@ -395,7 +394,7 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -395,7 +394,7 @@ int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat)
HIDDEN->initialized = 1; HIDDEN->initialized = 1;
HIDDEN->dfb = dfb; HIDDEN->dfb = dfb;
HIDDEN->layer = layer; HIDDEN->layer = layer;
HIDDEN->inputbuffer = inputbuffer; HIDDEN->eventbuffer = eventbuffer;
return 0; return 0;
} }
...@@ -691,34 +690,48 @@ static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects) ...@@ -691,34 +690,48 @@ static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects) static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects)
{ {
DFBRegion region;
int i;
int region_valid = 0;
IDirectFBSurface *surface = this->screen->hwdata->surface; IDirectFBSurface *surface = this->screen->hwdata->surface;
DFBRegion region = { rects->x, rects->y,
rects->x + rects->w - 1,
rects->y + rects->h - 1 };
while (--numrects) for (i=0; i<numrects; ++i)
{ {
int x2, y2; int x2, y2;
rects++; if ( ! rects[i].w ) /* Clipped? */
continue;
if (rects->x < region.x1) x2 = rects[i].x + rects[i].w - 1;
region.x1 = rects->x; y2 = rects[i].y + rects[i].h - 1;
if (rects->y < region.y1) if (region_valid)
region.y1 = rects->y; {
if (rects[i].x < region.x1)
region.x1 = rects[i].x;
x2 = rects->x + rects->w - 1; if (rects[i].y < region.y1)
y2 = rects->y + rects->h - 1; region.y1 = rects[i].y;
if (x2 > region.x2) if (x2 > region.x2)
region.x2 = x2; region.x2 = x2;
if (y2 > region.y2) if (y2 > region.y2)
region.y2 = y2; region.y2 = y2;
}
else
{
region.x1 = rects[i].x;
region.y1 = rects[i].y;
region.x2 = x2;
region.y2 = y2;
region_valid = 1;
}
} }
surface->Flip (surface, &region, DSFLIP_WAITFORSYNC); if (region_valid)
surface->Flip (surface, &region, DSFLIP_WAITFORSYNC);
} }
int DirectFB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) int DirectFB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
...@@ -731,7 +744,7 @@ void DirectFB_VideoQuit(_THIS) ...@@ -731,7 +744,7 @@ void DirectFB_VideoQuit(_THIS)
{ {
int i, j; int i, j;
HIDDEN->inputbuffer->Release (HIDDEN->inputbuffer); HIDDEN->eventbuffer->Release (HIDDEN->eventbuffer);
HIDDEN->layer->Release (HIDDEN->layer); HIDDEN->layer->Release (HIDDEN->layer);
HIDDEN->dfb->Release (HIDDEN->dfb); HIDDEN->dfb->Release (HIDDEN->dfb);
......
...@@ -43,7 +43,7 @@ struct SDL_PrivateVideoData ...@@ -43,7 +43,7 @@ struct SDL_PrivateVideoData
IDirectFB *dfb; IDirectFB *dfb;
IDirectFBDisplayLayer *layer; IDirectFBDisplayLayer *layer;
IDirectFBInputBuffer *inputbuffer; IDirectFBEventBuffer *eventbuffer;
#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */ #define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
int SDL_nummodes[NUM_MODELISTS]; int SDL_nummodes[NUM_MODELISTS];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment