support to check EGL extension 98/86298/2
authorDaeKwang Ryu <dkdk.ryu@samsung.com>
Wed, 31 Aug 2016 10:53:44 +0000 (19:53 +0900)
committerDaekwang Ryu <dkdk.ryu@samsung.com>
Wed, 31 Aug 2016 11:02:03 +0000 (04:02 -0700)
Change-Id: Iad41f3044f86227aadda62e82cae0d770b9ac804

src/video/SDL_video.c

index b791f27..051c3a3 100644 (file)
@@ -28,6 +28,7 @@
 #include "SDL_blit.h"
 #include "SDL_pixels_c.h"
 #include "SDL_rect_c.h"
+#include "SDL_egl_c.h"
 #include "../events/SDL_events_c.h"
 #include "../timer/SDL_timer_c.h"
 
@@ -2754,6 +2755,35 @@ SDL_GL_ExtensionSupported(const char *extension)
 
         start = terminator;
     }
+#ifdef __TIZEN__
+/* check EGL extensions (copied from SDL_EGL_HasExtension())*/
+    int i;
+    int len = 0;
+    size_t ext_len;
+    const char *exts;
+    const char *ext_word;
+
+    ext_len = SDL_strlen(extension);
+    exts = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_EXTENSIONS);
+
+    if (exts) {
+        ext_word = exts;
+
+        for (i = 0; exts[i] != 0; i++) {
+            if (exts[i] == ' ') {
+                if (ext_len == len && !SDL_strncmp(ext_word, extension, len)) {
+                    return SDL_TRUE;
+                }
+
+                len = 0;
+                ext_word = &exts[i + 1];
+            } else {
+                len++;
+            }
+        }
+    }
+#endif
+
     return SDL_FALSE;
 #else
     return SDL_FALSE;