Example #1
0
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
#ifdef _WIN32_WCE
        gcc_unused LPWSTR lpCmdLine,
#else
        gcc_unused LPSTR lpCmdLine2,
#endif
        int nCmdShow)
#endif
{
  InitAsset();

  // Write startup note + version to logfile
  LogStartUp(_T("Starting XCSoar %s"), XCSoar_VersionString);

  // Read options from the command line
#ifndef WIN32
  HINSTANCE hInstance = NULL;
  const TCHAR *lpCmdLine = argc >= 2 ? argv[1] : _T("");
#elif !defined(_WIN32_WCE)
  /* on Windows (non-CE), the lpCmdLine argument is narrow, and we
     have to use GetCommandLine() to get the UNICODE string */
  LPCTSTR lpCmdLine = GetCommandLine();
#endif

  ParseCommandLine(lpCmdLine);

  ScreenGlobalInit screen_init;

  // Write initialization note to logfile
  LogStartUp(_T("Initialise application instance"));

#ifdef WIN32
  /* try to make the UI most responsive */
  SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
#endif

  // Perform application initialization and run loop
  if (!XCSoarInterface::Startup(hInstance))
    return 0;

  int ret = CommonInterface::main_window.event_loop();
  CommonInterface::main_window.reset();

  Fonts::Deinitialize();
  Graphics::Deinitialise();

  return ret;
}
Example #2
0
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
#ifdef _WIN32_WCE
        gcc_unused LPWSTR lpCmdLine,
#else
        gcc_unused LPSTR lpCmdLine2,
#endif
        int nCmdShow)
#endif
{
  InitAsset();

  // Write startup note + version to logfile
  LogStartUp(_T("Starting XCSoar %s"), XCSoar_VersionString);

  // Read options from the command line
#ifndef WIN32
  HINSTANCE hInstance = NULL;
  const TCHAR *lpCmdLine = argc >= 2 ? argv[1] : _T("");
#elif !defined(_WIN32_WCE)
  /* on Windows (non-CE), the lpCmdLine argument is narrow, and we
     have to use GetCommandLine() to get the UNICODE string */
  LPCTSTR lpCmdLine = GetCommandLine();
#endif

  ParseCommandLine(lpCmdLine);

#ifndef ENABLE_SDL
  InitCommonControls();
#endif /* !ENABLE_SDL */

  // Write initialization note to logfile
  LogStartUp(_T("Initialise application instance"));

  // Perform application initialization and run loop
  if (!XCSoarInterface::Startup(hInstance))
    return 0;

  return CommonInterface::main_window.event_loop();
}
Example #3
0
JNIEXPORT jboolean JNICALL
Java_org_xcsoar_NativeView_initializeNative(JNIEnv *env, jobject obj,
                                            jobject context,
                                            jint width, jint height)
{
  Java::Init(env);

  OpenGL::Initialise();

  assert(native_view == NULL);
  native_view = new NativeView(env, obj, context, width, height);
  InitAsset();

  Profile::SetFiles(_T(""));

  event_queue = new EventQueue();

  sound_util = new SoundUtil(env);

  ScreenInitialized();
  return XCSoarInterface::Startup(NULL);
}