#include <app_internal.h>
#include <app_extension.h>
#include <system_settings.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "SDL"
static int tizen_appcore_initialized = 0;
static appcore_context_h appcore_handle = NULL;
static bool
_tizen_sdl_create(void *data)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL_AppCore CreateCB");
+ LOGI("SDL_AppCore CreateCB");
return true;
}
static void
_tizen_sdl_terminate(void *data)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL_AppCore TermincateCB");
+ LOGI("SDL_AppCore TermincateCB");
SDL_SendQuit();
SDL_SendAppEvent(SDL_APP_TERMINATING);
return;
static void
_tizen_sdl_pause (void *data)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL_AppCore PauseCB");
+ LOGI("SDL_AppCore PauseCB");
SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND);
SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND);
return;
static void
_tizen_sdl_resume(void *data)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL_AppCore ResumeCB");
+ LOGI("SDL_AppCore ResumeCB");
SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND);
SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND);
return;
static void
_tizen_sdl_control(app_control_h app_control, void *data)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL_AppCore ControlCB");
+ LOGI("SDL_AppCore ControlCB");
+
+ SDL_Event event;
+ SDL_memset(&event, 0, sizeof(event));
+ event.type = SDL_APP_CONTROL;
+ event.user.code = 0;
+ event.user.data1 = (void*)app_control;
+ event.user.data2 = (void*)data;
+
+ SDL_PushEvent(&event);
return;
}
{
/*APP_EVENT_LANGUAGE_CHANGED*/
char *locale = NULL;
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Language changedCB");
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Language changedCB");
system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
free(locale);
return;
SDL_memset(&event, 0, sizeof(event));
event.type = SDL_ROTATEEVENT;
event.user.code = 0;
- event.window.data1 = (void*)orientation;
+ event.user.data1 = (void*)orientation;
event.user.data2 = -1;
SDL_PushEvent(&event);
int
SDL_tizen_app_init(int argc, char *argv[])
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "SDL Tizen App initialize");
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL Tizen App initialize");
if (tizen_appcore_initialized)
{
- SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Already initialized!");
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Already initialized!");
return 0;
}
tizen_appcore_initialized = 1;