int
SDL_TimerInit(void)
{
-#if defined(__TIZEN__)
- int vsync_timer;
- if (getenv("SDL_VSYNC_TIMER")) {
- vsync_timer = 1;
- }
- else {
- vsync_timer = 0;
- }
-
-
-#endif
SDL_TimerData *data = &SDL_timer_data;
if (!data->active) {
}
data->active = SDL_TRUE;
+
#if defined(__TIZEN__)
- if (vsync_timer) {
- const char* DRM_DEVICE = "/dev/dri/card0";
- data->drm_fd = open( DRM_DEVICE, O_RDWR );
-
- if (data->drm_fd > -1) {
- data->vblankInfo.request.type = DRM_VBLANK_NEXTONMISS;
- data->vblankInfo.request.sequence = 0;
- data->vblankInfo.request.signal = 0;
-
- data->vblankInfo.reply.type = DRM_VBLANK_NEXTONMISS;
- data->vblankInfo.reply.sequence = 0;
- data->vblankInfo.reply.tval_sec = 0;
- data->vblankInfo.reply.tval_usec = 0;
- }
- }
- else {
- data->drm_fd = -1;
- }
+ const char* DRM_DEVICE = "/dev/dri/card0";
+ data->drm_fd = -1;
+ data->drm_fd = open( DRM_DEVICE, O_RDWR );
+
+ if (data->drm_fd > -1) {
+ data->vblankInfo.request.type = DRM_VBLANK_NEXTONMISS;
+ data->vblankInfo.request.sequence = 0;
+ data->vblankInfo.request.signal = 0;
+
+ data->vblankInfo.reply.type = DRM_VBLANK_NEXTONMISS;
+ data->vblankInfo.reply.sequence = 0;
+ data->vblankInfo.reply.tval_sec = 0;
+ data->vblankInfo.reply.tval_usec = 0;
+ }
#endif
/* !!! FIXME: this is nasty. */
#if defined(__WIN32__) && !defined(HAVE_LIBC)
#include <unistd.h>
#include <errno.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 0;
}
-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 && (!strcasecmp(engine, "normal")))
- type = ROTATION_TYPE_NORMAL_ROTATION;
-
- checked = 1;
- return type;
-}
-
int
_tizen_PreRotatotion_LoadLibrary(SDL_VideoData *_this, const char *lib_path)
{
//Support PreRotation
wind->support_pre_rotation = 0;
- if (_tizen_rotation_type_get() && _tizen_PreRotatotion_LoadLibrary(data, "libwayland-egl.so.1")) {
+ if (_tizen_PreRotatotion_LoadLibrary(data, "libwayland-egl.so.1")) {
if (data->tizen_pre_rotation_data.wl_egl_window_get_capabilities(wind->egl_window) == TIZEN_WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED ) {
wind->support_pre_rotation = 1;
}