Add support for OpenGL SDL

SVN revision: 45732
This commit is contained in:
xcomputerman 2010-01-30 10:23:54 +00:00 committed by xcomputerman
parent 48f31c7cb0
commit 164a8b8142
4 changed files with 104 additions and 14 deletions

View File

@ -129,6 +129,7 @@ want_ecore_evas_opengl_glew="no"
want_ecore_evas_software_16_ddraw="no"
want_ecore_evas_quartz="no"
want_ecore_evas_software_sdl="no"
want_ecore_evas_gl_sdl="no"
want_ecore_evas_directfb="no"
want_ecore_evas_fb="no"
want_ecore_evas_software_16_wince="no"
@ -150,6 +151,7 @@ case "$host_os" in
want_ecore_evas_opengl_glew="yes"
want_ecore_evas_software_16_ddraw="auto"
want_ecore_evas_software_sdl="yes"
want_ecore_evas_gl_sdl="yes"
;;
darwin*)
want_curl="yes"
@ -163,6 +165,7 @@ case "$host_os" in
want_ecore_quartz="yes"
want_ecore_evas_quartz="yes"
want_ecore_evas_software_sdl="yes"
want_ecore_evas_gl_sdl="yes"
;;
*)
want_curl="yes"
@ -186,6 +189,7 @@ case "$host_os" in
want_ecore_evas_software_xcb="yes"
want_ecore_evas_xrender_xcb="yes"
want_ecore_evas_software_sdl="yes"
want_ecore_evas_gl_sdl="yes"
want_ecore_evas_directfb="yes"
want_ecore_evas_fb="yes"
;;
@ -1088,6 +1092,14 @@ ECORE_EVAS_CHECK_MODULE([software-sdl],
[${have_ecore_sdl}],
[requirements_ecore_evas="ecore-sdl ${requirements_ecore_evas}"])
# ecore_evas_gl_sdl
ECORE_EVAS_CHECK_MODULE([opengl-sdl],
[${want_ecore_evas_gl_sdl}],
[OpenGL SDL],
[${have_ecore_sdl}],
[requirements_ecore_evas="ecore-sdl ${requirements_ecore_evas}"])
# ecore_evas_directfb
ECORE_EVAS_CHECK_MODULE([directfb],
@ -1302,6 +1314,7 @@ if test "x${have_ecore_evas}" = "xyes" ; then
echo " OpenGL Glew................: $have_ecore_evas_opengl_glew"
echo " Quartz.....................: $have_ecore_evas_quartz"
echo " Software SDL...............: $have_ecore_evas_software_sdl"
echo " OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
echo " DirectFB...................: $have_ecore_evas_directfb"
echo " Software Framebuffer.......: $have_ecore_evas_fb"
echo " Software 16bit X11.........: $have_ecore_evas_software_16_x11"

View File

@ -86,7 +86,8 @@ typedef enum _Ecore_Evas_Engine_Type
ECORE_EVAS_ENGINE_SOFTWARE_FB,
ECORE_EVAS_ENGINE_SOFTWARE_16_X11,
ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE
ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
ECORE_EVAS_ENGINE_OPENGL_SDL
} Ecore_Evas_Engine_Type;
typedef enum _Ecore_Evas_Avoid_Damage_Type
@ -211,6 +212,7 @@ EAPI Ecore_Win32_Window *ecore_evas_win32_window_get(const Ecore_Evas *ee);
EAPI Ecore_Evas *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
EAPI Ecore_Evas *ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
EAPI Ecore_Evas *ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe);
EAPI Ecore_Evas *ecore_evas_software_wince_new(Ecore_WinCE_Window *parent,
int x,

View File

@ -134,6 +134,12 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
return 1;
#else
return 0;
#endif
case ECORE_EVAS_ENGINE_OPENGL_SDL:
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
return 1;
#else
return 0;
#endif
case ECORE_EVAS_ENGINE_DIRECTFB:
#ifdef BUILD_ECORE_EVAS_DIRECTFB
@ -473,6 +479,25 @@ _ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h,
}
#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
static Ecore_Evas *
_ecore_evas_constructor_opengl_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
{
Ecore_Evas *ee;
unsigned int fullscreen = 0, noframe = 0;
char *name = NULL;
_ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
_ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
_ecore_evas_parse_extra_options_uint(extra_options, "noframe=", &noframe);
ee = ecore_evas_gl_sdl_new(name, w, h, fullscreen, noframe);
free(name);
return ee;
}
#endif
#ifdef BUILD_ECORE_EVAS_DIRECTFB
static Ecore_Evas *
_ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
@ -642,6 +667,10 @@ static const struct ecore_evas_engine _engines[] = {
{"software_16_sdl", _ecore_evas_constructor_sdl16},
#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
{"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
#endif
/* independent */
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
{"buffer", _ecore_evas_constructor_buffer},

View File

@ -9,9 +9,14 @@
#include <Ecore.h>
#include <Ecore_Input.h>
#include <Ecore_Input_Evas.h>
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
#include <Ecore_Sdl.h>
#include <Evas_Engine_SDL.h>
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
# include <Ecore_Sdl.h>
# ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
# include <Evas_Engine_SDL.h>
# endif
# ifdef BUILD_ECORE_EVAS_OPENGL_SDL
# include <Evas_Engine_GL_SDL.h>
# endif
#endif
#include "ecore_evas_private.h"
@ -19,7 +24,7 @@
// fixme: 1 sdl window only at a time? seems wrong
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
/* static char *ecore_evas_default_display = "0"; */
/* static Ecore_List *ecore_evas_input_devices = NULL; */
@ -337,7 +342,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
static Ecore_Evas*
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
{
Evas_Engine_Info_SDL *einfo;
void *einfo;
Ecore_Evas *ee;
if (!name)
@ -381,15 +386,32 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
evas_output_size_set(ee->evas, w, h);
evas_output_viewport_set(ee->evas, 0, 0, w, h);
einfo = (Evas_Engine_Info_SDL*) evas_engine_info_get(ee->evas);
if (einfo)
if (rmethod == evas_render_method_lookup("software_sdl"))
{
einfo->info.rotation = 0;
einfo->info.fullscreen = fullscreen;
einfo->info.hwsurface = hwsurface;
einfo->info.noframe = noframe;
einfo->info.alpha = alpha;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
einfo = evas_engine_info_get(ee->evas);
if (einfo)
{
((Evas_Engine_Info_SDL *)einfo)->info.rotation = 0;
((Evas_Engine_Info_SDL *)einfo)->info.fullscreen = fullscreen;
((Evas_Engine_Info_SDL *)einfo)->info.hwsurface = hwsurface;
((Evas_Engine_Info_SDL *)einfo)->info.noframe = noframe;
((Evas_Engine_Info_SDL *)einfo)->info.alpha = alpha;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
#endif
}
else if (rmethod == evas_render_method_lookup("gl_sdl"))
{
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
einfo = evas_engine_info_get(ee->evas);
if (einfo)
{
((Evas_Engine_Info_GL_SDL *)einfo)->flags.fullscreen = fullscreen;
((Evas_Engine_Info_GL_SDL *)einfo)->flags.noframe = noframe;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
#endif
}
if (!ecore_sdl_init(name))
@ -462,3 +484,27 @@ ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUS
return NULL;
}
#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
EAPI Ecore_Evas*
ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe)
{
Ecore_Evas *ee;
int rmethod;
rmethod = evas_render_method_lookup("gl_sdl");
if (!rmethod) return NULL;
ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, 0, noframe, 0);
ee->driver = "gl_sdl";
return ee;
}
#else
EAPI Ecore_Evas*
ecore_evas_gl_sdl_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int noframe __UNUSED__)
{
ERR("OUTCH !");
return NULL;
}
#endif