2 Simple DirectMedia Layer
3 Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
4 Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
6 Contact: Sangjin Lee <lsj119@samsung.com>
8 This software is provided 'as-is', without any express or implied
9 warranty. In no event will the authors be held liable for any damages
10 arising from the use of this software.
12 Permission is granted to anyone to use this software for any purpose,
13 including commercial applications, and to alter it and redistribute it
14 freely, subject to the following restrictions:
16 1. The origin of this software must not be misrepresented; you must not
17 claim that you wrote the original software. If you use this software
18 in a product, an acknowledgment in the product documentation would be
19 appreciated but is not required.
20 2. Altered source versions must be plainly marked as such, and must not be
21 misrepresented as being the original software.
22 3. This notice may not be removed or altered from any source distribution.
24 #include "../../SDL_internal.h"
26 #if SDL_VIDEO_DRIVER_TIZEN && SDL_VIDEO_OPENGL_EGL
28 #include "SDL_tizenvideo.h"
29 #include "SDL_tizenopengles.h"
30 #include "SDL_tizenwindow.h"
31 #include "SDL_tizenevents_c.h"
33 /* EGL implementation of SDL OpenGL ES support */
36 Tizen_GLES_LoadLibrary(_THIS, const char *path)
40 ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)ecore_wl_display_get());
47 Tizen_GLES_CreateContext(_THIS, SDL_Window *window)
49 SDL_GLContext context;
50 context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
56 Tizen_GLES_SwapWindow(_THIS, SDL_Window *window)
58 SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
63 Tizen_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
67 if (window && context) {
68 ret = SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *) window->driverdata)->egl_surface, context);
70 ret = SDL_EGL_MakeCurrent(_this, NULL, NULL);
77 Tizen_GLES_DeleteContext(_THIS, SDL_GLContext context)
79 SDL_EGL_DeleteContext(_this, context);
82 #endif /* SDL_VIDEO_DRIVER_TIZEN && SDL_VIDEO_OPENGL_EGL */
84 /* vi: set ts=4 sw=4 expandtab: */