Added DFB_VERSION_ATLEAST macro
First attempt at replacing MakeSubSurface for pre 1.2.0 ==> Scaling not yet working --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403499
This commit is contained in:
parent
4907b7e608
commit
eeeee88591
5 changed files with 39 additions and 18 deletions
|
@ -48,7 +48,7 @@ static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button);
|
|||
static void
|
||||
DirectFB_SetContext(_THIS, SDL_WindowID id)
|
||||
{
|
||||
#if (DIRECTFB_MAJOR_VERSION >= 1)
|
||||
#if (DFB_VERSION_ATLEAST(1,0,0))
|
||||
/* FIXME: does not work on 1.0/1.2 with radeon driver
|
||||
* the approach did work with the matrox driver
|
||||
* This has simply no effect.
|
||||
|
|
|
@ -335,7 +335,7 @@ DirectFB_InitModes(_THIS)
|
|||
display.current_mode = mode;
|
||||
display.driverdata = dispdata;
|
||||
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
dlc.flags =
|
||||
DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT |
|
||||
DLCONF_OPTIONS;
|
||||
|
@ -438,7 +438,7 @@ DirectFB_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
|
|||
SDL_DFB_DEBUG("Trace\n");
|
||||
config.flags &= ~fail;
|
||||
SDL_DFB_CHECKERR(data->layer->SetConfiguration(data->layer, &config));
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
/* Need to call this twice ! */
|
||||
SDL_DFB_CHECKERR(data->layer->SetConfiguration(data->layer, &config));
|
||||
#endif
|
||||
|
|
|
@ -140,7 +140,7 @@ typedef struct
|
|||
IDirectFBPalette *palette;
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DirtyRectList dirty;
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
DFBSurfaceRenderOptions render_options;
|
||||
#endif
|
||||
} DirectFB_TextureData;
|
||||
|
@ -387,7 +387,7 @@ SDLToDFBPixelFormat(Uint32 format)
|
|||
case SDL_PIXELFORMAT_INDEX4MSB:
|
||||
return DSPF_UNKNOWN;
|
||||
case SDL_PIXELFORMAT_RGB444:
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
return DSPF_RGB444;
|
||||
#else
|
||||
return DSPF_UNKNOWN;
|
||||
|
@ -543,7 +543,7 @@ DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
}
|
||||
|
||||
}
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
data->render_options = DSRO_NONE;
|
||||
#endif
|
||||
|
||||
|
@ -673,7 +673,7 @@ DirectFB_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
static int
|
||||
DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
|
||||
DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
|
||||
|
||||
|
@ -847,7 +847,7 @@ DirectFB_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
|
|||
|
||||
PrepareDraw(renderer);
|
||||
/* Use antialiasing when available */
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
SDL_DFB_CHECKERR(data->surface->SetRenderOptions(data->surface,
|
||||
DSRO_ANTIALIAS));
|
||||
#endif
|
||||
|
@ -961,7 +961,7 @@ DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
data->blitFlags
|
||||
| flags));
|
||||
|
||||
#if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
|
||||
#if (DFB_VERSION_ATLEAST(1,2,0))
|
||||
SDL_DFB_CHECKERR(data->surface->SetRenderOptions(data->surface,
|
||||
texturedata->
|
||||
render_options));
|
||||
|
|
|
@ -34,13 +34,20 @@
|
|||
#define DEBUG 0
|
||||
#define LOG_CHANNEL stdout
|
||||
|
||||
#if (DIRECTFB_MAJOR_VERSION < 1)
|
||||
#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
|
||||
#endif
|
||||
#define DFB_VERSIONNUM(X, Y, Z) \
|
||||
((X)*1000 + (Y)*100 + (Z))
|
||||
|
||||
#if (DIRECTFB_MAJOR_VERSION >= 1) && (DIRECTFB_MINOR_VERSION >= 0) && (DIRECTFB_MICRO_VERSION >= 0 )
|
||||
#define SDL_DIRECTFB_OPENGL 1
|
||||
#include <directfbgl.h>
|
||||
#define DFB_COMPILEDVERSION \
|
||||
DFB_VERSIONNUM(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
|
||||
|
||||
#define DFB_VERSION_ATLEAST(X, Y, Z) \
|
||||
(DFB_COMPILEDVERSION >= DFB_VERSIONNUM(X, Y, Z))
|
||||
|
||||
#if (DFB_VERSION_ATLEAST(1,0,0))
|
||||
#define SDL_DIRECTFB_OPENGL 1
|
||||
#include <directfbgl.h>
|
||||
#else
|
||||
#error "SDL_DIRECTFB: Please compile against libdirectfb version >= 1.0.0"
|
||||
#endif
|
||||
|
||||
#if SDL_DIRECTFB_OPENGL
|
||||
|
|
|
@ -420,14 +420,28 @@ DirectFB_AdjustWindowSurface(SDL_Window * window)
|
|||
}
|
||||
|
||||
if (adjust) {
|
||||
SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
|
||||
#if DFB_VERSION_ATLEAST(1,2,0)
|
||||
SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
|
||||
windata->size.w,
|
||||
windata->size.h));
|
||||
SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
|
||||
SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
|
||||
windata->
|
||||
window_surface,
|
||||
&windata->client));
|
||||
DirectFB_WM_RedrawLayout(window);
|
||||
#else
|
||||
/* recreate subsurface */
|
||||
windata->surface->ReleaseSource(windata->surface);
|
||||
windata->window_surface->ReleaseSource(windata->window_surface);
|
||||
SDL_DFB_RELEASE(windata->surface);
|
||||
windata->surface = NULL;
|
||||
SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window,
|
||||
windata->size.w,
|
||||
windata->size.h));
|
||||
SDL_DFB_CHECKERR(windata->window_surface->
|
||||
GetSubSurface(windata->window_surface, &windata->client,
|
||||
&windata->surface));
|
||||
#endif
|
||||
DirectFB_WM_RedrawLayout(window);
|
||||
}
|
||||
error:
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue