[SDL_Tizen] Delete using ecore_timer
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenopengles.c
old mode 100644 (file)
new mode 100755 (executable)
index 337eeae..bc68ef0
 
 #if SDL_VIDEO_OPENGL_EGL
 
-#include "SDL_tizenvideo.h"
+#include "SDL_log.h"
 #include "SDL_tizenopengles.h"
+#include "SDL_tizenindicator.h"
+#include "SDL_tizenvideo.h"
 #include "SDL_tizenwindow.h"
-#include "SDL_tizenevents_c.h"
 
-/* EGL implementation of SDL OpenGL ES support */
+#if SDL_VIDEO_OPENGL
+#include "SDL_opengl.h"
+#endif /* SDL_VIDEO_OPENGL */
+
+#if SDL_VIDEO_OPENGL_ES
+#include "SDL_opengles.h"
+#endif /* SDL_VIDEO_OPENGL_ES */
+
+/* GL and GLES2 headers conflict on Linux 32 bits */
+#if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL
+#include "SDL_opengles2.h"
+#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */
 
 int
 Tizen_GLES_LoadLibrary(_THIS, const char *path)
@@ -39,23 +51,34 @@ Tizen_GLES_LoadLibrary(_THIS, const char *path)
     return ret;
 }
 
-
 SDL_GLContext
 Tizen_GLES_CreateContext(_THIS, SDL_Window *window)
 {
     SDL_GLContext context;
 
     context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
+
+    if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS))
+    {
+        SDL_VideoData *data = (SDL_VideoData *) (SDL_GetVideoDevice()->driverdata);
+        if(data->current_thread != SDL_GetThreadID(0))
+            return context;
+        if(!Tizen_Indicator_GLES_Init(window))
+        {
+            SDL_Log("Indicator GLES init error!");
+        }
+    }
+
     return context;
 }
 
 void
 Tizen_GLES_SwapWindow(_THIS, SDL_Window *window)
 {
+    Tizen_DrawIndicator(window);
     SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
 }
 
-
 int
 Tizen_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
 {