#include "../SDL_sysvideo.h"
#include "../../events/SDL_windowevents_c.h"
+enum {
+ ROTATION_TYPE_NORMAL_ROTATION = 0,
+ ROTATION_TYPE_PRE_ROTATION, /* use pre-rotation */
+};
+
#define LOAD_FUNC(NAME) \
_this->tizen_pre_rotation_data->NAME = SDL_LoadFunction(_this->tizen_pre_rotation_data->prerotation_dll_handle, #NAME); \
if (!_this->tizen_pre_rotation_data->NAME) \
return SDL_FALSE; \
}
+static int
+_tizen_rotation_type_get()
+{
+ static int type = ROTATION_TYPE_PRE_ROTATION;
+ static int checked = 0;
+ char *engine = NULL;
+
+ if (checked) return type;
+
+ engine = getenv("SDL_ROTATION");
+
+ if (engine)
+ {
+ if ((!strcasecmp(engine, "normal")))
+ type = ROTATION_TYPE_NORMAL_ROTATION;
+ else if ((!strcasecmp(engine, "pre_rotation")))
+ type = ROTATION_TYPE_PRE_ROTATION;
+ else
+ type = ROTATION_TYPE_PRE_ROTATION;
+ }
+ checked = 1;
+ return type;
+}
+
int
_tizen_PreRotatotion_LoadLibrary(SDL_WindowData *_this, const char *lib_path)
{
//Support PreRotation
wind->support_pre_rotation = 0;
- if (_tizen_PreRotatotion_LoadLibrary(wind, "libwayland-egl.so")) {
+ if (_tizen_rotation_type_get() && _tizen_PreRotatotion_LoadLibrary(wind, "libwayland-egl.so")) {
if (wind->tizen_pre_rotation_data->wl_egl_window_get_capabilities(wind->egl_window) == TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) {
wind->support_pre_rotation = 1;
}