a24394da1090866004d10bdb1cf501126e4d6c3f
[platform/upstream/ecore.git] / src / lib / ecore_evas / ecore_evas_sdl.c
1 #ifdef HAVE_CONFIG_H
2 # include <config.h>
3 #endif
4
5 #include <Ecore.h>
6 #include <Ecore_Input.h>
7 #include <Ecore_Input_Evas.h>
8 #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
9 # include <Ecore_Sdl.h>
10 # ifdef BUILD_ECORE_EVAS_OPENGL_SDL
11 #  include <Evas_Engine_GL_SDL.h>
12 # endif
13 #endif
14
15 #include <stdlib.h>
16 #include <string.h>
17
18 #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
19 #include <SDL/SDL.h>
20 #endif
21
22 #include "ecore_evas_private.h"
23 #include "Ecore_Evas.h"
24
25 /*
26  * SDL only handle one window at a time. That's by definition, there is nothing wrong here.
27  *
28  */
29 #if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
30
31 /* static char *ecore_evas_default_display = "0"; */
32 /* static Ecore_List *ecore_evas_input_devices = NULL; */
33
34 static int                      _ecore_evas_init_count = 0;
35
36 static Ecore_Evas               *sdl_ee = NULL;
37 static Ecore_Event_Handler      *ecore_evas_event_handlers[4] = {
38    NULL, NULL, NULL, NULL
39 };
40
41 static const char               *ecore_evas_sdl_default = "EFL SDL";
42 static int                      _ecore_evas_fps_debug = 0;
43 static Ecore_Poller             *ecore_evas_event;
44
45 static Ecore_Evas *
46 _ecore_evas_sdl_match(void)
47 {
48    return sdl_ee;
49 }
50
51 static void *
52 _ecore_evas_sdl_switch_buffer(void *data, void *dest __UNUSED__)
53 {
54    SDL_Flip(data);
55    return ((SDL_Surface*)data)->pixels;
56 }
57
58 static Eina_Bool
59 _ecore_evas_sdl_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
60 {
61    Ecore_Evas                   *ee;
62
63    ee = _ecore_evas_sdl_match();
64
65    if (!ee) return ECORE_CALLBACK_PASS_ON;
66    /* pass on event */
67    ee->prop.focused = 1;
68    evas_focus_in(ee->evas);
69    if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
70    return ECORE_CALLBACK_PASS_ON;
71 }
72
73 static Eina_Bool
74 _ecore_evas_sdl_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
75 {
76    Ecore_Evas                   *ee;
77
78    ee = _ecore_evas_sdl_match();
79
80    if (!ee) return ECORE_CALLBACK_PASS_ON;
81    /* pass on event */
82    ee->prop.focused = 0;
83    evas_focus_out(ee->evas);
84    if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
85    return ECORE_CALLBACK_PASS_ON;
86 }
87
88 static Eina_Bool
89 _ecore_evas_sdl_event_video_resize(void *data __UNUSED__, int type __UNUSED__, void *event)
90 {
91    Ecore_Sdl_Event_Video_Resize *e;
92    Ecore_Evas                   *ee;
93    int                           rmethod;
94
95    e = event;
96    ee = _ecore_evas_sdl_match();
97
98    if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
99
100    rmethod = evas_output_method_get(ee->evas);
101    if (rmethod == evas_render_method_lookup("buffer"))
102      {
103         Evas_Engine_Info_Buffer *einfo;
104
105         einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
106         if (einfo)
107           {
108              einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
109              einfo->info.switch_data = SDL_SetVideoMode(e->w, e->h, 32,
110                                                         (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
111                                                         | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0)
112                                                         | (ee->alpha ? SDL_SRCALPHA : 0)
113                                                         | SDL_DOUBLEBUF);
114              if (!einfo->info.switch_data)
115                {
116                   return EINA_FALSE;
117                }
118
119              SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
120              SDL_FillRect(einfo->info.switch_data, NULL, 0);
121
122              einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
123              einfo->info.dest_buffer_row_bytes = e->w * sizeof (int);
124              einfo->info.use_color_key = 0;
125              einfo->info.alpha_threshold = 0;
126              einfo->info.func.new_update_region = NULL;
127              einfo->info.func.free_update_region = NULL;
128              einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
129              if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
130                {
131                   return EINA_FALSE;
132                }
133           }
134      }
135
136    ee->w = e->w;
137    ee->h = e->h;
138    ee->req.w = e->w;
139    ee->req.h = e->h;
140
141    evas_output_size_set(ee->evas, e->w, e->h);
142    evas_output_viewport_set(ee->evas, 0, 0, e->w, e->h);
143
144    return ECORE_CALLBACK_PASS_ON;
145 }
146
147 static Eina_Bool
148 _ecore_evas_sdl_event_video_expose(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
149 {
150    Ecore_Evas                   *ee;
151    int                          w;
152    int                          h;
153
154    ee = _ecore_evas_sdl_match();
155
156    if (!ee) return ECORE_CALLBACK_PASS_ON;
157    evas_output_size_get(ee->evas, &w, &h);
158    evas_damage_rectangle_add(ee->evas, 0, 0, w, h);
159
160    return ECORE_CALLBACK_PASS_ON;
161 }
162
163 static int
164 _ecore_evas_render(Ecore_Evas *ee)
165 {
166    Eina_List *updates;
167
168    updates = evas_render_updates(ee->evas);
169    if (updates)
170      {
171         evas_render_updates_free(updates);
172         _ecore_evas_idle_timeout_update(ee);
173      }
174    return updates ? 1 : 0;
175 }
176
177 static int
178 _ecore_evas_sdl_render(Ecore_Evas *ee)
179 {
180    int rend = 0;
181    Eina_List *ll;
182    Ecore_Evas *ee2;
183
184    EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
185      {
186         if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
187         if (ee2->engine.func->fn_render)
188           rend |= ee2->engine.func->fn_render(ee2);
189         if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
190      }
191
192    if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
193
194    if (ee->prop.avoid_damage) rend = _ecore_evas_render(ee);
195    else if ((ee->visible) ||
196             ((ee->should_be_visible) && (ee->prop.fullscreen)) ||
197             ((ee->should_be_visible) && (ee->prop.override)))
198      rend |= _ecore_evas_render(ee);
199    else
200      evas_norender(ee->evas);
201
202    if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
203    return rend;
204 }
205
206 static Eina_Bool
207 _ecore_evas_sdl_event(void *data __UNUSED__)
208 {
209    ecore_sdl_feed_events();
210    return ECORE_CALLBACK_RENEW;
211 }
212
213 static int
214 _ecore_evas_sdl_init(int w __UNUSED__, int h __UNUSED__)
215 {
216    _ecore_evas_init_count++;
217    if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
218
219 #ifndef _WIN32
220    if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
221 #endif /* _WIN32 */
222    // this is pretty bad: poller? and set poll time? pol time is meant to be
223    // adjustable for things like polling battery state, or amoutn of spare
224    // memory etc.
225    //
226    ecore_evas_event = ecore_poller_add(ECORE_POLLER_CORE, 1, _ecore_evas_sdl_event, NULL);
227    ecore_poller_poll_interval_set(ECORE_POLLER_CORE, 0.006);
228 #ifndef _WIN32
229    if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
230 #endif /* _WIN32 */
231
232    ecore_event_evas_init();
233
234    ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_SDL_EVENT_GOT_FOCUS, _ecore_evas_sdl_event_got_focus, NULL);
235    ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_SDL_EVENT_LOST_FOCUS, _ecore_evas_sdl_event_lost_focus, NULL);
236    ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_SDL_EVENT_RESIZE, _ecore_evas_sdl_event_video_resize, NULL);
237    ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_SDL_EVENT_EXPOSE, _ecore_evas_sdl_event_video_expose, NULL);
238
239    return _ecore_evas_init_count;
240 }
241
242 static int
243 _ecore_evas_sdl_shutdown(void)
244 {
245    _ecore_evas_init_count--;
246    if (_ecore_evas_init_count == 0)
247      {
248         unsigned int i;
249
250         for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++)
251           ecore_event_handler_del(ecore_evas_event_handlers[i]);
252         ecore_event_evas_shutdown();
253         ecore_poller_del(ecore_evas_event);
254         ecore_evas_event = NULL;
255 #ifndef _WIN32
256         if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
257 #endif /* _WIN32 */
258      }
259    if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
260    return _ecore_evas_init_count;
261 }
262
263 static void
264 _ecore_evas_sdl_free(Ecore_Evas *ee)
265 {
266    if (sdl_ee == ee) sdl_ee = NULL;
267
268    ecore_event_window_unregister(0);
269    _ecore_evas_sdl_shutdown();
270    ecore_sdl_shutdown();
271 }
272
273 static void
274 _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
275 {
276    int rmethod;
277
278    if ((w == ee->w) && (h == ee->h)) return;
279    ee->req.w = w;
280    ee->req.h = h;
281    ee->w = w;
282    ee->h = h;
283
284    rmethod = evas_output_method_get(ee->evas);
285    if (rmethod == evas_render_method_lookup("buffer"))
286      {
287         Evas_Engine_Info_Buffer *einfo;
288
289         einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
290         if (einfo)
291           {
292              einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
293              einfo->info.switch_data = SDL_SetVideoMode(w, h, 32,
294                                                         (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
295                                                         | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0)
296                                                         | (ee->alpha ? SDL_SRCALPHA : 0)
297                                                         | SDL_DOUBLEBUF);
298              if (!einfo->info.switch_data)
299                {
300                   return ;
301                }
302
303              SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
304              SDL_FillRect(einfo->info.switch_data, NULL, 0);
305
306              einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
307              einfo->info.dest_buffer_row_bytes = w * sizeof (int);
308              einfo->info.use_color_key = 0;
309              einfo->info.alpha_threshold = 0;
310              einfo->info.func.new_update_region = NULL;
311              einfo->info.func.free_update_region = NULL;
312              einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
313              if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
314                {
315                   return ;
316                }
317           }
318      }
319
320    evas_output_size_set(ee->evas, ee->w, ee->h);
321    evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
322    evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
323
324    if (ee->func.fn_resize) ee->func.fn_resize(ee);
325 }
326
327 static void
328 _ecore_evas_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int w, int h)
329 {
330    if ((w == ee->w) && (h == ee->h)) return;
331    ee->req.w = w;
332    ee->req.h = h;
333    ee->w = w;
334    ee->h = h;
335
336    evas_output_size_set(ee->evas, ee->w, ee->h);
337    evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
338    evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
339
340    if (ee->func.fn_resize) ee->func.fn_resize(ee);
341 }
342
343 static void
344 _ecore_evas_show(Ecore_Evas *ee)
345 {
346    if (ee->prop.focused) return;
347    ee->prop.focused = 1;
348    evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
349 }
350
351 static void
352 _ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
353 {
354    Ecore_Evas *ee;
355
356    ee = data;
357    if (ee) ee->prop.cursor.object = NULL;
358 }
359
360 static void
361 _ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
362 {
363    int x, y;
364
365    if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
366
367    if (!obj)
368      {
369         ee->prop.cursor.object = NULL;
370         ee->prop.cursor.layer = 0;
371         ee->prop.cursor.hot.x = 0;
372         ee->prop.cursor.hot.y = 0;
373         return;
374      }
375
376    ee->prop.cursor.object = obj;
377    ee->prop.cursor.layer = layer;
378    ee->prop.cursor.hot.x = hot_x;
379    ee->prop.cursor.hot.y = hot_y;
380    evas_pointer_output_xy_get(ee->evas, &x, &y);
381    evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
382    evas_object_move(ee->prop.cursor.object,
383                     x - ee->prop.cursor.hot.x,
384                     y - ee->prop.cursor.hot.y);
385    evas_object_pass_events_set(ee->prop.cursor.object, 1);
386    if (evas_pointer_inside_get(ee->evas))
387      evas_object_show(ee->prop.cursor.object);
388
389    evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
390 }
391
392 static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
393 {
394    _ecore_evas_sdl_free,
395    NULL,
396    NULL,
397    NULL,
398    NULL,
399    NULL,
400    NULL,
401    NULL,
402    NULL,
403    NULL,
404    NULL,
405    NULL,
406    NULL,
407    NULL,
408    NULL,
409    NULL,
410    NULL,
411    _ecore_evas_resize,
412    _ecore_evas_move_resize,
413    NULL,
414    NULL,
415    _ecore_evas_show,
416    NULL,
417    NULL,
418    NULL,
419    NULL,
420    NULL,
421    NULL,
422    NULL,
423    NULL,
424    NULL,
425    NULL,
426    _ecore_evas_object_cursor_set,
427    NULL,
428    NULL,
429    NULL,
430    NULL,
431    NULL,
432    NULL,
433    NULL,
434    NULL,
435    NULL,
436    NULL,
437    NULL,
438    NULL,
439    NULL, //transparent
440    NULL, // profiles_set
441
442    NULL,
443    NULL,
444    NULL,
445    NULL,
446    NULL,
447    NULL,
448
449    NULL, // render
450    NULL, // screen_geometry_get
451    NULL  // screen_dpi_get
452 };
453
454 static Ecore_Evas*
455 _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
456 {
457    Ecore_Evas           *ee;
458
459    if (!name)
460      name = ecore_evas_sdl_default;
461
462    ee = calloc(1, sizeof(Ecore_Evas));
463    if (!ee) return NULL;
464
465    ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
466
467    ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_sdl_engine_func;
468
469    ee->driver = "sdl";
470    if (name) ee->name = strdup(name);
471
472    if (w < 1) w = 1;
473    if (h < 1) h = 1;
474    ee->visible = 1;
475    ee->req.w = w;
476    ee->req.h = h;
477    ee->w = w;
478    ee->h = h;
479
480    ee->prop.max.w = 0;
481    ee->prop.max.h = 0;
482    ee->prop.layer = 0;
483    ee->prop.focused = 1;
484    ee->prop.borderless = 1;
485    ee->prop.override = 1;
486    ee->prop.maximized = 1;
487    ee->prop.fullscreen = fullscreen;
488    ee->prop.withdrawn = 0;
489    ee->prop.sticky = 0;
490    ee->prop.window = 0;
491    ee->alpha = alpha;
492    ee->prop.hwsurface = hwsurface;
493
494    /* init evas here */
495    ee->evas = evas_new();
496    evas_data_attach_set(ee->evas, ee);
497    evas_output_method_set(ee->evas, rmethod);
498
499    evas_output_size_set(ee->evas, w, h);
500    evas_output_viewport_set(ee->evas, 0, 0, w, h);
501
502    if (rmethod == evas_render_method_lookup("buffer"))
503      {
504         Evas_Engine_Info_Buffer *einfo;
505
506         einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
507         if (einfo)
508           {
509              SDL_Init(SDL_INIT_NOPARACHUTE);
510
511              if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
512                {
513                   ERR("SDL_Init failed with %s", SDL_GetError());
514                   SDL_Quit();
515                   return NULL;
516                }
517
518              einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
519              einfo->info.switch_data = SDL_SetVideoMode(w, h, 32,
520                                                         (hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
521                                                         | (fullscreen ? SDL_FULLSCREEN : 0)
522                                                         | (noframe ? SDL_NOFRAME : 0)
523                                                         | (alpha ? SDL_SRCALPHA : 0)
524                                                         | SDL_DOUBLEBUF);
525              if (!einfo->info.switch_data)
526                {
527                   ERR("SDL_SetVideoMode failed !");
528                   ecore_evas_free(ee);
529                   return NULL;
530                }
531
532              SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
533              SDL_FillRect(einfo->info.switch_data, NULL, 0);
534
535              einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
536              einfo->info.dest_buffer_row_bytes = w * sizeof (int);
537              einfo->info.use_color_key = 0;
538              einfo->info.alpha_threshold = 0;
539              einfo->info.func.new_update_region = NULL;
540              einfo->info.func.free_update_region = NULL;
541              einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
542              if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
543                {
544                   ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
545                   ecore_evas_free(ee);
546                   return NULL;
547                }
548           }
549         else
550           {
551              ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
552              ecore_evas_free(ee);
553              return NULL;
554           }
555      }
556    else if (rmethod == evas_render_method_lookup("gl_sdl"))
557      {
558 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
559         Evas_Engine_Info_GL_SDL *einfo;
560
561         einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(ee->evas);
562         if (einfo)
563           {
564              einfo->flags.fullscreen = fullscreen;
565              einfo->flags.noframe = noframe;
566              if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
567                {
568                   ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
569                   ecore_evas_free(ee);
570                   return NULL;
571                }
572           }
573         else
574           {
575              ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
576              ecore_evas_free(ee);
577              return NULL;
578           }
579 #endif
580      }
581    else
582      {
583         ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
584         ecore_evas_free(ee);
585         return NULL;
586      }
587
588    if (!ecore_sdl_init(name))
589      {
590         evas_free(ee->evas);
591         if (ee->name) free(ee->name);
592         free(ee);
593         return NULL;
594      }
595
596    _ecore_evas_sdl_init(w, h);
597
598    ecore_event_window_register(0, ee, ee->evas,
599                                (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
600                                (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
601                                (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
602                                (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
603
604    SDL_ShowCursor(SDL_ENABLE);
605
606    ee->engine.func->fn_render = _ecore_evas_sdl_render;
607    _ecore_evas_register(ee);
608
609    sdl_ee = ee;
610    return ee;
611 }
612 #endif
613
614 #ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
615 EAPI Ecore_Evas*
616 ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
617 {
618    Ecore_Evas          *ee;
619    int                  rmethod;
620
621    rmethod = evas_render_method_lookup("buffer");
622    if (!rmethod) return NULL;
623
624    ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha);
625    return ee;
626 }
627 #else
628 EAPI Ecore_Evas*
629 ecore_evas_sdl_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__)
630 {
631    ERR("OUTCH !");
632    return NULL;
633 }
634 #endif
635
636 EAPI Ecore_Evas*
637 ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__)
638 {
639    ERR("OUTCH !");
640    return NULL;
641 }
642
643 #ifdef BUILD_ECORE_EVAS_OPENGL_SDL
644 EAPI Ecore_Evas*
645 ecore_evas_gl_sdl_new(const char* name, int w, int h, int fullscreen, int noframe)
646 {
647    Ecore_Evas          *ee;
648    int                  rmethod;
649
650    rmethod = evas_render_method_lookup("gl_sdl");
651    if (!rmethod) return NULL;
652
653    ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, 0, noframe, 0);
654    if (ee) ee->driver = "gl_sdl";
655    return ee;
656 }
657 #else
658 EAPI Ecore_Evas*
659 ecore_evas_gl_sdl_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int noframe __UNUSED__)
660 {
661    ERR("OUTCH !");
662    return NULL;
663 }
664 #endif
665