#if SDL_VIDEO_OPENGL_EGL
-#include "SDL_tizenvideo.h"
+#include "SDL_log.h"
#include "SDL_tizenopengles.h"
-#include "SDL_tizenwindow.h"
-#include "SDL_tizenevents_c.h"
-
-#include "SDL_ecore_ipc.h"
+#include "SDL_tizenindicator.h"
#include "SDL_tizenvideo.h"
-
-#include <wayland-extension/tizen-remote-surface-client-protocol.h>
-#include <wayland-tbm-client.h>
-#include <Ecore_Wayland.h>
-#include <SDL_egl.h>
+#include "SDL_tizenwindow.h"
#if SDL_VIDEO_OPENGL
#include "SDL_opengl.h"
#include "SDL_opengles2.h"
#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */
-/* EGL implementation of SDL OpenGL ES support */
-typedef struct GLES2_Context
-{
- #define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
- #include "../../render/opengles2/SDL_gles2funcs.h"
- #undef SDL_PROC
-} GLES2_Context;
-
-GLfloat vVertices[18]={
- 1.0f, 1.0f, 0.0f,
- -1.0f, 0.92f, 0.0f,
- 1.0f, 0.92f, 0.0f,
- 1.0f, 1.0f, 0.0f,
- -1.0f, 1.0f, 0.0f,
- -1.0f, 0.92f, 0.0f
- };
-
-GLfloat vCoord[12] = {
- 1.0f, 0.0f,
- 0.0f, 1.0f,
- 1.0f, 1.0f,
- 1.0f, 0.0f,
- 0.0f, 0.0f,
- 0.0f, 1.0f};
-
-PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR = NULL;
-PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = NULL;
-PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES = NULL;
-
-SharedIndicatorInfo shared_info;
-unsigned int textureID;
-unsigned int indicator_vbo[4], indicator_ibo[4];
-ModelMatrix mMatrix;
-
-
-GLuint programObject;
-GLuint vIndex;
-GLuint cIndex;
-
-
-static int LoadContext(GLES2_Context * data)
-{
- #define SDL_PROC(ret,func,params) \
- do { \
- data->func = SDL_GL_GetProcAddress(#func); \
- if ( ! data->func ) { \
- return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \
- } \
- } while ( 0 );
-
- #include "../../render/opengles2/SDL_gles2funcs.h"
- #undef SDL_PROC
-
- return 0;
-}
-
-static void
-_tizen_rs_cb_buffer_update(void *data, struct tizen_remote_surface *trs, struct wl_buffer *buffer, uint32_t time)
-{
- tizen_remote_surface_transfer_visibility(trs, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE);
- tbm_surface_h tbmSurface= wl_buffer_get_user_data(buffer);
-
- if(eglCreateImageKHR != NULL && glEGLImageTargetTexture2DOES != NULL && eglDestroyImageKHR != NULL)
- {
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
- if(shared_info.eglImage_Indicator != NULL)
- eglDestroyImageKHR(_this->egl_data->egl_display, shared_info.eglImage_Indicator);
-
- shared_info.eglImage_Indicator = eglCreateImageKHR(_this->egl_data->egl_display,
- EGL_NO_CONTEXT, EGL_NATIVE_SURFACE_TIZEN, tbmSurface, NULL);
-
- if(shared_info.eglImage_Indicator == NULL)
- {
- SDL_Log("[SDL] eglImage is NULL");
- return;
- }
- SDL_Log("[SDL] eglImage : %p", shared_info.eglImage_Indicator);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, shared_info.eglImage_Indicator);
- }
- else
- {
- tbm_surface_info_s info;
- tbm_surface_map(tbmSurface, TBM_SURF_OPTION_WRITE|TBM_SURF_OPTION_READ, &info);
-
- SDL_Log("[SDL] Buffer Update %p %p (%dx%d), format:%d", buffer, tbmSurface, info.width, info.height, info.format);
- SDL_Log("[SDL] Info size:%d, offset:%d, stride:%d", info.planes[0].size, info.planes[0].offset, info.planes[0].stride);
-
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
-
- Mainctx.glBindTexture(GL_TEXTURE_2D, textureID);
- Mainctx.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, info.planes[0].stride/4, info.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned int*)info.planes[0].ptr);
-
- if (tbm_surface_unmap (tbmSurface) != TBM_SURFACE_ERROR_NONE)
- SDL_Log("Failed to unmap tbm_surface\n");
- }
-
- if (tbm_surface_destroy (tbmSurface) != TBM_SURFACE_ERROR_NONE)
- SDL_Log("Failed to destroy tbm_surface\n");
-
-}
-
-static void
-_tizen_rs_cb_missing(void *data, struct tizen_remote_surface *trs)
-{
- SDL_Log("Plug is missing...! ");
-}
-
-static const struct tizen_remote_surface_listener _extn_gl_plug_listener =
-{
- _tizen_rs_cb_buffer_update,
- _tizen_rs_cb_missing,
-};
-
-Uint32 _tizen_timer_callback_indicator(void *data)
-{
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
- Tizen_DrawIndicator(_this->windows);
- SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) _this->windows->driverdata)->egl_surface);
-
- return ECORE_CALLBACK_RENEW;
-}
-
-int
-_tizen_indicator_event_filter()
-{
- SDL_Window *window = SDL_GetVideoDevice()->windows;
- SDL_WindowData *wind = window->driverdata;
-
- if(wind->indicator_show && wind->indicator_timer == NULL)
- {
- wind->indicator_timer = ecore_timer_add(0.02, _tizen_timer_callback_indicator, NULL);
- }
- else if(!wind->indicator_show && wind->indicator_timer != NULL)
- {
- ecore_timer_del(wind ->indicator_timer);
- wind->indicator_timer = NULL;
- }
-
- return 1;
-}
-
int
Tizen_GLES_LoadLibrary(_THIS, const char *path)
{
return ret;
}
-static GLuint LoadShader(GLES2_Context* Mainctx, const char *shaderSrc, GLenum type)
-{
- GLuint shader;
- GLint compiled;
-
- shader = Mainctx->glCreateShader(type);
- SDL_Log("shader == %d", shader);
- if(shader == 0)
- return 0;
- Mainctx->glShaderSource(shader, 1, &shaderSrc, NULL);
- Mainctx->glCompileShader(shader);
- Mainctx->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- if(!compiled)
- {
- GLint infoLen = 0;
- Mainctx->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if(infoLen > 1)
- {
- char* infoLog = (char*)(malloc(sizeof(char) * infoLen));
- Mainctx->glGetShaderInfoLog(shader, infoLen, NULL, infoLog);
- SDL_Log("Error compiling shader: %s", infoLog );
- free(infoLog);
- }
- Mainctx->glDeleteShader(shader);
- return 0;
- }
- return shader;
-
-}
-
-extern void ModelMatrixLoadIdentity(ModelMatrix* matrix)
-{
- matrix->m[0][0] = 1.0f;
- matrix->m[0][1] = 0.0f;
- matrix->m[0][2] = 0.0f;
- matrix->m[0][3] = 0.0f;
-
- matrix->m[1][0] = 0.0f;
- matrix->m[1][1] = 1.0f;
- matrix->m[1][2] = 0.0f;
- matrix->m[1][3] = 0.0f;
-
- matrix->m[2][0] = 0.0f;
- matrix->m[2][1] = 0.0f;
- matrix->m[2][2] = 1.0f;
- matrix->m[2][3] = 0.0f;
-
- matrix->m[3][0] = 0.0f;
- matrix->m[3][1] = 0.0f;
- matrix->m[3][2] = 0.0f;
- matrix->m[3][3] = 1.0f;
-}
-
-static void ModelMatrixTranslate(ModelMatrix* matrix, GLfloat x, GLfloat y, GLfloat z)
-{
- matrix->m[3][0] += (matrix->m[0][0] * x + matrix->m[1][0] * y + matrix->m[2][0] * z);
- matrix->m[3][1] += (matrix->m[0][1] * x + matrix->m[1][1] * y + matrix->m[2][1] * z);
- matrix->m[3][2] += (matrix->m[0][2] * x + matrix->m[1][2] * y + matrix->m[2][2] * z);
- matrix->m[3][3] += (matrix->m[0][3] * x + matrix->m[1][3] * y + matrix->m[2][3] * z);
-}
-
-void Tizen_remote_indicator(int res_id)
-{
- if(!shared_info.tizen_rs) {
- //create tizen_remote_surface
- shared_info.tizen_rs = tizen_remote_surface_manager_create_surface(shared_info.tizen_rsm, res_id, shared_info.wl_tbm);
- if(!shared_info.tizen_rs)
- {
- SDL_Log("tizen_rs is NULL");
- return;
- }
- tizen_remote_surface_add_listener(shared_info.tizen_rs, &_extn_gl_plug_listener, NULL);
- tizen_remote_surface_redirect(shared_info.tizen_rs);
- }
-}
-
-void Tizen_glTexImage2D(int idx)
-{
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
-
- Mainctx.glBindTexture(GL_TEXTURE_2D, textureID);
- Mainctx.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, shared_info.fileInfo[idx].ImageWidth, shared_info.fileInfo[idx].ImageHeight,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, (unsigned char*)(shared_info.fileInfo[idx].sharedFile->address));
-}
-
-void Tizen_DrawIndicator(SDL_Window *window)
-{
- SDL_WindowData* wdata = (SDL_WindowData*)window->driverdata;
- if (wdata->received_rotation == 1) {
- ecore_wl_window_rotation_change_done_send(wdata->window);
- wdata->received_rotation = 0;
- }
-
- if(wdata->last_indicator_showtime + 3000< SDL_GetTicks())
- {
- switch(wdata->rotation)
- {
- case 0:
- ModelMatrixTranslate(&mMatrix, 0.0f, 0.02f, 0.0f);
- break;
- case 90:
- ModelMatrixTranslate(&mMatrix, -0.02f, 0.0f, 0.0f);
- break;
- case 180:
- ModelMatrixTranslate(&mMatrix, 0.0f, -0.02f, 0.0f);
- break;
- case 270:
- ModelMatrixTranslate(&mMatrix, 0.02f, 0.0f, 0.0f);
- break;
- }
- }
-
- if(wdata->last_indicator_showtime + 3500 <SDL_GetTicks()) {
- wdata->indicator_show = SDL_FALSE;
- _tizen_indicator_event_filter();
- }
-
- if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && wdata->indicator_show)
- {
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
- Mainctx.glUseProgram(programObject);
-
- Mainctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
- Mainctx.glVertexAttribPointer(vIndex, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
- Mainctx.glVertexAttribPointer(cIndex, 2, GL_FLOAT, GL_FALSE, 0, vCoord);
- Mainctx.glUniformMatrix4fv(Mainctx.glGetUniformLocation(programObject, "modelMatrix"), 1, GL_FALSE, mMatrix.m);
-
- Mainctx.glEnableVertexAttribArray(vIndex);
- Mainctx.glEnableVertexAttribArray(cIndex);
-
- GLboolean isDepthTest = Mainctx.glIsEnabled(GL_DEPTH_TEST);
- if(isDepthTest) Mainctx.glDisable(GL_DEPTH_TEST);
- Mainctx.glDrawArrays(GL_TRIANGLES, 0, 6);
-
- if(isDepthTest) Mainctx.glEnable(GL_DEPTH_TEST);
- Mainctx.glDisableVertexAttribArray(vIndex);
- Mainctx.glDisableVertexAttribArray(cIndex);
- }
-}
-
-SDL_bool Tizen_remote_surface_init(void)
-{
- Eina_Inlist *globals;
- Ecore_Wl_Global *global;
- struct wl_registry *registry;
- if (!shared_info.tizen_rsm)
- {
- registry = ecore_wl_registry_get();
- globals = ecore_wl_globals_get();
-
- if (!registry || !globals)
- {
- SDL_Log( "Could not get registry(%p) or global list(%p)\n", registry, globals);
- return SDL_FALSE;
- }
-
- EINA_INLIST_FOREACH(globals, global)
- {
- if (!strcmp(global->interface, "tizen_remote_surface_manager"))
- {
- shared_info.tizen_rsm = wl_registry_bind(registry, global->id,
- &tizen_remote_surface_manager_interface, 1);
- SDL_Log("[SDL] Create tizen_rsm : %p",shared_info.tizen_rsm);
- }
- }
- shared_info.tizen_rs = NULL;
- }
- if (!shared_info.tizen_rsm)
- {
- SDL_Log("Could not bind tizen_remote_surface_manager");
- return SDL_FALSE;
- }
-
- if(!shared_info.tbm_client)
- {
- shared_info.tbm_client = (struct wayland_tbm_client *)wayland_tbm_client_init(ecore_wl_display_get());
- shared_info.wl_tbm = (struct wl_tbm *)wayland_tbm_client_get_wl_tbm(shared_info.tbm_client);
- if (!shared_info.wl_tbm)
- {
- SDL_Log("[SDL]wl_tbm is NULL");
- return SDL_FALSE;
- }
- }
-
- eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)SDL_GetVideoDevice()->egl_data->eglGetProcAddress("eglCreateImageKHR");
- eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)SDL_GetVideoDevice()->egl_data->eglGetProcAddress("eglDestroyImageKHR");
- glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)SDL_GetVideoDevice()->egl_data->eglGetProcAddress("glEGLImageTargetTexture2DOES");
-
- return SDL_TRUE;
-}
-
-int Tizen_FiniIndicator()
-{
- int n;
- for (n=0; n < SHARED_FILE_NUMBER; n++)
- Tizen_Indicator_SharedFile_Free(&shared_info, n);
-
- if(shared_info.eglImage_Indicator != NULL)
- eglDestroyImageKHR(SDL_GetVideoDevice()->egl_data->egl_display, shared_info.eglImage_Indicator);
-
- if (shared_info.tizen_rs)
- tizen_remote_surface_destroy(shared_info.tizen_rs);
- if (shared_info.tbm_client)
- wayland_tbm_client_deinit(shared_info.tbm_client);
- if (shared_info.tizen_rsm)
- tizen_remote_surface_manager_destroy(shared_info.tizen_rsm);
-
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
- Mainctx.glDeleteProgram(programObject);
- return SDL_TRUE;
-}
-
-int Indicator_GLES_Init(SDL_Window* window)
-{
- SDL_WindowData *wind = window->driverdata;
- ecore_wl_indicator_visible_type_set(wind->window, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
- ecore_wl_window_indicator_opacity_set(wind->window, ECORE_WL_INDICATOR_OPAQUE);
- ecore_wl_window_indicator_state_set(wind->window, ECORE_WL_INDICATOR_STATE_ON);
-
- Ecore_Ipc_Server* IpcServer = serverConnection("elm_indicator", &shared_info);
- if(!IpcServer)
- {
- SDL_Log("Fail to connect elm_indicator!\n");
- return 0;
- }
-
- GLchar vShaderStr[] =
- "attribute vec4 vVertices;\n"
- "attribute vec2 vCoord;\n"
- "uniform mat4 modelMatrix;\n"
- "varying vec2 Coord;\n"
- "void main()\n"
- "{\n"
- " gl_Position = modelMatrix * vVertices;\n"
- " Coord = vCoord;\n"
- "}\n";
-
- GLchar fShaderStr[] =
- "precision mediump float;\n"
- "varying vec2 Coord;\n"
- "uniform sampler2D s_texture;\n"
- "void main()\n"
- "{\n"
- " gl_FragColor = texture2D(s_texture,Coord);\n"
- "}\n";
-
- GLuint vertexShader;
- GLuint fragmentShader;
-
- GLint linked;
-
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
-
- vertexShader = LoadShader(&Mainctx, vShaderStr, GL_VERTEX_SHADER);
- fragmentShader = LoadShader(&Mainctx, fShaderStr, GL_FRAGMENT_SHADER);
- SDL_Log("The vertex shader is %d", vertexShader);
- SDL_Log("The fragment shader is %d", fragmentShader);
-
- programObject = Mainctx.glCreateProgram();
- if(programObject == 0)
- return 0;
-
- Mainctx.glAttachShader(programObject, vertexShader);
- Mainctx.glAttachShader(programObject, fragmentShader);
-
- Mainctx.glLinkProgram(programObject);
- Mainctx.glGetProgramiv(programObject, GL_LINK_STATUS, &linked);
-
- if(!linked)
- {
- GLint infoLen = 0;
- Mainctx.glGetProgramiv(programObject, GL_INFO_LOG_LENGTH, &infoLen);
- if(infoLen > 1)
- {
- char* infoLog = (char*)(malloc(sizeof(char) * infoLen));
- Mainctx.glGetProgramInfoLog(programObject, infoLen, NULL, infoLog);
- SDL_Log("Error linking program: %s", infoLog);
- free(infoLog);
- }
- Mainctx.glDeleteProgram(programObject);
- return 0;
- }
-
- Mainctx.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- Mainctx.glEnable(GL_DEPTH_TEST);
-
- vIndex = Mainctx.glGetAttribLocation(programObject, "vVertices");
- cIndex = Mainctx.glGetAttribLocation(programObject, "vCoord");
-
- Mainctx.glBindAttribLocation(programObject, vIndex, "vVertices");
- Mainctx.glBindAttribLocation(programObject, cIndex, "vCoord");
-
- ModelMatrixLoadIdentity(&mMatrix);
-
-
- Mainctx.glGenTextures(1, &textureID);
- Mainctx.glBindTexture(GL_TEXTURE_2D, textureID);
-
- Mainctx.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- Mainctx.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- Mainctx.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- Mainctx.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-
- wind->indicator_show = SDL_TRUE;
- wind->last_indicator_showtime = SDL_GetTicks();
-
- ecore_main_loop_iterate();
- if (!wind->support_pre_rotation)
- SDL_IndicatorProcessEvent(window, wind->rotation);
- else
- SDL_IndicatorProcessEvent(window, 0);
-
- _tizen_indicator_event_filter();
-
- return 1;
-}
-
SDL_GLContext
Tizen_GLES_CreateContext(_THIS, SDL_Window *window)
{
if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS))
{
- if(!Indicator_GLES_Init(window))
+ 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!");
}
void
Tizen_GLES_SwapWindow(_THIS, SDL_Window *window)
{
- if(!((SDL_WindowData*)window->driverdata)->indicator_show) {
- Tizen_DrawIndicator(window);
- SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
- }
+ Tizen_DrawIndicator(window);
+ SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
}
int
SDL_EGL_DeleteContext(_this, context);
}
-void
-SDL_IndicatorProcessEvent(SDL_Window *window, int rot)
-{
- GLES2_Context Mainctx;
- LoadContext(&Mainctx);
-
- SDL_WindowData *wind = window->driverdata;
- if( rot == 0)
- {
- SDL_Log("===rotate 0 degree!\n");
- vVertices[0] = 1.0f;
- vVertices[1] = 1.0f;
- vVertices[3] = -1.0f;
- vVertices[4] = 0.92f;
- vVertices[6] = 1.0f;
- vVertices[7] = 0.92f;
- vVertices[9] = 1.0f;
- vVertices[10] = 1.0f;
- vVertices[12] = -1.0f;
- vVertices[13] = 1.0f;
- vVertices[15] = -1.0f;
- vVertices[16] = 0.92f;
-
- vCoord[0] = 1.0f;
- vCoord[1] = 0.0f;
- vCoord[2] = 0.0f;
- vCoord[3] = 1.0f;
- vCoord[4] = 1.0f;
- vCoord[5] = 1.0f;
- vCoord[6] = 1.0f;
- vCoord[7] = 0.0f;
- vCoord[8] = 0.0f;
- vCoord[9] = 0.0f;
- vCoord[10] = 0.0f;
- vCoord[11] = 1.0f;
- }
- else if(rot == 90)
- {
- SDL_Log("===rotate 90 degree!\n");
- vVertices[0] = -0.86f;
- vVertices[1] = 1.0f;
- vVertices[3] = -0.86f;
- vVertices[4] = -1.0f;
- vVertices[6] = -1.0f;
- vVertices[7] = 1.0f;
- vVertices[9] = -1.0f;
- vVertices[10] = -1.0f;
- vVertices[12] = -0.86f;
- vVertices[13] = -1.0f;
- vVertices[15] = -1.0f;
- vVertices[16] = 1.0f;
-
- vCoord[0] = 1.0f;
- vCoord[1] = 1.0f;
- vCoord[2] = 0.0f;
- vCoord[3] = 1.0f;
- vCoord[4] = 1.0f;
- vCoord[5] = 0.0f;
- vCoord[6] = 0.0f;
- vCoord[7] = 0.0f;
- vCoord[8] = 0.0f;
- vCoord[9] = 1.0f;
- vCoord[10] = 1.0f;
- vCoord[11] = 0.0f;
- }
- else if(rot == 180)
- {
- SDL_Log("===rotate 180 degree!\n");
- vVertices[0] = -1.0f;
- vVertices[1] = -1.0f;
- vVertices[3] = -1.0f;
- vVertices[4] = -0.92f;
- vVertices[6] = 1.0f;
- vVertices[7] = -1.0f;
- vVertices[9] = 1.0f;
- vVertices[10] = -0.92f;
- vVertices[12] = -1.0f;
- vVertices[13] = -0.92f;
- vVertices[15] = 1.0f;
- vVertices[16] = -1.0f;
-
- vCoord[0] = 1.0f;
- vCoord[1] = 0.0f;
- vCoord[2] = 1.0f;
- vCoord[3] = 1.0f;
- vCoord[4] = 0.0f;
- vCoord[5] = 0.0f;
- vCoord[6] = 0.0f;
- vCoord[7] = 1.0f;
- vCoord[8] = 1.0f;
- vCoord[9] = 1.0f;
- vCoord[10] = 0.0f;
- vCoord[11] = 0.0f;
- }
- else if(rot == 270)
- {
- SDL_Log("===rotate 270 degree!\n");
- vVertices[0] = 1.0f;
- vVertices[1] = 1.0f;
- vVertices[3] = 0.86f;
- vVertices[4] = 1.0f;
- vVertices[6] = 1.0f;
- vVertices[7] = -1.0f;
- vVertices[9] = 0.86f;
- vVertices[10] = -1.0f;
- vVertices[12] = 0.86f;
- vVertices[13] = 1.0f;
- vVertices[15] = 1.0f;
- vVertices[16] = -1.0f;
-
- vCoord[0] = 0.0f;
- vCoord[1] = 0.0f;
- vCoord[2] = 0.0f;
- vCoord[3] = 1.0f;
- vCoord[4] = 1.0f;
- vCoord[5] = 0.0f;
- vCoord[6] = 1.0f;
- vCoord[7] = 1.0f;
- vCoord[8] = 0.0f;
- vCoord[9] = 1.0f;
- vCoord[10] = 1.0f;
- vCoord[11] = 0.0f;
-
- //Invisible Indicator
- wind->indicator_show = SDL_FALSE;
- _tizen_indicator_event_filter();
- }
-
- Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_vbo[wind->rotation/90]);
- Mainctx.glBufferData(GL_ARRAY_BUFFER, 18 * 4, vVertices, GL_STATIC_DRAW);
- Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_ibo[wind->rotation/90]);
- Mainctx.glBufferData(GL_ARRAY_BUFFER, 12 * 4, vCoord, GL_STATIC_DRAW);
-
- ModelMatrixLoadIdentity(&mMatrix);
- wind->indicator_show = SDL_TRUE;
- wind->last_indicator_showtime = SDL_GetTicks();
-
- _tizen_indicator_event_filter();
-
-}
-
#endif /* SDL_VIDEO_DRIVER_TIZEN && SDL_VIDEO_OPENGL_EGL */
/* vi: set ts=4 sw=4 expandtab: */