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