[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 6fe7c3c..bc68ef0
@@ -3,8 +3,6 @@
   Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
   Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
 
-  Contact: Sangjin Lee <lsj119@samsung.com>
-
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   arising from the use of this software.
 */
 #include "../../SDL_internal.h"
 
-#if SDL_VIDEO_DRIVER_TIZEN && SDL_VIDEO_OPENGL_EGL
+#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)
@@ -38,27 +48,37 @@ Tizen_GLES_LoadLibrary(_THIS, const char *path)
     int ret;
 
     ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)ecore_wl_display_get());
-
     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)
 {