SDL improvements.

Patch by Cedric BAIL (with minor changes).


SVN revision: 31815
This commit is contained in:
Gustavo Sverzut Barbieri 2007-09-26 14:00:14 +00:00
parent fe14d210b5
commit 7468078e12
3 changed files with 29 additions and 6 deletions

View File

@ -597,18 +597,29 @@ AC_ARG_ENABLE(ecore-evas-sdl,
]
)
if test "x$want_ecore_evas_sdl" = "xyes"; then
sdl_cflags=`$SDL_CONFIG --cflags`
sdl_libs=`$SDL_CONFIG --libs`
save_CFLAGS=$CFLAGS
CFLAGS=$CFLAGS" $sdl_cflags"
echo $CFLAGS
AC_CHECK_HEADER(Evas_Engine_SDL.h,
[
AC_DEFINE(BUILD_ECORE_EVAS_SDL, 1, [Support for SDL in Ecore_Evas])
have_ecore_evas_sdl="yes"
sdl_cflags=`$SDL_CONFIG --cflags`
sdl_libs=`$SDL_CONFIG --libs`
], [
dummy=no
], [
#include <Evas.h>
]
)
CFLAGS=$save_CFLAGS
fi
if test "x$have_ecore_evas_sdl" = "xyes"; then
PKG_CHECK_MODULES(SDL, sdl >= 1.3.0,
[ AC_DEFINE(BUILD_ECORE_EVAS_SDL_130, 1, [Support for SVN SDL]) ],
[ dummy=no ]);
fi
AC_SUBST(sdl_cflags)

View File

@ -41,7 +41,7 @@ ECORE_WIN32_LDF =
endif
if BUILD_ECORE_SDL
ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl
ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl @sdl_cflags@
ECORE_SDL_LIB = $(top_builddir)/src/lib/ecore_sdl/libecore_sdl.la
ECORE_SDL_LDF = -L$(top_builddir)/src/lib/ecore_sdl/.libs
else
@ -95,6 +95,7 @@ $(ECORE_WIN32_LIB) \
$(ECORE_SDL_LIB) \
$(top_builddir)/src/lib/ecore/libecore.la \
@EVAS_LIBS@ \
@sdl_libs@ \
@XCB_LIBS@ \
@create_shared_lib@

View File

@ -130,7 +130,6 @@ evas_engine_sdl_output_free (void *data)
if (re->update_rects)
free(re->update_rects);
memset(re, sizeof (Render_Engine), 0);
free(re);
evas_common_font_shutdown();
@ -176,6 +175,8 @@ evas_engine_sdl_output_resize (void *data, int w, int h)
exit(-1);
}
SDL_FillRect(re->surface, NULL, 0);
/* Destroy the copy */
evas_cache_engine_image_drop(eim);
}
@ -217,8 +218,9 @@ evas_engine_sdl_output_redraws_next_update_get (void *data,
int *x, int *y, int *w, int *h,
int *cx, int *cy, int *cw, int *ch)
{
Render_Engine* re = (Render_Engine*) data;
Tilebuf_Rect* tb_rect = NULL;
Render_Engine* re = (Render_Engine*) data;
Tilebuf_Rect* tb_rect;
SDL_Rect rect;
if (re->end)
{
@ -246,6 +248,13 @@ evas_engine_sdl_output_redraws_next_update_get (void *data,
re->end = 1;
}
rect.x = *x;
rect.y = *y;
rect.w = *w;
rect.h = *h;
SDL_FillRect(re->surface, &rect, 0);
/* Return the "fake" surface so it is passed to the drawing routines. */
return re->rgba_engine_image;
}
@ -830,6 +839,8 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe, int alpha, int hw
exit(-1);
}
SDL_FillRect(re->surface->pixels, NULL, 0);
re->alpha = alpha;
re->hwsurface = hwsurface;
re->fullscreen = fullscreen;